Add named defun for transpose-sexps-default-function (bug#60654)
* lisp/simple.el (transpose-sexps-default-function): Move the lambda
into its own function.
(transpose-sexps-function): Refer to it by name.
* etc/NEWS: Mention the change.
* lisp/net/tramp-container.el (tramp-toolbox-program): New defcustom.
(tramp-toolbox-method): New defconst.
(tramp-toolbox--completion-function): New defun. Set it for "toolbox".
(tramp-methods) <toolbox>: Add.
(tramp-default-host-alist): Add rule for "toolbox".
Stefan Kangas [Sat, 7 Jan 2023 05:30:10 +0000 (06:30 +0100)]
Merge from origin/emacs-29
9d410f8de64 (treesit-simple-indent-presets): Ensure 'and' works for a... ff66a5d324b (treesit--indent-rules-optimize): Optimize 'and' and 'or'... f2ebe43362c (treesit-simple-indent-presets): Short-circuit 'and' and ... 2ea6ee5cbfa (font-lock-regexp-face): New face 5ab03bcc433 Unify the string interpolation delimiters face across ts ... 92e8c0c091c ruby-ts-mode: Highlight more kinds of parameters 7420b6dcc37 Fix `pr-interface' 699711786ac Further generic-related improvements in csharp-ts-mode (b...
Dmitry Gutov [Sat, 7 Jan 2023 00:44:07 +0000 (02:44 +0200)]
(treesit--indent-rules-optimize): Optimize 'and' and 'or' matcher forms
* lisp/treesit.el (treesit--indent-rules-optimize):
Optimize 'and' and 'or' matcher forms. When 'and' has a 'query'
matcher inside (as is the case in ruby-ts--indent-rules, many
times over), this yields a significant performance boost.
Dmitry Gutov [Sat, 7 Jan 2023 00:02:25 +0000 (02:02 +0200)]
(treesit-simple-indent-presets): Short-circuit 'and' and 'or'
* lisp/treesit.el (treesit-simple-indent-presets):
Short-circuit the 'and' and 'or' matchers. To avoid calling all
fns after one returned nil or truthy value, respectively.
Dmitry Gutov [Fri, 6 Jan 2023 17:56:20 +0000 (19:56 +0200)]
(font-lock-regexp-face): New face
* lisp/font-lock.el (font-lock-regexp-face): New face.
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings):
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
* lisp/progmodes/js.el (js--treesit-font-lock-settings):
Use it for regexps.
Dmitry Gutov [Fri, 6 Jan 2023 13:38:00 +0000 (15:38 +0200)]
ruby-ts-mode: Highlight more kinds of parameters
* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--font-lock-settings): Highlight destructured parameters,
lambda parameters, identifiers in pattern matching clauses
(array/hash) and exception variables.
Move the 'symbol' matchers lower to make 'hash_key_symbol' lower
priority than hash keys in match patterns.
* lisp/net/tramp-adb.el:
* lisp/net/tramp-archive.el:
* lisp/net/tramp-cache.el:
* lisp/net/tramp-cmds.el:
* lisp/net/tramp-crypt.el:
* lisp/net/tramp-fuse.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-rclone.el:
* lisp/net/tramp-sh.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp-sshfs.el:
* lisp/net/tramp-sudoedit.el:
* lisp/net/tramp.el:
* lisp/net/trampver.el: Replace the removed `tramp-compat-*' items
by their real definition. Don't use `tramp-compat-funcall' when
not needed. Remove `with-no-warnings' and `ignore-errors' where
appropriate.
* lisp/net/tramp.el (tramp-file-name-for-operation): Rearrange list.
(tramp-handle-file-newer-than-file-p): Simplify.
(tramp-get-process-attributes): Don't check for existence of
`connection-local-criteria-for-default-directory'.
(tramp-handle-shell-command): Don't check for existence of
`shell-command-save-pos-or-erase', `async-shell-command-width' and
`shell-command-set-point-after-cmd'.
(tramp-handle-start-file-process): Call `make-process' directly.
(tramp-defined-time): New defsubst.
(tramp-get-local-gid): Don't check for existence of `group-name'.
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times):
Use `tramp-defined-time'.
(tramp-adb-get-signal-strings): Don't bind `shell-file-name' and
`shell-command-switch'.
* lisp/net/tramp-archive.el (top, tramp-archive-file-name-handler):
Don't bind `max-specpdl-size' any longer.
(tramp-archive-autoload-file-name-regexp): Remove Emacs 26
specific code.
(top): Don't call `tramp-register-archive-autoload-file-name-handler'.
* lisp/net/tramp-gvfs.el (top): Don't bind `max-specpdl-size' any longer.
(tramp-gvfs-handle-set-file-times): Use `tramp-defined-time'.
* lisp/net/tramp-sh.el (tramp-sh-handle-set-file-times):
Use `tramp-defined-time'.
* test/lisp/net/tramp-archive-tests.el (tramp-archive--test-emacs27-p):
Remove.
(all):
* test/lisp/net/tramp-tests.el (all): Don't skip for Emacs 26.
Replace the removed `tramp-compat-*' items by their real
definition. Don't use `tramp-compat-funcall' when not needed.
Remove `with-no-warnings' and `ignore-errors' where appropriate.
(with-connection-local-variables)
(shell-command-dont-erase-buffer): Don't declare.
(tramp-test10-write-region): Don't check for `make-empty-file'.
(tramp-test32-shell-command): Simplify.
(tramp-test34-explicit-shell-file-name): Don't protect
`explicit-shell-file-name' any longer.
(tramp--test-emacs27-p): Remove.
Robert Pluim [Fri, 6 Jan 2023 08:00:00 +0000 (09:00 +0100)]
Fix `pr-interface'
`pr-interface' specifies `inline' for its menu items, which is not
necessary, but it causes `widget-choice-value-create' to bug
out. (Bug#60501)
* lisp/wid-edit.el (widget-choice-value-create): Allow the value to be
a non-list.
* test/lisp/wid-edit-tests.el (widget-test-handle-spurious-inline):
Add test to ensure that unnecessary :inline is allowed.
Stefan Kangas [Fri, 6 Jan 2023 05:30:10 +0000 (06:30 +0100)]
Merge from origin/emacs-29
0f5e74f1734 ruby-ts-mode: Highlight method and block parameters f1aa306f915 ruby-ts-mode: Highlight variable assignments 089b08eb3eb ruby-ts-mode: Move 'self' and 'super' from constants to k... 7ede600273c (ruby-ts-mode): Split font-lock feature 'builtin' into two ec172d748f3 Avoid assertion violation due to fill-column indicator face 62c2963ce60 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... 2e6070f16c4 ; Another review of etc/NEWS 16eca92415b ; * src/gnutls.c (Fgnutls_deinit): Fix typo in doc string... 4753b587868 * lisp/cedet/semantic/symref/grep.el: Support ts-modes (b... 8a18369afdc ; Another fix for doc strings of 2 treesit.el functions 3fc68833517 ; Fix the doc strings of 2 treesit.el functions 83ce7c861e1 Make 'toml-ts-mode' optional
Perry Smith [Fri, 6 Jan 2023 02:20:02 +0000 (04:20 +0200)]
ruby-ts-mode: Highlight variable assignments
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Bring back the 'assignment' feature.
(ruby-ts-mode): Replace the unused 'variable' with 'assignment'. Use
the level 3 for consistency with other ts modes.
Update the Commentary as well.
Dmitry Gutov [Fri, 6 Jan 2023 01:12:20 +0000 (03:12 +0200)]
(ruby-ts-mode): Split font-lock feature 'builtin' into two
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Split the 'builtin' feature in two: 'builtin-constant' and
'builtin-variable'.
(ruby-ts-highlight-predefined-constants):
Drop the user option, the highlighting granularity can be chosen
using treesit-font-lock-recompute-features.
(ruby-ts--font-lock-settings): Update accordingly.
(ruby-ts--predefined-constants, ruby-ts--predefined-variables):
Fix docstrings.
Eli Zaretskii [Thu, 5 Jan 2023 20:33:51 +0000 (22:33 +0200)]
Avoid assertion violation due to fill-column indicator face
* src/xdisp.c (extend_face_to_end_of_line): Use the original
iterator metrics for the stretch glyph, the one unaffected by the
'fill-column-indicator' face. (Bug#60580)
Stefan Kangas [Thu, 5 Jan 2023 05:30:20 +0000 (06:30 +0100)]
Merge from origin/emacs-29
92f753dc190 ; * etc/NEWS: Fix wording in last change. cef875f6c51 ; * etc/NEWS: Instructions for builds without tree-sitter... 8d530ca6542 ; Fix documentation of y-or-n-p/yes-or-no-p c18878ee0a2 Fix bug in Tramp multi-hop 7eed8e050a9 * lisp/files.el (find-sibling-rules): Fix docstring. 6b5831c6964 Tree-sitter doc fixes (bug#60524) 651927ac391 ; Fix function reference in comment in c-ts-mode.el (bug#... c786afcbb9f Fontify C++ function definitions in c-ts-mode (bug#60529)
Juri Linkov [Wed, 4 Jan 2023 07:57:06 +0000 (09:57 +0200)]
Tree-sitter doc fixes (bug#60524)
* doc/lispref/modes.texi (Parser-based Font Lock):
Replace :lang with :language.
* doc/lispref/parsing.texi (Language Grammar): Replace
treesit-load-suffixes with dynamic-library-suffixes.
(Retrieving Nodes): Fix function names.
(Tree-sitter Major Modes): Fix treesit-ready-p args.
Fix pxref to Parser-based Indentation.
(Tree-sitter C API): Fix function names.
* lisp/treesit.el (treesit--simple-indent-eval): Remove cond BODY
duplicated from CONDITION.
(treesit)<define-short-documentation-group>: Fix function names.
Daniel Martín [Tue, 3 Jan 2023 21:08:13 +0000 (22:08 +0100)]
Fontify C++ function definitions in c-ts-mode (bug#60529)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--declarator-identifier):
Teach the code how to extract the declarator of a node of type
"qualified_identifier".
(c-ts-mode--fontify-declarator): Consider the case where the
identifier in a function declarator is buried inside
"qualifier_identifier" nodes.
Dmitry Gutov [Tue, 3 Jan 2023 22:37:43 +0000 (00:37 +0200)]
(ruby-ts-add-log-current-function): Fix when between two methods
* lisp/progmodes/ruby-ts-mode.el
(ruby-ts-add-log-current-function): Fix the case when point is
between two methods. 'treesit-node-at' returs the 'def' node of
the method after point in such case, so it behaved like point was
inside the method below.
* test/lisp/progmodes/ruby-ts-mode-tests.el
(ruby-ts-add-log-current-method-outside-of-method):
Update the test case.
* test/lisp/progmodes/ruby-mode-tests.el
(ruby-add-log-current-method-outside-of-method):
Mirror that change.
Stefan Kangas [Tue, 3 Jan 2023 05:30:17 +0000 (06:30 +0100)]
Merge from origin/emacs-29
6dd3e352f44 Extract common code into ruby-base-mode to derive from 94e330243e1 ruby-ts-mode: Indentation fixes 9b24417dda8 ruby-ts--font-lock-settings: Use more standard faces 9e6536e4d96 ruby-ts-mode: Standardize the string literal highlights 1a9a1fdebf6 Improve fontification in java-ts-mode (bug#60492) dfdf9c21cbe Fontification improvements in typescript-ts-mode (bug#60500) 68e68dfeefe Improve fontification consistency in js-ts-mode (bug#60503) aef869e74f4 ; Update tree-sitter manual 4ef12cfb1fc ; Fix tree-sitter manual title case aab8ddca5e1 ; nt/INSTALL: Update for Emacs 29. 809fbb0e8c4 ; Update copyright notice in tramp-sh.el f8f5202487c (typescript/tsx-ts-mode): Split font-lock feature list in... a86a213e1ac js-ts-mode: Move 'string-interpolation' to font-lock level 3 d26b523886e Fix shrinking of the tab-bar 3f7ea621b90 ; Fix typos in ruby-ts-mode.el 9599b054316 ; Skip ruby-ts tests if grammar is not available ff35ac9dfab Fix default-port regression in erc-select-read-args b7ad0b40148 ; Clarify doc strings of 'call-process' and 'call-process...
Dmitry Gutov [Tue, 3 Jan 2023 01:10:49 +0000 (03:10 +0200)]
Extract common code into ruby-base-mode to derive from
* lisp/progmodes/ruby-mode.el (ruby-base-mode):
New major base mode, to set up common vars and hooks.
(ruby-mode-variables): Delete. Move most code to ruby-base-mode.
And some -- to ruby-mode body.
(ruby-mode): Derive from ruby-base-mode. Also move some setup
to there.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Derive from ruby-base-mode. Remove duplicating settings.
Dmitry Gutov [Tue, 3 Jan 2023 00:26:00 +0000 (02:26 +0200)]
ruby-ts-mode: Indentation fixes
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--align-keywords):
Fix for 'def' (which was misread as 'method' in the check).
(ruby-ts--indent-rules): Indent the curly block closer the same
way as the 'do ... end' closer.
Dmitry Gutov [Mon, 2 Jan 2023 22:41:25 +0000 (00:41 +0200)]
ruby-ts--font-lock-settings: Use more standard faces
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Use more standard faces for regexp literals and string
interpolation delimiters (following js-ts-mode).
Dmitry Gutov [Mon, 2 Jan 2023 21:26:39 +0000 (23:26 +0200)]
ruby-ts-mode: Standardize the string literal highlights
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Use font-lock-string-face for %w() and `...`.
Use font-lock-constant-face (just like we do for symbol literals)
for symbol array literals, %i().
Combine the matchers for string content and heredocs.
Fontification improvements in typescript-ts-mode (bug#60500)
- highlight method-definitins in interfaces.
- only highlight variable-declarations, not variables
everywhere (consistency with other modes).
- move highlighting of method invocations to level 4
Paul Eggert [Mon, 2 Jan 2023 18:00:41 +0000 (10:00 -0800)]
Improve interactive file-saving performance
* src/fileio.c (init_fileio):
No longer any need to set write-region-inhibit-fsync here.
(syms_of_fileio): Default write-region-inhibit-fsync to t (Bug#60474).
Eli Zaretskii [Mon, 2 Jan 2023 15:02:05 +0000 (17:02 +0200)]
Fix shrinking of the tab-bar
* src/haikufns.c (haiku_change_tab_bar_height):
* src/pgtkfns.c (pgtk_change_tab_bar_height):
* src/nsfns.m (ns_change_tab_bar_height):
* src/w32fns.c (w32_change_tab_bar_height):
* src/xfns.c (x_change_tab_bar_height): Don't let the number of
tab-bar lines degenerate to zero due to integer division.
(Bug#60210)
F. Jason Park [Thu, 29 Dec 2022 14:43:19 +0000 (06:43 -0800)]
Fix default-port regression in erc-select-read-args
* lisp/erc/erc.el (erc--warn-unencrypted): New function, likely
temporary, to warn new users connecting interactively to the default
server, "irc.libara.chat", via the default non-TLS port, 6667.
(erc-select-read-args): Remove stray code from incomplete feature
introduced by bug#56514. Ensure connecting always works with default
port, which is non-TLS. Respect `erc-prompt-for-password' when user
pastes URL containing password component into "server" prompt. Maybe
add `erc--warn-unencrypted' as one-off hook for impending connection.
* test/lisp/erc/erc-tests.el (erc-select-read-args): Always expect
password prompt and sometimes a non-TLS port when `erc' called
interactively. (Bug#60428.)
Daniel Martín [Sat, 31 Dec 2022 00:45:27 +0000 (01:45 +0100)]
Fix fontification of C++ reference return types (bug#60441)
* lisp/progmodes/c-ts-mode.el (c-ts-fontify-error): Treat
reference_declarator nodes the same as pointer_declarator nodes when
calculating the identifier to fontify.
Adjust function-call fontification in csharp-ts-mode (bug#60376)
- Ensure method-invocations are highlighted only on level 4.
- Ensure consistent fontification of variable declarations
(don't highlight usage of all variables).
- Fix issues with highlighting types in new() expressions.
- Fix issues with generic types in variable-declarations not using "var".
- Use fewer, more general queries for function-invocations. simplify code.
Fix shortdoc-tests failure with respect to regexp-opt-charset
* test/lisp/emacs-lisp/shortdoc-tests.el (regexp-opt): Require.
`regexp-opt-charset` is not autoloaded, and whether `regexp-opt` is
preloaded is configuration-dependent.
Eli Zaretskii [Sun, 1 Jan 2023 10:47:47 +0000 (05:47 -0500)]
Merge from origin/emacs-29
cae528457c ; Add 2023 to copyright years. b394359261 Improve documentation of 'isearch-open-overlay-temporary' ab3210e709 Document 'use-package' in the 2 main manuals
Eli Zaretskii [Sun, 1 Jan 2023 09:04:22 +0000 (11:04 +0200)]
Improve documentation of 'isearch-open-overlay-temporary'
* lisp/isearch.el (isearch-open-overlay-temporary): Document that
the overlay passed to the 'isearch-open-invisible-temporary'
function cannot be deleted too early. (Bug#60399)