]> git.eshelyaron.com Git - emacs.git/log
emacs.git
21 months agoFix indentation in json-ts-mode (bug#60123)
Jostein Kjønigsen [Fri, 16 Dec 2022 15:01:41 +0000 (16:01 +0100)]
Fix indentation in json-ts-mode (bug#60123)

* lisp/progmodes/json-ts-mode.el
(json-ts--indent-rules): Add indentation rules for arrays.

21 months ago; Handle nil ARG in treesit-beginning/end-of-defun
Yuan Fu [Fri, 16 Dec 2022 05:23:20 +0000 (21:23 -0800)]
; Handle nil ARG in treesit-beginning/end-of-defun

* lisp/treesit.el (treesit-beginning-of-defun)
(treesit-end-of-defun): Handle nil ARG.

21 months agoNew input method 'cyrillic-chuvash'
Eli Zaretskii [Fri, 16 Dec 2022 20:05:52 +0000 (22:05 +0200)]
New input method 'cyrillic-chuvash'

* lisp/leim/quail/cyrillic.el ("cyrillic-chuvash"): New input
method, contributed by flashymittens@tutanota.com.  (Bug#60023)

Copyright-paperwork-exempt: yes

21 months ago; Improve wording of 'format' doc string
Eli Zaretskii [Fri, 16 Dec 2022 18:46:00 +0000 (20:46 +0200)]
; Improve wording of 'format' doc string

* src/editfns.c (Fformat): Use "produce" instead of "print".
(Bug#60125)

21 months agoBackport: ; * lisp/bs.el: Small doc and whitespace fixes
Juanma Barranquero [Fri, 16 Dec 2022 17:36:42 +0000 (18:36 +0100)]
Backport: ; * lisp/bs.el: Small doc and whitespace fixes

(cherry picked from commit 8624734504af4572525665c713a47e1b6f439a2c)

21 months agoRevert "alist-get testfn argument evaluation correction"
Eli Zaretskii [Fri, 16 Dec 2022 17:29:30 +0000 (19:29 +0200)]
Revert "alist-get testfn argument evaluation correction"

This reverts commit 17d65c99cd812e085d85f790c83ec0d540490a55.

Please don't install unnecessary improvements on the release
branch.

21 months agoRevert "Elide broken but unnecessary `if` optimisations"
Eli Zaretskii [Fri, 16 Dec 2022 17:27:33 +0000 (19:27 +0200)]
Revert "Elide broken but unnecessary `if` optimisations"

This reverts commit 13aa376e93564a8cf2ddbbcf0968c6666620db89.

Please don't install anything on the release branch that is
not a clear bugfix for a known bug.

21 months agoRevert "Use equal and member instead of eq and memq"
Eli Zaretskii [Fri, 16 Dec 2022 17:25:45 +0000 (19:25 +0200)]
Revert "Use equal and member instead of eq and memq"

This reverts commit f4b430140f0866f98bbf18b7094348dc64032813.

Please don't install anything on the release branch that is not
strictly necessary fro Emacs 29.

21 months agoUse equal and member instead of eq and memq
Mattias Engdegård [Fri, 16 Dec 2022 11:17:33 +0000 (12:17 +0100)]
Use equal and member instead of eq and memq

* lisp/cedet/semantic/complete.el (semantic-displayer-show-request):
* lisp/descr-text.el (describe-char-categories):
* lisp/mh-e/mh-identity.el (mh-select-identity):
* lisp/transient.el (transient--delay-post-command)
(transient--post-command):
* lisp/vc/vc-git.el (vc-git-create-tag):
* test/lisp/emacs-lisp/cl-lib-tests.el
(cl-lib-nth-value-test-multiple-values):
* lisp/emulation/viper-cmd.el (viper-preserve-cursor-color):
Use `equal` instead of `eq` and `member` instead of `memq` where
the comparison is with literals without guaranteed identity.
In some cases this change corrects evident bugs, in others it is
mostly cosmetic.

21 months agoElide broken but unnecessary `if` optimisations
Mattias Engdegård [Fri, 16 Dec 2022 14:56:04 +0000 (15:56 +0100)]
Elide broken but unnecessary `if` optimisations

* lisp/emacs-lisp/byte-opt.el (byte-optimize-if):
Remove explicit clauses purposing to simplify

    (if X nil t) -> (not X)
    (if X t nil) -> (not (not X))

but never did so because of a coding mistake (eq instead of equal),
found by a recently added warning.  They weren't actually needed
thanks to the optimiser's fixpoint iteration: we eventually get the
same results through

    (if X nil t) -> (if (not X) t nil) -> (if (not X) t) -> (not X)
    (if X t nil) -> (if X t) -> (not (not X))

21 months agoalist-get testfn argument evaluation correction
Mattias Engdegård [Fri, 16 Dec 2022 10:08:02 +0000 (11:08 +0100)]
alist-get testfn argument evaluation correction

* lisp/emacs-lisp/gv.el (alist-get):
Evaluate TESTFN exactly once (previously up to 3 times).
Reduce the macro-expansion to include a call to either assoc or assq,
not both; this reduces the generated code size in some cases.

21 months ago* lisp/term/xterm.el (xterm-function-map): Add M-SPC. (Bug#60077)
Eli Zaretskii [Fri, 16 Dec 2022 16:02:57 +0000 (18:02 +0200)]
* lisp/term/xterm.el (xterm-function-map): Add M-SPC.  (Bug#60077)

21 months agoFix moving to trash files that overwrite dangling symlinks there
Eli Zaretskii [Fri, 16 Dec 2022 15:54:35 +0000 (17:54 +0200)]
Fix moving to trash files that overwrite dangling symlinks there

* lisp/files.el (file-exists-in-trash-p): New function.
(move-file-to-trash): Use it instead of 'file-exists-p' when
testing whether the file exist in the trash.  (Bug#59986)

21 months agoFix SVG scaling (bug#59802)
Manuel Giraud [Tue, 13 Dec 2022 09:10:03 +0000 (10:10 +0100)]
Fix SVG scaling (bug#59802)

Fix SVG scaling with librsvg>2.52 and SVG file with only one known
dimension.

* src/image.c (svg_load_image): Compute a percentage dimension with
the other known dimension.

21 months ago; Add useful hint to which-func documentation
Eli Zaretskii [Fri, 16 Dec 2022 15:43:46 +0000 (17:43 +0200)]
; Add useful hint to which-func documentation

* lisp/progmodes/which-func.el (which-func-non-auto-modes)
(which-func-maxout): Mention the slow startup with Eglot and
how to work around that.  (Bug#60107)

21 months ago; Improve doc strings of minibuffer-history commands
Eli Zaretskii [Fri, 16 Dec 2022 15:32:05 +0000 (17:32 +0200)]
; Improve doc strings of minibuffer-history commands

* lisp/simple.el (goto-history-element, next-history-element)
(previous-history-element): Doc fixes.  (Bug#60103)

21 months ago; Fix last changes in buffer.c
Eli Zaretskii [Fri, 16 Dec 2022 14:46:37 +0000 (16:46 +0200)]
; Fix last changes in buffer.c

* src/buffer.c (other_buffer_safely): Ensure Lisp Interaction mode
in *scratch*.  (Bug#60096)

21 months agoFix some naming issues involving query buffers in ERC
F. Jason Park [Mon, 12 Dec 2022 15:38:44 +0000 (07:38 -0800)]
Fix some naming issues involving query buffers in ERC

* lisp/erc/erc-networks.el
(erc-networks-rename-surviving-target-buffer): Don't kill a surviving
target buffer when another, non-target buffer, possibly not even
belonging to ERC, already exists and sports the target's name.
(erc-networks--reconcile-buffer-names): Always append a network-ID
suffix to a target buffer's name if another buffer of that name
already exists.  (Bug#59976.)
* lisp/erc/erc.el (erc, erc-tls): Revise `:id' portion of doc strings.
Thanks to Mike Kazantsev for the suggestion and for filing this bug
and helping solve it.
* test/lisp/erc/erc-networks-tests.el:
(erc-networks-rename-surviving-target-buffer--query-non-target): Add
new test.
* test/lisp/erc/erc-scenarios-base-association-query.el: New file.
* test/lisp/erc/resources/base/assoc/queries/netnick.eld: New file.
* test/lisp/erc/resources/base/assoc/queries/non-erc.eld: New file.

21 months ago; Fix doc string in ERC's module-activation commands
F. Jason Park [Fri, 16 Dec 2022 07:25:10 +0000 (23:25 -0800)]
; Fix doc string in ERC's module-activation commands

* lisp/erc/erc-common.el (erc--assemble-toggle): Previously, the doc
string implied that a prefix argument was necessary to achieve
connection-wide effects, which might lead a person to think the
interactive code should be an uppercase "P".
* test/lisp/erc/erc-tests.el (define-erc-module--local): Update
expected result of code-gen.

21 months agoIncrement erc-debug-irc-protocol-version to 2
F. Jason Park [Thu, 15 Dec 2022 04:03:15 +0000 (20:03 -0800)]
Increment erc-debug-irc-protocol-version to 2

* lisp/erc/erc.el (erc-debug-irc-protocol-version): Change version to
2 to help dependent tooling detect redacted passwords.
(erc-log-irc-protocol): Don't bother redacting incoming messages.
(Bug#59284.)

21 months agoA better fix for bug#60096
Eli Zaretskii [Fri, 16 Dec 2022 14:29:51 +0000 (16:29 +0200)]
A better fix for bug#60096

* lisp/startup.el (initial-scratch-message):
* lisp/simple.el (get-scratch-buffer-create): Revert last changes.

* src/window.c (Fset_window_configuration): Force recalculation of
Vwindow_list after restoring the windows.
* src/buffer.c (other_buffer_safely): Make sure we always return a
valid buffer, even if 'get-scratch-buffer-create' signals an
error.

21 months ago; Fix printing Lisp types in .gdbinit
Eli Zaretskii [Fri, 16 Dec 2022 12:14:42 +0000 (14:14 +0200)]
; Fix printing Lisp types in .gdbinit

* src/alloc.c (valid_lisp_object_p): Support printing
stack-allocated strings and cons cells.

21 months agoBump Eglot version to 1.10
João Távora [Fri, 16 Dec 2022 09:23:21 +0000 (09:23 +0000)]
Bump Eglot version to 1.10

* lisp/progmodes/eglot.el (Version): Bump to 1.10
(Package-Requires): Bump required versions of jsonrpc and project.

21 months agoEglot: fix discrepant eglot-guess-contact/eglot-command-history
João Távora [Fri, 16 Dec 2022 09:29:32 +0000 (09:29 +0000)]
Eglot: fix discrepant eglot-guess-contact/eglot-command-history

Due to a typo, the defvar eglot--command-history wasn't actually used
in eglot-guess-contact as intended.  That function used a
single-dash-name version of the variable instead.

This worked fine, except that two variables were created instead of
one, and the one actually being used didn't have any docstring.

Rename the variable to eglot-command-history to fix this.  It's better
than renaming the reference in eglot-guess-contact which would lose
user's history for M-x eglot.

* lisp/progmodes/eglot.el (eglot-command-history): Rename from
eglot--command-history.

21 months agoAvoid recursive process filters in lisp/jsonrpc.el (bug#60088)
João Távora [Thu, 15 Dec 2022 15:26:13 +0000 (15:26 +0000)]
Avoid recursive process filters in lisp/jsonrpc.el (bug#60088)

jsonrpc.el may lose JSON-RPC messages because of recursive process
filters.  The problem happens in jsonrpc.el's jsonrpc--process-filter.

The code of the process filter didn't expect to be called recursively
and fails in that case.

But that can happen if the three conditions are verified.

1. the client code invoked by its jsonrpc--connection-receive inside
   the process filter callee immediately sends follow-up input to
   process within the same Lisp stack.  This is a common scenario,
   especially during LSP initialiation sequence used by Eglot, a
   jsonrpc.el client.

2. that follow-up message is large enough for process-send-string to
   send the input in bunches (output from processes can arrive in
   between bunches).

3. the process happens to have already some more output ready

The fix in this commit detects recursive invocations and immediately
re-schedules them as non-recursive calls to the
jsonrpc--process-filter (but started from timers).

* lisp/jsonrpc.el (jsonrpc--process-filter): Rework.
(Version): Bump to 1.0.16.

21 months ago; Fix typos
Stefan Kangas [Thu, 15 Dec 2022 01:41:20 +0000 (02:41 +0100)]
; Fix typos

21 months agoAdd lambda_expression-rule to java-ts-mode (bug#60091)
Theodor Thornhill [Thu, 15 Dec 2022 13:54:17 +0000 (14:54 +0100)]
Add lambda_expression-rule to java-ts-mode (bug#60091)

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): New
rule.

21 months agoeglot: Add support for new language server csharp-ls
Jostein Kjønigsen [Thu, 15 Dec 2022 12:44:39 +0000 (13:44 +0100)]
eglot: Add support for new language server csharp-ls

C# has two popular language servers: Omnisharp Roslyn (already
supported) and csharp-ls (newer, more performant).

* lisp/progmodes/eglot.el: Add new C# language server
csharp-ls.  (Bug#60089)

21 months agoUse the new tree-sitter commands
Yuan Fu [Fri, 16 Dec 2022 01:44:07 +0000 (17:44 -0800)]
Use the new tree-sitter commands

* lisp/progmodes/c-ts-mode.el (c-ts-mode--defun-valid-p)
(c-ts-mode--defun-skipper): New functions.
(c-ts-base-mode): Setup defun navigation.
* lisp/progmodes/sh-script.el (bash-ts-mode): Setup defun navigation.
* lisp/treesit.el (treesit-beginning-of-defun)
(treesit-end-of-defun): Change to new implementation, which is
intended to be used as commands.
(treesit-major-mode-setup): Setup remap for beginning/end-of-defun
commands.

21 months agoAdd "function" feature to python-ts-mode (bug#59977)
Yuan Fu [Fri, 16 Dec 2022 01:25:06 +0000 (17:25 -0800)]
Add "function" feature to python-ts-mode (bug#59977)

* lisp/progmodes/python.el (python--treesit-settings): Add feature.
(python-ts-mode): Add feature.  And fix indentation for the
python-indent-guess-indent-offset code.

21 months agoAdd go-ts-mode and go-mod-ts-mode (Bug#60025)
Randy Taylor [Sun, 11 Dec 2022 23:41:16 +0000 (18:41 -0500)]
Add go-ts-mode and go-mod-ts-mode (Bug#60025)

* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add go-mod support.
* etc/NEWS: Mention them.
* lisp/progmodes/eglot.el (eglot-server-programs): Add them.
* lisp/progmodes/go-ts-mode.el: New major modes with
tree-sitter support.

21 months agoAdd basic support for hideshow in python-ts-mode (bug#60044)
Yuan Fu [Fri, 16 Dec 2022 01:16:28 +0000 (17:16 -0800)]
Add basic support for hideshow in python-ts-mode (bug#60044)

* lisp/progmodes/python.el (python-base-mode): Add setup for
python-ts-mode.

21 months agoAdd "this" keyword to java-ts-mode (bug#60086)
Theodor Thornhill [Thu, 15 Dec 2022 10:48:32 +0000 (11:48 +0100)]
Add "this" keyword to java-ts-mode (bug#60086)

* lisp/progmodes/java-ts-mode.el
(java-ts-mode--font-lock-settings): Add the node to the keyword
feature.

21 months agoWhen completing relative project file names, use relative history
Dmitry Gutov [Thu, 15 Dec 2022 22:45:55 +0000 (00:45 +0200)]
When completing relative project file names, use relative history

* lisp/progmodes/project.el: Require 'cl-lib'.

* lisp/progmodes/project.el (project--read-file-cpd-relative):
Pre-process history entries around completing-read (bug#58447).

This includes both filtering by common-parent-directory prefix and
mapping into relative names.

21 months agoAvoid segfaults due to invalid selected-window's buffer
Eli Zaretskii [Thu, 15 Dec 2022 21:39:58 +0000 (23:39 +0200)]
Avoid segfaults due to invalid selected-window's buffer

* lisp/startup.el (initial-scratch-message): Don't use \\[...]
commands for substitute-command-keys.
* lisp/simple.el (get-scratch-buffer-create): Don't call
substitute-command-keys on initial-scratch-message, to avoid
signaling an error in rare cases.  (Bug#60096)

21 months agoRevert 21b387c39bd with last-minute hasty changes (bug#60048).
Juri Linkov [Thu, 15 Dec 2022 19:24:48 +0000 (21:24 +0200)]
Revert 21b387c39bd with last-minute hasty changes (bug#60048).

* lisp/simple.el (completion-list-mode-map): Unbind [up] and [down].
(previous-line-completion, next-line-completion): Remove.

21 months agoReplace an erroneous eq with an equal in cc-defs.el
Alan Mackenzie [Thu, 15 Dec 2022 19:23:19 +0000 (19:23 +0000)]
Replace an erroneous eq with an equal in cc-defs.el

* lisp/progmodes/cc-defs.el (c-looking-at-non-alphnumspace): Replace eq with
equal in the XEmacs branch.

21 months ago* lisp/tab-bar.el ([tab-bar]): Use 'make-sparse-keymap' instead of 'ignore'.
Juri Linkov [Thu, 15 Dec 2022 19:10:28 +0000 (21:10 +0200)]
* lisp/tab-bar.el ([tab-bar]): Use 'make-sparse-keymap' instead of 'ignore'.

This helps to avoid the error in 'where-is-internal' that should
not call :filter unnecessarily (bug#9923).

21 months agocompile.el: Fix regression with nb of errors in modeline
Stefan Monnier [Thu, 15 Dec 2022 18:36:14 +0000 (13:36 -0500)]
compile.el: Fix regression with nb of errors in modeline

* lisp/progmodes/compile.el (compilation-mode-line-errors): Mark it as
risky-local, like `defconst` used to do for us.

21 months agoMake tab-bar-tab-group-format-function backwards-compatible (bug#60073)
Juri Linkov [Thu, 15 Dec 2022 18:03:24 +0000 (20:03 +0200)]
Make tab-bar-tab-group-format-function backwards-compatible (bug#60073)

* lisp/tab-bar.el (tab-bar--format-tab-group): Add condition-case
with wrong-number-of-arguments for backwards-compatibility.
(tab-bar-tab-group-format-default): Simplify.

21 months agoMake tab-bar-tab-group-format-function also handle current group
Gabriel do Nascimento Ribeiro [Thu, 15 Dec 2022 14:58:30 +0000 (11:58 -0300)]
Make tab-bar-tab-group-format-function also handle current group

* lisp/tab-bar.el (tab-bar--format-tab-group): Call
'tab-bar-tab-group-format-default' to format current group tab.
(tab-bar-tab-group-format-default): Update function to also handle
current group tab (bug#60073).

21 months agoEnsure package directories for source packages from checkouts
Philip Kaludercic [Thu, 15 Dec 2022 17:21:24 +0000 (18:21 +0100)]
Ensure package directories for source packages from checkouts

* lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
Set the :dir entry, since `package-vc--unpack-1' assumes the field is
set, as is the case when invoking `package-vc--unpack'.

21 months ago; * etc/NEWS: Fix recent changes.
Randy Taylor [Thu, 15 Dec 2022 16:44:10 +0000 (11:44 -0500)]
; * etc/NEWS: Fix recent changes.

21 months ago* test/README (SELECTOR): Add eglot-tests.el to remote file using libraries.
Michael Albinus [Thu, 15 Dec 2022 15:37:36 +0000 (16:37 +0100)]
* test/README (SELECTOR): Add eglot-tests.el to remote file using libraries.

21 months agoFix bug#60060 in Tramp
Michael Albinus [Thu, 15 Dec 2022 15:37:16 +0000 (16:37 +0100)]
Fix bug#60060 in Tramp

* lisp/net/tramp-sh.el (tramp-sh-handle-file-local-copy):
Delete `tmpfile' in case of error.  (Bug#60060)

21 months ago; * lisp/net/tramp-crypt.el: Fix comment.
Michael Albinus [Thu, 15 Dec 2022 15:36:38 +0000 (16:36 +0100)]
; * lisp/net/tramp-crypt.el: Fix comment.

21 months ago* .gitignore: Ignore GDB history files.
Manuel Giraud [Thu, 15 Dec 2022 08:50:32 +0000 (09:50 +0100)]
* .gitignore: Ignore GDB history files.

21 months agoMention 'tree-sitter' in user manual and NEWS
Eli Zaretskii [Thu, 15 Dec 2022 08:47:11 +0000 (10:47 +0200)]
Mention 'tree-sitter' in user manual and NEWS

* doc/emacs/programs.texi (Program Modes): Mention tree-sitter and
the modes supported by it.
* etc/NEWS: Mention tree-sitter in the Installation Changes
section.

21 months ago; * etc/NEWS: Rearrange entries for tree-sitter supported modes.
Eli Zaretskii [Thu, 15 Dec 2022 08:25:27 +0000 (10:25 +0200)]
; * etc/NEWS: Rearrange entries for tree-sitter supported modes.

21 months ago; Announce 'toml-ts-mode' in NEWS.
Eli Zaretskii [Thu, 15 Dec 2022 08:09:25 +0000 (10:09 +0200)]
; Announce 'toml-ts-mode' in NEWS.

21 months ago; Auto-commit of loaddefs files.
Stefan Kangas [Thu, 15 Dec 2022 04:11:35 +0000 (05:11 +0100)]
; Auto-commit of loaddefs files.

21 months ago; Don't quote nil in comments
Stefan Kangas [Thu, 15 Dec 2022 01:24:56 +0000 (02:24 +0100)]
; Don't quote nil in comments

21 months ago; Checkdoc fixes in dired-aux.el
Stefan Kangas [Thu, 15 Dec 2022 01:22:45 +0000 (02:22 +0100)]
; Checkdoc fixes in dired-aux.el

* lisp/dired-aux.el (dired-compare-directories, dired-do-chmod)
(dired-do-chgrp, dired-do-chown, dired-do-touch)
(dired-minibuffer-default-add-shell-commands)
(dired-read-shell-command, dired-mark-prefix)
(dired-mark-postfix, dired-mark-separator, dired-kill-line)
(dired-reset-subdir-switches, dired-add-entry)
(dired-remove-file)
(dired-create-destination-dirs-on-trailing-dirsep)
(dired-maybe-insert-subdir, dired-tree-up, dired-tree-down):
Checkdoc fixes.

21 months agoFix ruby-add-log-current-method after nested class definition
Dmitry Gutov [Thu, 15 Dec 2022 01:21:14 +0000 (03:21 +0200)]
Fix ruby-add-log-current-method after nested class definition

* lisp/progmodes/ruby-mode.el (ruby--add-log-current-indent):
New function.
(ruby-add-log-current-method): Use it.
Check for "class" and "module" indentation to filter out the
definitions which don't include the given position.  Also try to
match "def" only once (for performance), because if the closest
one doesn't include the given position, none will.

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-add-log-current-method-after-inner-class-outside-methods)
(ruby-add-log-current-method-after-inner-class-outside-methods-with-text):
New tests.

21 months agoAdd indent rules to js/typescript/tsx-ts-mode (bug#60074)
Theodor Thornhill [Wed, 14 Dec 2022 20:23:33 +0000 (21:23 +0100)]
Add indent rules to js/typescript/tsx-ts-mode (bug#60074)

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Add in binary_expression and
jsx_fragment.
* lisp/progmodes/js.el (js--treesit-indent-rules): Add the same rules.

21 months agoImprove fontification in csharp-ts-mode (bug#59897)
Jostein Kjønigsen [Thu, 8 Dec 2022 10:07:15 +0000 (11:07 +0100)]
Improve fontification in csharp-ts-mode (bug#59897)

Fixes highlighting of generic methods like the one below:

instance.MethodWithTypeArguments<Type>(...);
InClassMethodWithTypeArguments<Type>(...);

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Add new rule.

21 months agoRevert "Add expression for generic_name in csharp-ts-mode"
Yuan Fu [Wed, 14 Dec 2022 22:28:29 +0000 (14:28 -0800)]
Revert "Add expression for generic_name in csharp-ts-mode"

I applied the wrong commit, the next commit will be the right one,
sorry about that!

This reverts commit 647b6a8099f414e5a7b162efd3658e174064dfe7.

21 months agoIntroduce support for TOML config-format
Jostein Kjønigsen [Sun, 11 Dec 2022 12:05:29 +0000 (13:05 +0100)]
Introduce support for TOML config-format

This commit introduces support for the semi-popular TOML
config-format[1] through a new major-mode: toml-ts-mode.

I've read through the full spec[2], and from what I can see this
major-mode should provide correct syntax-highligting for every sort of
config-declaration which adheres to the specification.

Besides that it also adds support for imenu and basic tree-sitter
based navigation.

[1] https://toml.io/en/
[2] https://toml.io/en/v1.0.0

21 months agoFix handling of % when searching in .tex or .dtx files
Arash Esbati [Wed, 14 Dec 2022 20:17:30 +0000 (21:17 +0100)]
Fix handling of % when searching in .tex or .dtx files

* lisp/textmodes/reftex.el (reftex-compile-variables): Consider %
when building the regexp for searching only in .dtx files.
(AUCTeX bug#59638)

21 months agoTreat C++ classes as defuns in C Tree-sitter mode (bug#60047)
Daniel Martín [Tue, 13 Dec 2022 20:35:40 +0000 (21:35 +0100)]
Treat C++ classes as defuns in C Tree-sitter mode (bug#60047)

* lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Add "class_specifier"
as a node of type "defun".

21 months agoAdd < and > to the syntax table in c++-ts-mode (bug#60049)
Daniel Martín [Tue, 13 Dec 2022 21:28:13 +0000 (22:28 +0100)]
Add < and > to the syntax table in c++-ts-mode (bug#60049)

* lisp/progmodes/c-ts-mode.el (c++-ts-mode--syntax-table): Add a
specific syntax table for C++.  Consider "<" and ">" open/close
delimiters (C++ templates).
(c++-ts-mode): Use the new syntax table.

21 months agoImprove fontifications in Typescript mode
Jostein Kjønigsen [Wed, 7 Dec 2022 08:27:42 +0000 (09:27 +0100)]
Improve fontifications in Typescript mode

* lisp/progmodes/typescript-ts-mode.el: Improve fontification of
variables.  (Bug#59831)

21 months agoUpdate the documentation of overlays (bug#59996)
Eli Zaretskii [Wed, 14 Dec 2022 18:13:47 +0000 (20:13 +0200)]
Update the documentation of overlays (bug#59996)

* src/buffer.c (Foverlay_recenter, Foverlay_lists): Update the doc
strings.

* lisp/subr.el (copy-overlay): Update comment.

* doc/lispref/internals.texi (Buffer Internals): Remove buffer
fields relevant to the old implementation; add the new interval
tree field.
* doc/lispref/display.texi (Overlays, Managing Overlays): Update
text to be consistent with the new implementation of overlays.
(Managing Overlays): Remove documentation of 'overlay-recenter'.

* etc/NEWS: Mention incompatible aspects of overlay
reimplementation.

21 months ago; Improve description of scoping and let-bindings
Eli Zaretskii [Wed, 14 Dec 2022 15:46:16 +0000 (17:46 +0200)]
; Improve description of scoping and let-bindings

* doc/lispref/variables.texi (Local Variables, Variable Scoping):
Explain the move to lexical-binding and elaborate on 'let*'.
Suggested by Michael Heerdegen <michael_heerdegen@web.de>.
(Bug#60027)

21 months ago; Fix a typo in window.el
Eli Zaretskii [Wed, 14 Dec 2022 15:08:46 +0000 (17:08 +0200)]
; Fix a typo in window.el

* lisp/window.el (switch-to-prev-buffer-skip-p): Fix typo.
Patch by Shuguang Sun <shuguang79@qq.com>.  (Bug#59985)

21 months agoDon't send erc-sasl-user as USER command argument
F. Jason Park [Tue, 13 Dec 2022 07:58:03 +0000 (23:58 -0800)]
Don't send erc-sasl-user as USER command argument

* lisp/erc/erc-sasl.el (erc-sasl--send-cap-ls): Add internal switch
for sending an opening "CAP LS".  The rationale for not enabling this
by default is twofold: one, it more strongly implies that ERC supports
IRCv3 client capability negotiation, which is somewhat disingenuous;
and, two, We'd still be "faking it" by firing and forgetting, and more
balls in the air makes things less predictable.
(erc--register-connection): Possibly send a "CAP LS" before anything
depending on the value of `erc-sasl--send-cap-ls'.  Also, don't
attempt to send `erc-session-username' when it holds an SASL username
because the latter may contain protocol-defying characters.
* test/lisp/erc/resources/base/local-modules/fourth.eld: change user
parameter of "USER" command to reflect nick when `erc-sasl-user' is
set to `:user'.  (Bug#59976.)

21 months agoSet erc-network to a "given" ID instead of failing
F. Jason Park [Tue, 13 Dec 2022 07:58:03 +0000 (23:58 -0800)]
Set erc-network to a "given" ID instead of failing

* lisp/erc/erc-networks.el (erc-networks--determine): Return the
so-called "given" ID from a non-nil `:id' keyword arg passed to `erc'
or `erc-tls'.
(erc-networks--allow-unknown-network): Add internal variable to
allow IRC session to continue despite the network being unknown.
(erc-networks--set-name): Tell the user about falling back to a given
ID when the network can't be determined.  When that's so, end the
session by destroying the connection unless
`erc-networks--allow-unknown-network' is enabled.  (Bug#59976.)
(erc-networks--ensure-announced): Include the fallback announced
server name in the error message.
* test/lisp/erc/erc-networks-tests.el (erc-networks--set-name): Add
dummy server process and don't expect an error to be signaled.
* test/lisp/erc/erc-scenarios-misc.el
(erc-scenarios-networks-announced-missing): Don't expect an error to
be signaled.
* test/lisp/erc/resources/networks/announced-missing/foonet.eld:
Remove "mode" match pattern.

21 months agoLimit casemapping to appropriate ranges in ERC
F. Jason Park [Mon, 12 Dec 2022 03:41:43 +0000 (19:41 -0800)]
Limit casemapping to appropriate ranges in ERC

* lisp/erc/erc-common.el (erc-downcase): Use case table for
`erc-downcase' so that case conversions are limited to the ASCII
interval.
* lisp/erc/erc.el (erc-casemapping--rfc1459-strict,
erc--casemapping-rfc1459): Make these case tables instead of
translation tables.  The functions in case-table.el modify the
standard syntax table, but that doesn't seem to make sense here,
right?
* test/lisp/erc/erc-tests.el (erc-downcase): Add cases showing
mappings outside of the ASCII range.  (Bug#59976.)

21 months agoActually accept non-symbols as IDs in erc-open
F. Jason Park [Mon, 12 Dec 2022 03:41:43 +0000 (19:41 -0800)]
Actually accept non-symbols as IDs in erc-open

* lisp/erc/erc.el (erc-generate-new-buffer-name): Despite what it says
in the documentation, only symbols were being accepted as valid `:id'
entry-point arguments.  This uses the interned `princ' representation
of the argument instead.
* test/lisp/erc/erc-scenarios-base-netid-samenet.el
(erc-scenarios-common--base-network-id-same-network): Randomly specify
a string for the ID param instead of a non-nil symbol when opening a
new connection.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common-assert-initial-buf-name): Adjust helper to allow
for non-symbol IDs.  (Bug#59976.)

21 months ago; Be nicer when updating browse-url var in erc-compat
F. Jason Park [Mon, 12 Dec 2022 03:16:07 +0000 (19:16 -0800)]
; Be nicer when updating browse-url var in erc-compat

* lisp/erc/erc-compat.el: Be more cautious about modifying
`browse-url-default-handlers' when loading erc-compat on Emacs 28.  A
user may have already added an entry for irc:// URLs before loading
`erc-compat'.

21 months agoRespect a nil erc-session-password when reconnecting
F. Jason Park [Sat, 3 Dec 2022 07:11:24 +0000 (23:11 -0800)]
Respect a nil erc-session-password when reconnecting

* lisp/erc/erc.el (erc-open): Simplify `old-vars' expression.
(erc--compute-server-password): Only compute a server password when
first connecting.  For compatibility, this respects third-party code
that expects session passwords in target buffers when initially
non-nil.
* test/lisp/erc/erc-scenarios-services-misc.el
(erc-scenarios-services-auth-source-reconnect): Add new test.
* test/lisp/erc/resources/services/auth-source/recon.eld: Add new test
data file.  (Bug#59858.)

21 months agoAdd dedicated auth-source section in ERC manual
F. Jason Park [Thu, 1 Dec 2022 07:10:58 +0000 (23:10 -0800)]
Add dedicated auth-source section in ERC manual

* doc/misc/erc.texi: Move auth-source description from the Password
subheading of the Advanced chapter's Connecting section to the new
Integrations section as a new node, Auth-Source, and give it a bit
more structure.  Fix various misuses of xref vs. pxref.  Convert URL
subheading to subsection and add anchor.  Prefer "backend" as a single
word, based on usage in other manuals.  Also replace loud "warning" in
SASL troubleshooting section.
* etc/ERC-NEWS: Re-link auth-source mention.
* lisp/erc/erc-sasl.el (erc-sasl-auth-source-function): Update info
node in doc string.
* lisp/erc/erc-services.el (erc-auth-source-services-function):
Re-link auth-source info node in doc string.
* lisp/erc/erc.el (erc-password, erc-auth-source-server-function,
erc-auth-source-join-function): Re-link auth-source info node in doc
strings.

21 months ago; * lisp/emacs-lisp/shortdoc.el: fix mistakes in previous commit
Mattias Engdegård [Wed, 14 Dec 2022 13:06:46 +0000 (14:06 +0100)]
; * lisp/emacs-lisp/shortdoc.el: fix mistakes in previous commit

21 months ago; * lisp/progmodes/cmake-ts-mode.el (auto-mode-alist): $ -> \'
Mattias Engdegård [Wed, 14 Dec 2022 11:25:49 +0000 (12:25 +0100)]
; * lisp/progmodes/cmake-ts-mode.el (auto-mode-alist): $ -> \'

21 months agoBetter shortdoc examples
Mattias Engdegård [Wed, 14 Dec 2022 11:20:46 +0000 (12:20 +0100)]
Better shortdoc examples

* lisp/emacs-lisp/shortdoc.el
(symbol, comparison): New.
(string, list, number): Remove or change examples that do not have
well-defined results, such as `eq` on strings or floats.
Edit other examples for better illustrating each respective operation.

21 months agoShortdoc: read and evaluate strings after :eval
Mattias Engdegård [Wed, 14 Dec 2022 11:16:28 +0000 (12:16 +0100)]
Shortdoc: read and evaluate strings after :eval

* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function):
If the parameter of :eval is a string then read, evaluate and print
the result.  This was always the intention and is documented behaviour.

21 months agoFix Tramp tests in eglot-tests, prefix tests uniquely
Michael Albinus [Wed, 14 Dec 2022 09:52:04 +0000 (10:52 +0100)]
Fix Tramp tests in eglot-tests, prefix tests uniquely

* test/lisp/progmodes/eglot-tests.el (eglot--call-with-fixture):
Use `make-nearby-temp-file'.
(eglot--call-with-tramp-test): Set `tramp-verbose' and
`default-directory'.  The latter is needed for `make-nearby-temp-file'.
(eglot-test-tramp-test, eglot-test-tramp-test-2): Tag them as
:expensive-test.
(all): Prefix all tests with `eglot-test-' uniquely.

21 months ago* lisp/vc/vc-git.el (vc-git-checkin): Use make-nearby-temp-file (bug#60011)
Juri Linkov [Wed, 14 Dec 2022 08:05:55 +0000 (10:05 +0200)]
* lisp/vc/vc-git.el (vc-git-checkin): Use make-nearby-temp-file (bug#60011)

21 months agoDelete temp files after icalendar tests
Stefan Kangas [Wed, 14 Dec 2022 07:21:34 +0000 (08:21 +0100)]
Delete temp files after icalendar tests

* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--get-error-string-for-export): Make sure we clean up
temporary files after test.

21 months ago; * lisp/keymap.el (keymap-substitute): Doc fix. (Bug#60059)
Stefan Kangas [Wed, 14 Dec 2022 05:38:14 +0000 (06:38 +0100)]
; * lisp/keymap.el (keymap-substitute): Doc fix.  (Bug#60059)

(cherry picked from commit 1568123196cd8b57ed64e284b7deb058026be713)

21 months agoFix syntax tables of tree-sitter modes (bug#59807)
Kai Ma [Sat, 3 Dec 2022 22:15:42 +0000 (06:15 +0800)]
Fix syntax tables of tree-sitter modes (bug#59807)

Tree-sitter modes should use the same syntax table as the
non-tree-sitter ones.

* lisp/progmodes/js.el (js-mode-syntax-table)
(js-ts-mode)
* lisp/progmodes/python.el (python-ts-mode)
* lisp/progmodes/sh-script.el (bash-ts-mode)

Copyright-paperwork-exempt: yes

xx

21 months ago; * admin/notes/tree-sitter/build-module/build.sh: Minor name change.
Yuan Fu [Wed, 14 Dec 2022 00:24:38 +0000 (16:24 -0800)]
; * admin/notes/tree-sitter/build-module/build.sh: Minor name change.

21 months ago; Comment and stylistic change in treesit.el
Yuan Fu [Tue, 13 Dec 2022 23:59:29 +0000 (15:59 -0800)]
; Comment and stylistic change in treesit.el

* lisp/treesit.el (treesit-defun-skipper): Docstring change.
(treesit--navigate-defun): Comment and stylistic change.

21 months ago* doc/misc/Makefile.in (need_emacsver): Add use-package.
Stefan Kangas [Tue, 13 Dec 2022 23:36:30 +0000 (00:36 +0100)]
* doc/misc/Makefile.in (need_emacsver): Add use-package.

21 months agoFix bug when calling `rgrep` non-interactively
Stefan Kangas [Tue, 13 Dec 2022 21:01:45 +0000 (22:01 +0100)]
Fix bug when calling `rgrep` non-interactively

* lisp/progmodes/grep.el (rgrep): Fix bug where running
non-interactively requires running it interactively
first.  (Bug#60024)

21 months agoAdapt Tramp specific tests in eglot-tests.el
Michael Albinus [Tue, 13 Dec 2022 19:06:48 +0000 (20:06 +0100)]
Adapt Tramp specific tests in eglot-tests.el

* test/lisp/progmodes/eglot-tests.el (tramp): Move up.
(tramp-sh): Don't require.
(eglot--cleanup-after-test): Delete Tramp buffers if needed.
(eglot-tests-lsp-abiding-column): Rename from `eglot-lsp-abiding-column'.
(tramp-histfile-override): Declare.
(eglot--call-with-tramp-test):
Use `ert-remote-temporary-file-directory'.  Skip if needed.
(eglot--tramp-test, eglot--tramp-test-2): Don't skip.

21 months ago* lisp/textmodes/texinfo.el (texinfo-flymake): Improve docstring.
Stefan Kangas [Tue, 13 Dec 2022 17:57:25 +0000 (18:57 +0100)]
* lisp/textmodes/texinfo.el (texinfo-flymake): Improve docstring.

21 months agoSupport a function in the BUFFER-LIST arg of list-buffers-noselect (bug#59935)
Juri Linkov [Tue, 13 Dec 2022 17:47:47 +0000 (19:47 +0200)]
Support a function in the BUFFER-LIST arg of list-buffers-noselect (bug#59935)

* lisp/buff-menu.el (Buffer-menu-buffer-list): New buffer-local variable.
(list-buffers-noselect): Set Buffer-menu-buffer-list to 'buffer-list'
that now keeps the buffer-local value of the provided buffer list
or a function that returns the buffer list.
(list-buffers--refresh): Handle buffer-list and Buffer-menu-buffer-list
as a function and as a list.

* lisp/progmodes/project.el (project-list-buffers): Let-bind
'buffer-list-function' used by both legacy code and the new version
of list-buffers-noselect that supports its arg BUFFER-LIST as a function.

21 months ago; Fix typos
Stefan Kangas [Mon, 12 Dec 2022 07:50:21 +0000 (08:50 +0100)]
; Fix typos

21 months agoDon't allow lazy highlight from recursive minibuffers
Augusto Stoffel [Mon, 12 Dec 2022 22:07:28 +0000 (23:07 +0100)]
Don't allow lazy highlight from recursive minibuffers

See bug#59918.

* lisp/isearch.el (minibuffer-lazy-highlight-setup): Don't activate
when starting a recursive minibuffer.

21 months agoImprove resetting face attributes when looking for suitable fonts
Eli Zaretskii [Tue, 13 Dec 2022 15:35:17 +0000 (17:35 +0200)]
Improve resetting face attributes when looking for suitable fonts

* src/xfaces.c (syms_of_xfaces)<face-font-lax-matched-attributes>:
Change the default value to t.  Update doc string.
(realize_gui_face): When 'Vface_font_lax_matched_attributes' is t,
reset the 3 default font attributes efficiently.  Call
'font_maybe_unset_attribute' only if the value is neither nil nor
t.  (Bug#59347)

21 months ago; Fix typos in doc strings
Eli Zaretskii [Tue, 13 Dec 2022 14:01:13 +0000 (16:01 +0200)]
; Fix typos in doc strings

* lisp/treesit.el (treesit-defun-tactic)
(treesit-default-defun-skipper): Fix typos in doc strings.

21 months ago; * lisp/bs.el (bs-attributes-list): Doc fix
Juanma Barranquero [Tue, 13 Dec 2022 13:45:58 +0000 (14:45 +0100)]
; * lisp/bs.el (bs-attributes-list): Doc fix

21 months agoAdd lexical-binding to example package header
Stefan Kangas [Tue, 13 Dec 2022 06:27:16 +0000 (07:27 +0100)]
Add lexical-binding to example package header

* doc/lispref/package.texi (Simple Packages): Add lexical-binding
cookie to example package header.

21 months agoAdd improved tree-sitter navigation
Yuan Fu [Tue, 13 Dec 2022 04:25:53 +0000 (20:25 -0800)]
Add improved tree-sitter navigation

This new set of functions (and tests) should eliminate
defun-navigation bugs and limitations we currently have.  This commit
doesn't change any existing bahavior: treesit-beginning/end-of-defun
and friends are unchanged.  The plan is to later switch gear and
replace the current functions with the new ones introduced in this
change.

This is a relatively big change, but I've setup a comprehensive test,
and it should fix current bugs, so I think it's ok to put it on the
release branch.

The gist of the new navigation is to use treesit--defuns-around to
find the previous sibling defun, next sibling defun, and the parent
defun, then use this information to move to previous/next
beginning/end of defun in treesit--navigate-defun.

I also added comprehensive testing that tests all four possible
operations (prev-beg, next-beg, prev-end, next-end) starting at all
possible positions (between two sibling defuns, inside a sibling
defun, etc).

* lisp/treesit.el (treesit-defun-type-regexp): Expand definition to
allow (REGEXP . FILTER).  Old functions don't support this, but it
should be fine since we are soon replacing them.

(treesit-defun-tactic)
(treesit-defun-skipper): New variables.

(treesit-default-defun-skipper)
(treesit--defuns-around)
(treesit--top-level-defun)
(treesit--navigate-defun): New functions.

* test/src/treesit-tests.el (treesit--ert-insert-and-parse-marker)
(treesit--ert-collect-positions)
(treesit--ert-test-defun-navigation): New helper functions.

(treesit--ert-defun-navigation-python-program)
(treesit--ert-defun-navigation-js-program)
(treesit--ert-defun-navigation-bash-program)
(treesit--ert-defun-navigation-nested-master): New variables.

(treesit-defun-navigation-nested-1)
(treesit-defun-navigation-nested-2)
(treesit-defun-navigation-nested-3)
(treesit-defun-navigation-top-level): New tests.

21 months ago; * test/src/treesit-tests.el: Add outline headers.
Yuan Fu [Tue, 13 Dec 2022 02:14:30 +0000 (18:14 -0800)]
; * test/src/treesit-tests.el: Add outline headers.

21 months agoAdd cross-reference to flush-lines
Stefan Kangas [Tue, 13 Dec 2022 00:43:48 +0000 (01:43 +0100)]
Add cross-reference to flush-lines

* lisp/replace.el (flush-lines, kill-matching-lines): Add
cross-references between commands, using the names
'(kill|delete)-matching-lines' for symmetry.  (Bug#59934)

21 months agoUse font-lock-number-face for numeric values in csharp-mode
Jostein Kjønigsen [Mon, 12 Dec 2022 11:50:22 +0000 (12:50 +0100)]
Use font-lock-number-face for numeric values in csharp-mode

(bug#60004)

* lisp/progmodes/csharp-mode.el: update fontification code.

21 months agoMake treesit-query-validate create a read-only buffer
Jostein Kjønigsen [Mon, 12 Dec 2022 07:42:33 +0000 (08:42 +0100)]
Make treesit-query-validate create a read-only buffer

* lisp/treesit.el: use view-mode for generated validation buffer.

21 months agoImprove dockerfile-ts-mode imenu generation (Bug#59979)
Randy Taylor [Mon, 12 Dec 2022 01:50:54 +0000 (20:50 -0500)]
Improve dockerfile-ts-mode imenu generation (Bug#59979)

* lisp/progmodes/dockerfile-ts-mode.el (treesit-node-child-by-field-name):
Declare.
(dockerfile-ts-mode--imenu-1): Use stage name if available.