From 1f243a978061919900eba3ef1127aae80c66b6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Ram=C3=ADrez?= Date: Thu, 26 Sep 2024 01:50:52 +0200 Subject: [PATCH 01/50] Delete duplicated line in Viper refcard * etc/refcards/viperCard.tex: Delete duplicated line. (Bug#73480) Copyright-paperwork-exempt: yes --- etc/refcards/viperCard.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/etc/refcards/viperCard.tex b/etc/refcards/viperCard.tex index 3675c024a98..b722f99121c 100644 --- a/etc/refcards/viperCard.tex +++ b/etc/refcards/viperCard.tex @@ -301,7 +301,6 @@ \section{Insert Mode} \key{delete line word}{C-u} \key{indent shiftwidth forward}{C-t} \key{indent shiftwidth backward}{C-d} -\key{delete line word}{C-u} \key{quote following character}{C-v} \key{emulate Meta key in emacs state}{C-$\backslash$} \key{escape to Vi state for one command}{C-z} From 65e589698e64908d5a6a418594b3078342a7e6fd Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 26 Sep 2024 02:10:16 +0200 Subject: [PATCH 02/50] ; * lisp/filesets.el (filesets-homepage): Fix URL. --- lisp/filesets.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/filesets.el b/lisp/filesets.el index d6ba303b9eb..3af6f37b423 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -25,7 +25,7 @@ (defvar filesets-version "1.8.4") (defvar filesets-homepage - "http://members.a1.net/t.link/CompEmacsFilesets.html") + "https://web.archive.org/web/20210225032922/https://members.a1.net/t.link/CompEmacsFilesets.html") ;;; Commentary: From f5cd5585f46600857060ab70655f3b9782c70bb8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 26 Sep 2024 10:30:56 +0300 Subject: [PATCH 03/50] ; Recommend GNU Find for 'find-dired' * lisp/find-dired.el (find-dired): Doc fix (bug#73455). --- lisp/find-dired.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/find-dired.el b/lisp/find-dired.el index e52adaa9d9f..5b4ee0d70aa 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -174,6 +174,11 @@ The command run (after changing into DIR) is essentially except that the car of the variable `find-ls-option' specifies what to use in place of \"-ls\" as the final argument. +If your `find' program is not a GNU Find, the columns in the produced +Dired display might fail to align. We recommend to install GNU Find in +those cases (you may need to customize the value of `find-program' if +you do so), which attempts to align the columns. + Collect output in the \"*Find*\" buffer. To kill the job before it finishes, type \\[kill-find]. From 53c887fdf6ddd907a411d063fee69bfdc2a5757a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20J=C3=B6rg?= Date: Thu, 26 Sep 2024 15:20:01 +0200 Subject: [PATCH 04/50] ; cperl-mode.el: Fix an invalid face specification * lisp/progmodes/cperl-mode.el (cperl-method-call): Avoid doubly quoting the parent face. This made htmlize-buffer fail. --- lisp/progmodes/cperl-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 3353bffdf05..e129e2df552 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -6225,7 +6225,7 @@ default function." (t (funcall (default-value 'font-lock-syntactic-face-function) state)))) (defface cperl-method-call - '((t (:inherit 'default ))) + '((t (:inherit default ))) "Font Lock mode face for method calls. Usually, method calls are not fontified. We use this face to prevent calls to methods which look like From 68f53e43488648a7508444736d16f90fed248ef5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 27 Sep 2024 10:35:18 -0400 Subject: [PATCH 05/50] eieio.texi: Fix bug#73505 * doc/misc/eieio.texi (Introduction): Remove "missing features" which aren't missing any more. (Generics, Methods): Delete sections. (Inheritance): Adjust reference accordingly. (Static Methods): Merge into the parent node. (Writing Methods): Refer to the ELisp manual for `cl-defmethod/defgeneric`. --- doc/misc/eieio.texi | 167 +++----------------------------------------- 1 file changed, 11 insertions(+), 156 deletions(-) diff --git a/doc/misc/eieio.texi b/doc/misc/eieio.texi index 02cb51e6fdd..039588b311d 100644 --- a/doc/misc/eieio.texi +++ b/doc/misc/eieio.texi @@ -232,12 +232,6 @@ and you cannot define your own. The @code{:metaclass} tag in should return instances of the metaclass, behave differently in @eieio{} in that they return symbols or plain structures instead. -@item EQL specialization -EIEIO does not support it. - -@item @code{:around} method tag -This CLOS method tag is non-functional. - @item :default-initargs in @code{defclass} Each slot can have an @code{:initform} tag, so this is not really necessary. @@ -381,7 +375,7 @@ name, then the superclass showing up in the list first defines the slot attributes. Inheritance in @eieio{} is more than just combining different slots. -It is also important in method invocation. @ref{Methods}. +It is also important in method invocation. @ref{Writing Methods}. If a method is called on an instance of @code{my-subclass}, and that method only has an implementation on @code{my-baseclass}, or perhaps @@ -810,158 +804,19 @@ variable name of the same name as the slot. @node Writing Methods @chapter Writing Methods -Writing a method in @eieio{} is similar to writing a function. The -differences are that there are some extra options and there can be +Writing a method in @eieio{} is similar to writing a function. +The differences are that there are some extra options and there can be multiple definitions under the same function symbol. -Where a method defines an implementation for a particular data type, a -@dfn{generic method} accepts any argument, but contains no code. It -is used to provide the dispatching to the defined methods. A generic -method has no body, and is merely a symbol upon which methods are -attached. It also provides the base documentation for what methods -with that name do. +You do it using Emacs Lisp's built-in support for CLOS-style generic +functions via the @code{cl-defgeneric} and @code{cl-defmethod} macros +(@pxref{Generic Functions,,,elisp,GNU Emacs Lisp Reference Manual}). -@menu -* Generics:: -* Methods:: -* Static Methods:: -@end menu - -@node Generics -@section Generics - -Each @eieio{} method has one corresponding generic. This generic -provides a function binding and the base documentation for the method -symbol (@pxref{Symbol Components,,,elisp,GNU Emacs Lisp Reference -Manual}). - -@defmac cl-defgeneric method arglist [doc-string] -This macro turns the (unquoted) symbol @var{method} into a function. -@var{arglist} is the default list of arguments to use (not implemented -yet). @var{doc-string} is the documentation used for this symbol. - -A generic function acts as a placeholder for methods. There is no -need to call @code{cl-defgeneric} yourself, as @code{cl-defmethod} will call -it if necessary. Currently the argument list is unused. - -@code{cl-defgeneric} signals an error if you attempt to turn an existing -Emacs Lisp function into a generic function. - -You can also create a generic method with @code{cl-defmethod} -(@pxref{Methods}). When a method is created and there is no generic -method in place with that name, then a new generic will be created, -and the new method will use it. -@end defmac - -@node Methods -@section Methods - -A method is a function that is executed if the arguments passed -to it matches the method's specializers. Different @eieio{} classes may -share the same method names. - -Methods are created with the @code{cl-defmethod} macro, which is similar -to @code{defun}. - -@defmac cl-defmethod method [:before | :around | :after ] arglist [doc-string] forms - -@var{method} is the name of the function to create. - -@code{:before}, @code{:around}, and @code{:after} specify execution order -(i.e., when this form is called). If none of these symbols are present, the -method is said to be a @emph{primary}. - -@var{arglist} is the list of arguments to this method. The mandatory arguments -in this list may have a type specializer (see the example below) which means -that the method will only apply when those arguments match the given type -specializer. An argument with no type specializer means that the method -applies regardless of its value. - -@var{doc-string} is the documentation attached to the implementation. -All method doc-strings are incorporated into the generic method's -function documentation. - -@var{forms} is the body of the function. - -@end defmac - -@noindent -In the following example, we create a method @code{mymethod} for the -@code{classname} class: - -@example -(cl-defmethod mymethod ((obj classname) secondarg) - "Doc string" ) -@end example - -@noindent -This method only executes if the @var{obj} argument passed to it is an -@eieio{} object of class @code{classname}. - -A method with no type specializer is a @dfn{default method}. If a given -class has no implementation, then the default method is called when -that method is used on a given object of that class. - -Only one method per combination of specializers and qualifiers (@code{:before}, -@code{:around}, or @code{:after}) is kept. If two @code{cl-defmethod}s appear -with the same specializers and the same qualifiers, then the second -implementation replaces the first. - -When a method is called on an object, but there is no method specified -for that object, but there is a method specified for object's parent -class, the parent class's method is called. If there is a method -defined for both, only the child's method is called. A child method -may call a parent's method using @code{cl-call-next-method}, described -below. - -If multiple methods and default methods are defined for the same -method and class, they are executed in this order: - -@enumerate -@item :around methods -The most specific @code{:around} method is called first, which may invoke the -less specific ones via @code{cl-call-next-method}. If it doesn't invoke -@code{cl-call-next-method}, then no other methods will be executed. When there -are no more @code{:around} methods to call, falls through to run the other -(non-@code{:around}) methods. -@item :before methods -Called in sequence from most specific to least specific. -@item primary methods -The most specific method is called, which may invoke the less specific -ones via @code{cl-call-next-method}. -@item :after methods -Called in sequence from least specific to most specific. -@end enumerate - -If no methods exist, Emacs signals a @code{cl-no-applicable-method} error. -@xref{Signals}. If methods exist but none of them are primary, Emacs -signals a @code{cl-no-primary-method} error. @xref{Signals}. - -@defun cl-call-next-method &rest replacement-args -@anchor{cl-call-next-method} - -This function calls the superclass method from a subclass method. -This is the ``next method'' specified in the current method list. - -If @var{replacement-args} is non-@code{nil}, then use them instead of the -arguments originally provided to the method. - -Can only be used from within the lexical body of a primary or around method. -@end defun - -@defun cl-next-method-p -@anchor{cl-next-method-p} -Non-@code{nil} if there is a next method. - -Can only be used from within the lexical body of a primary or around method. -@end defun - -@node Static Methods -@section Static Methods - -Static methods do not depend on an object instance, but instead -operate on a class. You can create a static method by using -the @code{subclass} specializer with @code{cl-defmethod}: +EIEIO provides one extension to @code{cl-defmethod} to allow mathods to +dispatch on a class argument: so-called ``static'' methods do not depend +on an object instance, but instead operate on a class. You can create +a static method by using the @code{subclass} specializer with +@code{cl-defmethod}: @example (cl-defmethod make-instance ((class (subclass mychild)) &rest args) From 69d8f9d1b709de36f45c0ce1dd04b8b30f0fa019 Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo Date: Fri, 27 Sep 2024 13:07:06 +0200 Subject: [PATCH 06/50] Fix php-ts-mode font-lock for latest PHP grammar (bug#73516) Version 0.23 of the PHP grammar introduced some changes that affect the font lock. * lisp/progmodes/php-ts-mode.el (php-ts-mode--language-source-alist): Update php, html, js and css grammars version. (php-ts-mode--parent-html-heuristic): Fix docstring (php-ts-mode--test-namespace-name-as-prefix-p): New function. (php-ts-mode--test-namespace-aliasing-clause-p): New function. (php-ts-mode--test-namespace-use-group-clause-p): New function. (php-ts-mode--font-lock-settings): Use the new functions. --- lisp/progmodes/php-ts-mode.el | 47 ++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el index 3f89de14075..87aefaf451f 100644 --- a/lisp/progmodes/php-ts-mode.el +++ b/lisp/progmodes/php-ts-mode.el @@ -83,12 +83,12 @@ ;;; Install treesitter language parsers (defvar php-ts-mode--language-source-alist - '((php . ("https://github.com/tree-sitter/tree-sitter-php" "v0.22.8" "php/src")) + '((php . ("https://github.com/tree-sitter/tree-sitter-php" "v0.23.0" "php/src")) (phpdoc . ("https://github.com/claytonrcarter/tree-sitter-phpdoc")) - (html . ("https://github.com/tree-sitter/tree-sitter-html" "v0.20.3")) - (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript" "v0.21.2")) - (jsdoc . ("https://github.com/tree-sitter/tree-sitter-jsdoc" "v0.21.0")) - (css . ("https://github.com/tree-sitter/tree-sitter-css" "v0.21.0"))) + (html . ("https://github.com/tree-sitter/tree-sitter-html" "v0.23.0")) + (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript" "v0.23.0")) + (jsdoc . ("https://github.com/tree-sitter/tree-sitter-jsdoc" "v0.23.0")) + (css . ("https://github.com/tree-sitter/tree-sitter-css" "v0.23.0"))) "Treesitter language parsers required by `php-ts-mode'. You can customize this variable if you want to stick to a specific commit and/or use different parsers.") @@ -490,7 +490,7 @@ characters of the current line." (treesit-node-start parent))))) (defun php-ts-mode--parent-html-heuristic (node parent _bol &rest _) - "Returns position based on html indentation. + "Return position based on html indentation. Returns 0 if the NODE is after the , otherwise returns the indentation point of the last word before the NODE, plus the @@ -773,6 +773,21 @@ characters of the current line." "__FUNCTION__" "__LINE__" "__METHOD__" "__NAMESPACE__" "__TRAIT__") "PHP predefined constant.") +(defun php-ts-mode--test-namespace-name-as-prefix-p () + "Return t if the namespace_name_as_prefix keyword is a namded node, nil otherwise." + (ignore-errors + (progn (treesit-query-compile 'php "(namespace_name_as_prefix)" t) t))) + +(defun php-ts-mode--test-namespace-aliasing-clause-p () + "Return t if the namespace_name_as_prefix keyword is a namded node, nil otherwise." + (ignore-errors + (progn (treesit-query-compile 'php "(namespace_name_as_prefix)" t) t))) + +(defun php-ts-mode--test-namespace-use-group-clause-p () + "Return t if the namespace_use_group_clause keyword is a namded node, nil otherwise." + (ignore-errors + (progn (treesit-query-compile 'php "(namespace_use_group_clause)" t) t))) + (defun php-ts-mode--font-lock-settings () "Tree-sitter font-lock settings." (treesit-font-lock-rules @@ -866,7 +881,7 @@ characters of the current line." :language 'php :feature 'definition :override t - '((php_tag) @font-lock-preprocessor-face + `((php_tag) @font-lock-preprocessor-face ("?>") @font-lock-preprocessor-face ;; Highlights identifiers in declarations. (class_declaration @@ -889,10 +904,16 @@ characters of the current line." ("=>") @font-lock-keyword-face (object_creation_expression (name) @font-lock-type-face) - (namespace_name_as_prefix "\\" @font-lock-delimiter-face) - (namespace_name_as_prefix (namespace_name (name)) @font-lock-type-face) - (namespace_use_clause (name) @font-lock-property-use-face) - (namespace_aliasing_clause (name) @font-lock-type-face) + ,@(when (php-ts-mode--test-namespace-name-as-prefix-p) + '((namespace_name_as_prefix "\\" @font-lock-delimiter-face) + (namespace_name_as_prefix + (namespace_name (name)) @font-lock-type-face))) + ,@(if (php-ts-mode--test-namespace-aliasing-clause-p) + '((namespace_aliasing_clause (name) @font-lock-type-face)) + '((namespace_use_clause alias: (name) @font-lock-type-face))) + ,@(when (not (php-ts-mode--test-namespace-use-group-clause-p)) + '((namespace_use_group + (namespace_use_clause (name) @font-lock-type-face)))) (namespace_name "\\" @font-lock-delimiter-face) (namespace_name (name) @font-lock-type-face) (use_declaration (name) @font-lock-property-use-face)) @@ -931,8 +952,10 @@ characters of the current line." :language 'php :feature 'base-clause :override t - '((base_clause (name) @font-lock-type-face) + `((base_clause (name) @font-lock-type-face) (use_as_clause (name) @font-lock-property-use-face) + ,@(when (not (php-ts-mode--test-namespace-name-as-prefix-p)) + '((qualified_name prefix: "\\" @font-lock-delimiter-face))) (qualified_name (name) @font-lock-constant-face)) :language 'php From a1841b4d8e72e58d907847887cc0d51cb56b33c3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 28 Sep 2024 12:28:24 +0300 Subject: [PATCH 07/50] ; * admin/authors.el (authors-aliases): Don't ignore "one.last.kiss". --- admin/authors.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/authors.el b/admin/authors.el index bcb06953df3..50f3d1ae68d 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -213,7 +213,7 @@ files.") ("Noorul Islam" "Noorul Islam K M") ;;; ("Tetsurou Okazaki" "OKAZAKI Tetsurou") ; FIXME? (nil "odanoburu@") - (nil "one\\.last\\.kiss@outlook\\.com") + ("Xie Qi" "one\\.last\\.kiss@outlook\\.com" "shynur") ("Cao ZhenXiang" "mail@ookami\\.one") ("Óscar Fuentes" "Oscar Fuentes") (nil "pillule") From e8830015b0714173a1eca75ea606d88bce1af48b Mon Sep 17 00:00:00 2001 From: Morgan Willcock Date: Tue, 24 Sep 2024 20:19:08 +0100 Subject: [PATCH 08/50] Require ert-x for use by 'ert-font-lock-deftest-file' This fixes a void-function error when 'ert-font-lock-deftest-file' is called when ert-x has not already been loaded. * lisp/emacs-lisp/ert-font-lock.el (ert): Require ert-x so that 'ert-resource-file' is available for use within 'ert-font-lock-deftest-file'. (Bug#73254) --- lisp/emacs-lisp/ert-font-lock.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/emacs-lisp/ert-font-lock.el b/lisp/emacs-lisp/ert-font-lock.el index c6fd65e1507..58c6c0311cd 100644 --- a/lisp/emacs-lisp/ert-font-lock.el +++ b/lisp/emacs-lisp/ert-font-lock.el @@ -36,6 +36,7 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'newcomment) (require 'pcase) From e2b01d164cddcfda053334f735e099aef86547da Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 28 Sep 2024 15:06:44 +0300 Subject: [PATCH 09/50] ; Fix last changes in php-ts-mode.el * lisp/progmodes/php-ts-mode.el (php-ts-mode--test-namespace-name-as-prefix-p) (php-ts-mode--test-namespace-aliasing-clause-p) (php-ts-mode--test-namespace-use-group-clause-p): Doc fixes. (treesit-query-compile): Declare. --- lisp/progmodes/php-ts-mode.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el index 87aefaf451f..d2559e5a45f 100644 --- a/lisp/progmodes/php-ts-mode.el +++ b/lisp/progmodes/php-ts-mode.el @@ -77,6 +77,7 @@ (declare-function treesit-parser-included-ranges "treesit.c") (declare-function treesit-parser-list "treesit.c") (declare-function treesit-parser-language "treesit.c") +(declare-function treesit-query-compile "treesit.c") (declare-function treesit-search-forward "treesit.c") (declare-function treesit-node-prev-sibling "treesit.c") (declare-function treesit-node-first-child-for-pos "treesit.c") @@ -774,17 +775,17 @@ characters of the current line." "PHP predefined constant.") (defun php-ts-mode--test-namespace-name-as-prefix-p () - "Return t if the namespace_name_as_prefix keyword is a namded node, nil otherwise." + "Return t if namespace_name_as_prefix keyword is a named node, nil otherwise." (ignore-errors (progn (treesit-query-compile 'php "(namespace_name_as_prefix)" t) t))) (defun php-ts-mode--test-namespace-aliasing-clause-p () - "Return t if the namespace_name_as_prefix keyword is a namded node, nil otherwise." + "Return t if namespace_name_as_prefix keyword is named node, nil otherwise." (ignore-errors (progn (treesit-query-compile 'php "(namespace_name_as_prefix)" t) t))) (defun php-ts-mode--test-namespace-use-group-clause-p () - "Return t if the namespace_use_group_clause keyword is a namded node, nil otherwise." + "Return t if namespace_use_group_clause keyword is named node, nil otherwise." (ignore-errors (progn (treesit-query-compile 'php "(namespace_use_group_clause)" t) t))) From 7abecbcd63317496369fffe69b6afab4af058ed6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 28 Sep 2024 15:36:06 +0300 Subject: [PATCH 10/50] ; * nt/INSTALL: Update MinGW notes URL. (Bug#73528) --- nt/INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nt/INSTALL b/nt/INSTALL index 6167365169b..b959ce362f7 100644 --- a/nt/INSTALL +++ b/nt/INSTALL @@ -157,7 +157,7 @@ build should run on Windows 9X and newer systems). When the installation ends, perform the post-installation steps described on this page of the MinGW site: - http://www.mingw.org/wiki/Getting_Started + https://web.archive.org/web/20210106033223/http://www.mingw.org/wiki/Getting_Started in the "After Installing You Should ..." section. These steps are important for making your installation complete, and in particular From 36ff7138febfcec7fcee44e8b51c6b26cbb056a2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 29 Sep 2024 15:42:21 +0300 Subject: [PATCH 11/50] ; Fix a thinko in sieve-manage.el * lisp/net/sieve-manage.el (sieve-manage--append-to-log): Fix thinko. (Bug#54154) --- lisp/net/sieve-manage.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/net/sieve-manage.el b/lisp/net/sieve-manage.el index 0faeb02bcfd..da2167cd231 100644 --- a/lisp/net/sieve-manage.el +++ b/lisp/net/sieve-manage.el @@ -178,7 +178,8 @@ If it is nil, logging is disabled." (with-current-buffer (get-buffer-create sieve-manage-log) (set-buffer-multibyte nil) - (buffer-disable-undo))) + (buffer-disable-undo) + (current-buffer))) (goto-char (point-max)) (apply #'insert args)))) From c0ef8a9a1b39c63de17b375485cc405f994d4e55 Mon Sep 17 00:00:00 2001 From: Gautier Ponsinet Date: Sun, 29 Sep 2024 14:00:05 +0300 Subject: [PATCH 12/50] Fix a typo in the calendar manual * doc/emacs/calendar.texi (Calendar Unit Motion): Add a missing parenthesis. (Bug#73555) --- doc/emacs/calendar.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi index 10fe404099d..91ea3b9154d 100644 --- a/doc/emacs/calendar.texi +++ b/doc/emacs/calendar.texi @@ -106,7 +106,7 @@ commands for moving by characters and by lines. Just as @kbd{C-n} usually moves to the same column in the following line, in Calendar mode it is bound to @code{calendar-forward-week}, which moves to the same day in the following week. And @kbd{C-p} -(@code{calendar-backward-week} moves to the same day in the previous +(@code{calendar-backward-week}) moves to the same day in the previous week. @kbd{C-f} (@code{calendar-forward-day}) and @kbd{C-b} (@code{calendar-backward-day}) move forward and back by days. From 11e3e0cadd46ee49007477af1335ddd5365debe2 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Wed, 25 Sep 2024 11:59:32 -0700 Subject: [PATCH 13/50] Fix executing commands in Eshell using "env" with no local variables * lisp/eshell/esh-var.el (eshell/env): Throw 'eshell-replace-command' as needed. * test/lisp/eshell/esh-var-tests.el (esh-var-test/local-variables/env/no-locals): New test (bug#73479). --- lisp/eshell/esh-var.el | 3 ++- test/lisp/eshell/esh-var-tests.el | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index f0270aca92c..1b54f1862be 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -436,7 +436,8 @@ the values of nil for each." :usage "[NAME=VALUE]... [COMMAND]...") (if args (or (eshell-parse-local-variables args) - (eshell-named-command (car args) (cdr args))) + (throw 'eshell-replace-command + `(eshell-named-command ,(car args) ',(cdr args)))) (eshell-with-buffered-print (dolist (setting (sort (eshell-environment-variables) 'string-lessp)) (eshell-buffered-print setting "\n")))))) diff --git a/test/lisp/eshell/esh-var-tests.el b/test/lisp/eshell/esh-var-tests.el index 6b0e225f05f..7b29e4a21db 100644 --- a/test/lisp/eshell/esh-var-tests.el +++ b/test/lisp/eshell/esh-var-tests.el @@ -669,6 +669,11 @@ nil, use FUNCTION instead." (eshell-match-command-output "env VAR=hello env" "VAR=hello\n") (should (equal (getenv "VAR") "value")))) +(ert-deftest esh-var-test/local-variables/env/no-locals () + "Test that \"env command\" works like \"command\"." + (with-temp-eshell + (eshell-match-command-output "env echo hi" "\\`hi\n"))) + ;; Variable aliases From fd1a1b07805a0d84ca3a7fe83a5f90a8fa0fd00b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 30 Sep 2024 20:37:27 +0200 Subject: [PATCH 14/50] Remove out-of-date documentation from python.el * lisp/progmodes/python.el: Remove out-of-date documentation about automatic indentation; 'electric-indent-mode' is enabled by default in Emacs 24.4 or later, so this is no longer an issue. --- lisp/progmodes/python.el | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index a50446343a0..9d87d6cb6a5 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -233,23 +233,6 @@ ;; `python-imenu-format-parent-item-jump-label-function' variables for ;; changing the way labels are formatted in the tree version. -;; If you used python-mode.el you may miss auto-indentation when -;; inserting newlines. To achieve the same behavior you have two -;; options: - -;; 1) Enable the minor-mode `electric-indent-mode' (enabled by -;; default) and use RET. If this mode is disabled use -;; `newline-and-indent', bound to C-j. - -;; 2) Add the following hook in your .emacs: - -;; (add-hook 'python-mode-hook -;; (lambda () -;; (define-key python-mode-map "\C-m" 'newline-and-indent))) - -;; I'd recommend the first one since you'll get the same behavior for -;; all modes out-of-the-box. - ;; Flymake: A Flymake backend, using the pyflakes program by default, ;; is provided. You can also use flake8 or pylint by customizing ;; `python-flymake-command'. From 9c904e8ceae935a370a20f8255a355997786647c Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 1 Oct 2024 00:15:08 +0200 Subject: [PATCH 15/50] Change :group of 'eglot' defgroup to 'tools' In 'M-x customize', Eglot fits in better in "Programming -> Tools", with the likes of Flymake and Gud, than it does in "Applications", with ERC and Newsticker. * lisp/progmodes/eglot.el (eglot): Change :group of defgroup to 'tools'. --- lisp/progmodes/eglot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index a358b823795..4306819b556 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -180,7 +180,7 @@ (defgroup eglot nil "Interaction with Language Server Protocol servers." :prefix "eglot-" - :group 'applications) + :group 'tools) (defun eglot-alternatives (alternatives) "Compute server-choosing function for `eglot-server-programs'. From 96b87ad5363feed7a3bc5ab1c7fa096867140cf4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 1 Oct 2024 00:24:23 +0200 Subject: [PATCH 16/50] Mention LSP acronym in eglot defgroup docstring * lisp/progmodes/eglot.el (eglot): Improve defgroup description by mentioning the LSP acronym, for users that might be searching for that. --- lisp/progmodes/eglot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4306819b556..58487924883 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -178,7 +178,7 @@ ;;; User tweakable stuff (defgroup eglot nil - "Interaction with Language Server Protocol servers." + "Interaction with Language Server Protocol (LSP) servers." :prefix "eglot-" :group 'tools) From 84bea20eba2fd7c9b8c81b816fffe69a2b7892e3 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 1 Oct 2024 21:24:09 +0200 Subject: [PATCH 17/50] ; * lisp/info-look.el: Add two more links. --- lisp/info-look.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/info-look.el b/lisp/info-look.el index 2baf133c7d3..41e64753844 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -30,6 +30,8 @@ ;; Scheme: https://groups.csail.mit.edu/mac/ftpdir/scm/r5rs.info.tar.gz ;; LaTeX: https://mirrors.ctan.org/info/latex2e-help-texinfo/latex2e.texi ;; (or CTAN mirrors) +;; Python: https://www.python.org/ftp/python/doc/ +;; SICP: https://github.com/webframp/sicp-info ;; Traditionally, makeinfo quoted `like this', but version 5 and later ;; quotes 'like this' or ‘like this’. Doc specs with patterns From 63058e1153ae1c3a9662b50ff8be439026e11986 Mon Sep 17 00:00:00 2001 From: john muhl Date: Sat, 13 Jul 2024 18:36:38 -0500 Subject: [PATCH 18/50] Tag interactive commands in 'lua-ts-mode' * lisp/progmodes/lua-ts-mode.el (lua-ts-send-buffer) (lua-ts-send-file, lua-ts-send-region): Mark inferior interaction commands that are only relevant in Lua buffers. (Bug#73586) --- lisp/progmodes/lua-ts-mode.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 8d0f49c2d89..4ea453c9b65 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -676,19 +676,19 @@ Calls REPORT-FN directly." (defun lua-ts-send-buffer () "Send current buffer to the inferior Lua process." - (interactive) + (interactive nil lua-ts-mode) (lua-ts-send-region (point-min) (point-max))) (defun lua-ts-send-file (file) "Send contents of FILE to the inferior Lua process." - (interactive "f") + (interactive "f" lua-ts-mode) (with-temp-buffer (insert-file-contents-literally file) (lua-ts-send-region (point-min) (point-max)))) (defun lua-ts-send-region (beg end) "Send region between BEG and END to the inferior Lua process." - (interactive "r") + (interactive "r" lua-ts-mode) (let ((string (buffer-substring-no-properties beg end)) (proc-buffer (lua-ts-inferior-lua))) (comint-send-string proc-buffer "print()") ; Prevent output from From 44156c2140772fa04ebbc0a488a85f0741e0c2ef Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 1 Oct 2024 22:09:42 +0200 Subject: [PATCH 19/50] ; Minor clarification in variables.texi * doc/lispref/variables.texi (Creating Buffer-Local): Add comma to make reference clearer. --- doc/lispref/variables.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 76f15b2595c..d990f116c69 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1733,7 +1733,7 @@ buffer-local variables interactively. This function eliminates all the buffer-local variable bindings of the current buffer. As a result, the buffer will see the default values of most variables. By default, for variables marked as permanent and -local hook functions that have a non-@code{nil} +local, hook functions that have a non-@code{nil} @code{permanent-local-hook} property (@pxref{Setting Hooks}) won't be killed, but if the optional @var{kill-permanent} argument is non-@code{nil}, even these variables will be killed. From 108b3179bd4bcc82791ea5998de5dadb647992c4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 2 Oct 2024 00:12:34 +0200 Subject: [PATCH 20/50] Revert "; Minor clarification in variables.texi" This reverts commit 44156c2140772fa04ebbc0a488a85f0741e0c2ef. --- doc/lispref/variables.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index d990f116c69..76f15b2595c 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1733,7 +1733,7 @@ buffer-local variables interactively. This function eliminates all the buffer-local variable bindings of the current buffer. As a result, the buffer will see the default values of most variables. By default, for variables marked as permanent and -local, hook functions that have a non-@code{nil} +local hook functions that have a non-@code{nil} @code{permanent-local-hook} property (@pxref{Setting Hooks}) won't be killed, but if the optional @var{kill-permanent} argument is non-@code{nil}, even these variables will be killed. From e6a37869c8dcbd17b01dab66c5588f087a33ddf0 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 2 Oct 2024 09:15:46 +0800 Subject: [PATCH 21/50] Fix inconsistency in value of rcirc-activity-string * lisp/net/rcirc.el (rcirc-update-activity-string): Consistently don't display anything if there aren't any IRC connections. --- lisp/net/rcirc.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 659035d4acb..7095da34ec0 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -2537,9 +2537,14 @@ activity. Only run if the buffer is not visible and (rcirc-activity-string lopri) ")")) (and hipri "]"))) + ;; Consistently don't display anything if there aren't + ;; any IRC connections. Otherwise, whether we display + ;; "[]" or not depends on whether or not this function + ;; happens to have been called in this session yet. ((not (null (rcirc-process-list))) "[]") - (t "[]"))) + (t + ""))) (run-hooks 'rcirc-update-activity-string-hook) (force-mode-line-update t))) From d68e6d2689d0b3be4d251b0edc09fba144f7b282 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 2 Oct 2024 09:18:35 +0800 Subject: [PATCH 22/50] ; rcirc-update-activity-string: Justify some existing behaviour --- lisp/net/rcirc.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 7095da34ec0..2a713de83c2 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -2541,6 +2541,17 @@ activity. Only run if the buffer is not visible and ;; any IRC connections. Otherwise, whether we display ;; "[]" or not depends on whether or not this function ;; happens to have been called in this session yet. + ;; + ;; Consistently display nothing, rather than + ;; consistently displaying "[]", for the sake of the + ;; following sort of case: the user has enabled + ;; `rcirc-track-minor-mode' using the customization + ;; system, but also starts up Emacs instances that + ;; aren't used for IRC. Due to the use of easy + ;; customization, `rcirc-track-minor-mode' will be + ;; turned on for every instance of Emacs. But we don't + ;; want to take up valuable mode line space when, say, + ;; Emacs is started up as the value of EDITOR/VISUAL. ((not (null (rcirc-process-list))) "[]") (t From f46f476bb8f1b0f4f63c2af86aa0dcd11c9e2c7c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 2 Oct 2024 09:21:11 +0800 Subject: [PATCH 23/50] ; * admin/MAINTAINERS: Take VC subsystem, add note about handovers Based on discussion with the head maintainers and Dmitry by private mail. --- admin/MAINTAINERS | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/admin/MAINTAINERS b/admin/MAINTAINERS index 16601a76bd6..9bfdcdc7489 100644 --- a/admin/MAINTAINERS +++ b/admin/MAINTAINERS @@ -233,9 +233,22 @@ Philip Kaludercic lisp/emacs-lisp/compat.el lisp/net/rcirc.el +Sean Whitton + VC + lisp/vc/* + doc/emacs/files.texi (Diff Mode) + doc/emacs/maintaining.texi (Version Control) + doc/emacs/vc*-xtra.texi + doc/emacs/emerge-xtra.texi + doc/misc/ediff.texi + test/lisp/vc/* + ============================================================================== 2. Areas that someone is willing to maintain, although he would not necessarily mind if someone else was the official maintainer. +This list also includes people who are in the process of handing over +maintainership to someone listed above, but who want to continue to be +CC'd as though they were still the primary maintainer, in the meantime. ============================================================================== Kelvin White From d42d7d474fe07a577d9f8006323784583867ec43 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 2 Oct 2024 12:06:46 +0800 Subject: [PATCH 24/50] ; * lisp/doc-view.el (doc-view-svg-face): Copy-edit docstring. --- lisp/doc-view.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 1ed0c71febe..993a880f34f 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -245,7 +245,7 @@ showing only titles and no page number." See `doc-view-mupdf-use-svg'. Only background and foreground colors are used as the SVG image's -descriptors, see (info \"(elisp) SVG Images\"). Non-standard values may +descriptors; see (info \"(elisp) SVG Images\"). Custom values may cause low-contrast issues with certain documents." :version "30.1") From 4c866abab966e85ed1fb57aea9971ce8d1495970 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 2 Oct 2024 08:47:29 +0300 Subject: [PATCH 25/50] ; * doc/lispref/variables.texi (Creating Buffer-Local): Fix wording. --- doc/lispref/variables.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 76f15b2595c..af11e498d86 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1732,11 +1732,11 @@ buffer-local variables interactively. @defun kill-all-local-variables &optional kill-permanent This function eliminates all the buffer-local variable bindings of the current buffer. As a result, the buffer will see the default values -of most variables. By default, for variables marked as permanent and +of most variables. By default, variables marked as permanent and local hook functions that have a non-@code{nil} @code{permanent-local-hook} property (@pxref{Setting Hooks}) won't be killed, but if the optional @var{kill-permanent} argument is -non-@code{nil}, even these variables will be killed. +non-@code{nil}, even those variables will be killed. This function also resets certain other information pertaining to the buffer: it sets the local keymap to @code{nil}, the syntax table to the From bf26ff0dc8d1591c9c75e12cfdf057353b3869bf Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Fri, 20 Sep 2024 01:16:44 -0700 Subject: [PATCH 26/50] Update csharp-ts-mode font-lock (bug#73369) Adapt to the latest c-sharp grammar. * lisp/progmodes/csharp-mode.el: (csharp-ts-mode--test-this-expression): (csharp-ts-mode--test-interpolated-string-text): (csharp-ts-mode--test-type-constraint): (csharp-ts-mode--test-type-of-expression): (csharp-ts-mode--test-name-equals): (csharp-ts-mode--test-if-directive): (csharp-ts-mode--test-method-declaration-type-field): New functions. (csharp-ts-mode--type-field): New variable. (csharp-ts-mode--font-lock-settings): Fix font-lock rules. --- lisp/progmodes/csharp-mode.el | 155 ++++++++++++++++++++++++++-------- 1 file changed, 118 insertions(+), 37 deletions(-) diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 29325ab9632..755303a158d 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -730,6 +730,52 @@ compilation and evaluation time conflicts." "readonly" "unmanaged") "C# keywords for tree-sitter font-locking.") +(defun csharp-ts-mode--test-this-expression () + "Return non-nil if (this_expression) is named in csharp grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(this_expression)" t) + t)) + +(defun csharp-ts-mode--test-interpolated-string-text () + "Return non-nil if (interpolated_string_text) is in the grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(interpolated_string_text)" t) + t)) + +(defun csharp-ts-mode--test-type-constraint () + "Return non-nil if (type_constraint) is in the grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(type_constraint)" t) + t)) + +(defun csharp-ts-mode--test-type-of-expression () + "Return non-nil if (type_of_expression) is in the grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(type_of_expression)" t) + t)) + +(defun csharp-ts-mode--test-name-equals () + "Return non-nil if (name_equals) is in the grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(name_equals)" t) + t)) + +(defun csharp-ts-mode--test-if-directive () + "Return non-nil if (if_directive) is in the grammar." + (ignore-errors + (treesit-query-compile 'c-sharp "(if_directive)" t) + t)) + +(defun csharp-ts-mode--test-method-declaration-type-field () + "Return non-nil if (method_declaration) has a type field." + (ignore-errors + (treesit-query-compile 'c-sharp "(method_declaration type: (_))" t) + t)) + +(defvar csharp-ts-mode--type-field + (if (csharp-ts-mode--test-method-declaration-type-field) + 'type: 'returns:)) + (defvar csharp-ts-mode--font-lock-settings (treesit-font-lock-rules :language 'c-sharp @@ -760,7 +806,9 @@ compilation and evaluation time conflicts." :feature 'keyword `([,@csharp-ts-mode--keywords] @font-lock-keyword-face (modifier) @font-lock-keyword-face - (this_expression) @font-lock-keyword-face) + ,@(if (csharp-ts-mode--test-this-expression) + '((this_expression) @font-lock-keyword-face) + '("this" @font-lock-keyword-face))) :language 'c-sharp :override t @@ -786,18 +834,23 @@ compilation and evaluation time conflicts." :feature 'string `([(string_literal) (verbatim_string_literal) - (interpolated_string_text) - (interpolated_verbatim_string_text) - (character_literal) - "\"" - "$\"" - "@$\"" - "$@\""] @font-lock-string-face) + ,@(if (csharp-ts-mode--test-interpolated-string-text) + '((interpolated_string_text) + (interpolated_verbatim_string_text) + (character_literal) + "\"" + "$\"" + "@$\"" + "$@\"") + '((interpolated_string_expression) + (interpolation_start) + (interpolation_quote)))] + @font-lock-string-face) :language 'c-sharp :override t :feature 'type - '((predefined_type) @font-lock-type-face + `((predefined_type) @font-lock-type-face (implicit_type) @font-lock-type-face (nullable_type) @font-lock-type-face (type_parameter @@ -816,10 +869,17 @@ compilation and evaluation time conflicts." (cast_expression (generic_name (identifier) @font-lock-type-face)) ["operator"] @font-lock-type-face (type_parameter_constraints_clause - target: (identifier) @font-lock-type-face) - (type_constraint type: (identifier) @font-lock-type-face) - (type_constraint type: (generic_name (identifier) @font-lock-type-face)) - (type_of_expression (identifier) @font-lock-type-face) + (identifier) @font-lock-type-face) + ,@(if (csharp-ts-mode--test-type-constraint) + '((type_constraint type: (identifier) @font-lock-type-face) + (type_constraint type: (generic_name (identifier) @font-lock-type-face))) + '((type_parameter_constraint (type type: (identifier) @font-lock-type-face)) + (type_parameter_constraint (type type: (generic_name (identifier) @font-lock-type-face))))) + + ,@(when (csharp-ts-mode--test-type-of-expression) + '((type_of_expression (identifier) @font-lock-type-face)) + '((typeof_expression (identifier) @font-lock-type-face))) + (object_creation_expression type: (identifier) @font-lock-type-face) (object_creation_expression @@ -832,8 +892,9 @@ compilation and evaluation time conflicts." :override t `((qualified_name (identifier) @font-lock-type-face) (using_directive (identifier) @font-lock-type-face) - (using_directive (name_equals - (identifier) @font-lock-type-face)) + ,@(when (csharp-ts-mode--test-name-equals) + '((using_directive (name_equals + (identifier) @font-lock-type-face)))) (enum_declaration (identifier) @font-lock-type-face) (enum_member_declaration (identifier) @font-lock-variable-name-face) @@ -861,10 +922,10 @@ compilation and evaluation time conflicts." ;;; Check if keyword void_keyword is available, then return the correct rule." ,@(condition-case nil (progn (treesit-query-capture 'csharp '((void_keyword) @capture)) - `((method_declaration type: [(identifier) (void_keyword)] @font-lock-type-face))) + `((method_declaration ,csharp-ts-mode--type-field [(identifier) (void_keyword)] @font-lock-type-face))) (error - `((method_declaration type: [(identifier) (predefined_type)] @font-lock-type-face)))) - (method_declaration type: (generic_name (identifier) @font-lock-type-face)) + `((method_declaration ,csharp-ts-mode--type-field [(identifier) (predefined_type)] @font-lock-type-face)))) + (method_declaration ,csharp-ts-mode--type-field (generic_name (identifier) @font-lock-type-face)) (method_declaration name: (_) @font-lock-function-name-face) (catch_declaration @@ -907,25 +968,45 @@ compilation and evaluation time conflicts." :language 'c-sharp :feature 'directives :override t - '((if_directive - "if" @font-lock-preprocessor-face - (identifier) @font-lock-variable-use-face) - (elif_directive - "elif" @font-lock-preprocessor-face - (identifier) @font-lock-variable-use-face) - (else_directive) @font-lock-preprocessor-face - (endif_directive) @font-lock-preprocessor-face - (define_directive - "define" @font-lock-preprocessor-face - (identifier) @font-lock-variable-use-face) - (nullable_directive) @font-lock-preprocessor-face - (pragma_directive) @font-lock-preprocessor-face - (region_directive) @font-lock-preprocessor-face - (endregion_directive) @font-lock-preprocessor-face - (region_directive - (preproc_message) @font-lock-variable-use-face) - (endregion_directive - (preproc_message) @font-lock-variable-use-face)))) + (if (csharp-ts-mode--test-if-directive) + '((if_directive + "if" @font-lock-preprocessor-face + (identifier) @font-lock-variable-use-face) + (elif_directive + "elif" @font-lock-preprocessor-face + (identifier) @font-lock-variable-use-face) + (else_directive) @font-lock-preprocessor-face + (endif_directive) @font-lock-preprocessor-face + (define_directive + "define" @font-lock-preprocessor-face + (identifier) @font-lock-variable-use-face) + (nullable_directive) @font-lock-preprocessor-face + (pragma_directive) @font-lock-preprocessor-face + (region_directive) @font-lock-preprocessor-face + (endregion_directive) @font-lock-preprocessor-face + (region_directive + (preproc_message) @font-lock-variable-use-face) + (endregion_directive + (preproc_message) @font-lock-variable-use-face)) + '((preproc_if + "#if" @font-lock-preprocessor-face + (identifier) @font-lock-variable-use-face) + (preproc_elif + "#elif" @font-lock-preprocessor-face + (identifier) @font-lock-variable-use-face) + (preproc_else) @font-lock-preprocessor-face + "#endif" @font-lock-preprocessor-face + (preproc_define + "#define" @font-lock-preprocessor-face + (preproc_arg) @font-lock-variable-use-face) + (preproc_nullable) @font-lock-preprocessor-face + (preproc_pragma) @font-lock-preprocessor-face + (preproc_region) @font-lock-preprocessor-face + (preproc_endregion) @font-lock-preprocessor-face + (preproc_region + (preproc_arg) @font-lock-variable-use-face) + (preproc_endregion + (preproc_arg) @font-lock-variable-use-face))))) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-mode)) From 705a5a1a9e6c3ae006a2aa4d6bc9d02951a58aa6 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 3 Oct 2024 18:39:16 +0800 Subject: [PATCH 27/50] ; * ChangeLog.4: Fix attribution of one change. --- ChangeLog.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.4 b/ChangeLog.4 index 4bd583818ef..975750f40cd 100644 --- a/ChangeLog.4 +++ b/ChangeLog.4 @@ -11433,7 +11433,7 @@ * etc/NEWS: Update announcement. -2024-05-15 Sean Whitton +2024-05-15 Stefan Monnier (eglot--managed-mode): Avoid calling track-changes unregistered From 5eaf0c784bf1709d3ad18ff4a0b4d4b7ec03cf91 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 3 Oct 2024 23:52:55 +0200 Subject: [PATCH 28/50] * lisp/info-look.el (mapc): Add use-package manual's index. --- lisp/info-look.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/info-look.el b/lisp/info-look.el index 41e64753844..37f6a6dbb8e 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -1083,6 +1083,7 @@ Return nil if there is nothing appropriate in the buffer near point." ("srecode" "Index") ("tramp" "Variable Index" "Function Index") ("url" "Variable Index" "Function Index") + ("use-package" "Index") ("vhdl" "(vhdl-mode)Variable Index" "(vhdl-mode)Command Index") ("viper" "Variable Index" "Function Index") ("vtable" "Index") From 51ef05f684c779b492965571cf9a169b93e86aa0 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 4 Oct 2024 17:28:38 +0800 Subject: [PATCH 29/50] count-windows: Fix reference to walk-windows * lisp/window.el (count-windows): Refer to walk-windows for the precise meaning of both the MINIBUF and ALL-FRAMES arguments, not just the ALL-FRAMES argument. In both functions, these arguments are both passed through to window-list-1. --- lisp/window.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/window.el b/lisp/window.el index 006cfa19525..50fb16b3204 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2661,7 +2661,7 @@ window is included in the count. If ALL-FRAMES is non-nil, count the windows in all frames instead just the selected frame. -See `walk-windows' for the precise meaning of this argument." +See `walk-windows' for the precise meaning of these arguments." (length (window-list-1 nil minibuf all-frames))) ;;; Resizing windows. From e9dcf0c57ddea6a3ac3136e82cdb740326e735d4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 Oct 2024 14:39:50 +0300 Subject: [PATCH 30/50] Fix 'list-tags' when invoked from a non-file buffer This use case was broken by the improvement that attempts to offer the current buffer's file name as the default file whose tags to list. * lisp/progmodes/etags.el (tags--get-current-buffer-name-in-tags-file): Doc fix. Return nil if no file is associated with the current buffer, and avoid signaling an error if 'buffer-file-name' returns nil. (Bug#37611) (list-tags): Doc fix. Signal an error if the user specifies no file name at the prompt. * doc/emacs/maintaining.texi (List Identifiers): Fix wording of the documentation of 'list-tags'. --- doc/emacs/maintaining.texi | 15 +++++++-------- lisp/progmodes/etags.el | 37 +++++++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 3c34afbaa20..a632ffda4ab 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -2664,14 +2664,13 @@ loaded, this command can use it to generate completion candidates. @xref{Symbol Completion}. @findex list-tags - @kbd{M-x list-tags} reads the name of one of the files covered by -the selected tags table, and displays a list of tags defined in that -file. Do not include a directory as part of the file name unless the -file name recorded in the tags table includes a directory. This -command works only with the etags backend, and requires a tags table -for the project to be available. @xref{Tags Tables}. If used -interactively, the default tag is file name of the current buffer if -used interactively. + @kbd{M-x list-tags} reads the name of one of the files covered by the +selected tags table, with completion, and displays the list of tags +defined in that file; it offers the current buffer's file name as the +default file whose tags to list. Do not include a directory as part of +the file name unless the file name recorded in the tags table includes a +directory. This command works only with the etags backend, and requires +a tags table for the project to be available. @xref{Tags Tables}. @findex tags-next-file @kbd{M-x tags-next-file} visits files covered by the selected tags table. diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index d3eb0d46e9b..35dc0215046 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1894,27 +1894,40 @@ description of the arguments." (try-completion string (tags-table-files) predicate)))) (defun tags--get-current-buffer-name-in-tags-file () - "Get the file name that the current buffer corresponds in the tags file." - (let ((tag-dir - (save-excursion - (visit-tags-table-buffer) - (file-name-directory (buffer-file-name))))) - (file-relative-name (buffer-file-name) tag-dir))) + "Return file name that corresponds to the current buffer in the tags table. +This returns the file name which corresponds to the current buffer relative +to the directory of the current tags table (see `visit-tags-table-buffer'). +If no file is associated with the current buffer, this function returns nil." + (let ((buf-fname (buffer-file-name))) + ;; FIXME: Are there interesting cases where 'buffer-file-name' + ;; returns nil, but there's some file we expect to find in TAGS that + ;; is associated with the buffer? The obvious cases of Dired and + ;; Info buffers are not interesting for TAGS, but are there any + ;; others? + (if buf-fname + (let ((tag-dir + (save-excursion + (visit-tags-table-buffer) + (file-name-directory buf-fname)))) + (file-relative-name buf-fname tag-dir))))) ;;;###autoload (defun list-tags (file &optional _next-match) "Display list of tags in file FILE. -This searches only the first table in the list, and no included -tables. FILE should be as it appeared in the `etags' command, -usually without a directory specification. If called -interactively, FILE defaults to the file name of the current -buffer." +Interactively, prompt for FILE, with completion, offering the current +buffer's file name as the defaul. +This command searches only the first table in the list of tags tables, +and does not search included tables. +FILE should be as it was submitted to the `etags' command, which usually +means relative to the directory of the tags table file." (interactive (list (completing-read "List tags in file: " 'tags-complete-tags-table-file nil t - ;; Default FILE to the current buffer. + ;; Default FILE to the current buffer's file. (tags--get-current-buffer-name-in-tags-file)))) + (if (string-empty-p file) + (user-error "You must specify a file name")) (with-output-to-temp-buffer "*Tags List*" (princ (substitute-command-keys "Tags in file `")) (tags-with-face 'highlight (princ file)) From d656be9794dcce02fb0b2ac3f5a955ddbe57040d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 Oct 2024 16:32:13 +0300 Subject: [PATCH 31/50] Expand email abbrevs in X-Debbugs-Cc header. * lisp/mail/mailabbrev.el (mail-abbrev-mode-regexp): * lisp/mail/mailalias.el (mail-address-field-regexp) (mail-complete-alist): Add "X-Debbugs-Cc" to headers where email aliases should be expanded, for compatibility with emacsbug.el. --- lisp/mail/mailabbrev.el | 2 +- lisp/mail/mailalias.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index c8006294a7d..16e9d6f1bea 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -410,7 +410,7 @@ with a space." ;;; Syntax tables and abbrev-expansion (defcustom mail-abbrev-mode-regexp - "^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\):" + "^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\|X-Debbugs-Cc\\):" "Regexp matching mail headers in which mail abbrevs should be expanded. This string will be handed to `looking-at' with point at the beginning of the current line; if it matches, abbrev mode will be turned on, otherwise diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index cce2fcb104d..ca4ff67a6ac 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -50,7 +50,7 @@ When t this still needs to be initialized.") (defvar mail-address-field-regexp - "^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\):") + "^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\|X-Debbugs-Cc\\):") ;; `pattern' is bound dynamically before evaluating the forms in ;; `mail-complete-alist' and may be part of user customizations of @@ -61,7 +61,7 @@ When t this still needs to be initialized.") (defcustom mail-complete-alist ;; Don't refer to mail-address-field-regexp here; ;; that confuses some things such as cus-dep.el. - '(("^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\):" + '(("^\\(Resent-\\)?\\(To\\|From\\|Cc\\|Bcc\\|Reply-To\\|X-Debbugs-Cc\\):" . (mail-get-names pattern)) ("Newsgroups:" . (if (boundp 'gnus-active-hashtb) gnus-active-hashtb From aaaafddc945bbd046d675ea50f221edb02c8988b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 5 Oct 2024 00:45:54 +0200 Subject: [PATCH 32/50] Normalize "Commentary" section in eudc.el * lisp/net/eudc.el: Normalize "Commentary" section to make 'M-x describe-package RET eudc RET' more useful. --- lisp/net/eudc.el | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el index da8955d52c9..9e640768285 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el @@ -23,25 +23,27 @@ ;; along with GNU Emacs. If not, see . ;;; Commentary: -;; This package provides a common interface to query directory servers using -;; different protocols such as LDAP, CCSO PH/QI or BBDB. Queries can be -;; made through an interactive form or inline. Inline query strings in -;; buffers are expanded with appropriately formatted query results -;; (especially used to expand email addresses in message buffers). EUDC -;; also interfaces with the BBDB package to let you register query results -;; into your own BBDB database. -;;; Usage: -;; EUDC comes with an extensive documentation, please refer to it. +;; This package provides a common interface to query directory servers using +;; different protocols such as LDAP, CCSO PH/QI or BBDB. Queries can be +;; made through an interactive form or inline. Inline query strings in +;; buffers are expanded with appropriately formatted query results +;; (especially used to expand email addresses in message buffers). EUDC +;; also interfaces with the BBDB package to let you register query results +;; into your own BBDB database. ;; -;; The main entry points of EUDC are: -;; `eudc-query-form': Query a directory server from a query form -;; `eudc-expand-inline': Query a directory server for the e-mail address -;; of the name before cursor and insert it in the -;; buffer -;; `eudc-get-phone': Get a phone number from a directory server -;; `eudc-get-email': Get an e-mail address from a directory server -;; `eudc-customize': Customize various aspects of EUDC +;; Usage: +;; +;; EUDC comes with extensive documentation, please refer to it. +;; +;; The main entry points of EUDC are: +;; `eudc-query-form': Query a directory server from a query form +;; `eudc-expand-inline': Query a directory server for the e-mail address +;; of the name before cursor and insert it in the +;; buffer +;; `eudc-get-phone': Get a phone number from a directory server +;; `eudc-get-email': Get an e-mail address from a directory server +;; `eudc-customize': Customize various aspects of EUDC ;;; Code: From 6b1271b169a8c5d46eace65fb9348d6110527cf3 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 5 Oct 2024 01:58:46 +0200 Subject: [PATCH 33/50] Fix python-ts-mode-map docstring * lisp/progmodes/python.el (python-ts-mode-map): Fix docstring. --- lisp/progmodes/python.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9d87d6cb6a5..0001bdd21a9 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -408,7 +408,7 @@ To customize the Python interpreter for interactive use, modify "Keymap for `python-mode'.") (defvar python-ts-mode-map (copy-keymap python-mode-map) - "Keymap for `(copy-keymap python-mode-map)'.") + "Keymap for `python-ts-mode'.") ;;; Python specialized rx From 5a462948e13393fc742e36b655c529f3c5e851bb Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 5 Oct 2024 02:24:30 +0200 Subject: [PATCH 34/50] Update Arni Magnusson's email address * .mailmap: * doc/lispref/ChangeLog.1: * doc/misc/ChangeLog.1: * lisp/ChangeLog.16: * lisp/ChangeLog.17: * lisp/progmodes/bat-mode.el: Update email address of Arni Magnusson. (Bug#73631) --- .mailmap | 1 + doc/lispref/ChangeLog.1 | 2 +- doc/misc/ChangeLog.1 | 2 +- lisp/ChangeLog.16 | 2 +- lisp/ChangeLog.17 | 4 ++-- lisp/progmodes/bat-mode.el | 4 ++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.mailmap b/.mailmap index 9647749940f..bbfe4bceba1 100644 --- a/.mailmap +++ b/.mailmap @@ -26,6 +26,7 @@ Andrew G Cohen Andrew G Cohen Arash Esbati Arash Esbati +Arni Magnusson Artur Malabarba Artur Malabarba Artur Malabarba Basil L. Contovounesios diff --git a/doc/lispref/ChangeLog.1 b/doc/lispref/ChangeLog.1 index e2d4c019b4a..a508ad9f28b 100644 --- a/doc/lispref/ChangeLog.1 +++ b/doc/lispref/ChangeLog.1 @@ -5551,7 +5551,7 @@ * loading.texi (Hooks for Loading): Document after-load-functions. Copyedits. -2010-03-24 Arni Magnusson (tiny change) +2010-03-24 Arni Magnusson (tiny change) * frames.texi (Cursor Parameters): Fix typo. (Bug#5760) diff --git a/doc/misc/ChangeLog.1 b/doc/misc/ChangeLog.1 index 37b304c2dca..14570bb174f 100644 --- a/doc/misc/ChangeLog.1 +++ b/doc/misc/ChangeLog.1 @@ -6407,7 +6407,7 @@ * epa.texi (Mail-mode integration): Mention the way to do "encrypt-to-self". (Bug#1807) -2009-02-05 Arni Magnusson (tiny change) +2009-02-05 Arni Magnusson (tiny change) * ada-mode.texi (No project files): Fix typo. (Bug#2214) diff --git a/lisp/ChangeLog.16 b/lisp/ChangeLog.16 index fa956ac8784..6d807fbd44d 100644 --- a/lisp/ChangeLog.16 +++ b/lisp/ChangeLog.16 @@ -25198,7 +25198,7 @@ * emacs-lisp/package-x.el (package-upload-buffer-internal): Use `equal' for upload base check. -2011-03-08 Arni Magnusson (tiny change) +2011-03-08 Arni Magnusson (tiny change) * textmodes/texinfo.el (texinfo-environments): Add deftypecv, deftypeivar, deftypemethod, deftypeop, html. (Bug#2783) diff --git a/lisp/ChangeLog.17 b/lisp/ChangeLog.17 index 3eec2da2038..e6c35f63a20 100644 --- a/lisp/ChangeLog.17 +++ b/lisp/ChangeLog.17 @@ -6706,7 +6706,7 @@ 2014-10-12 Stefan Monnier * progmodes/bat-mode.el (bat-font-lock-keywords): Fix \\<_ typo - (bug#18622). Reported by Arni Magnusson . + (bug#18622). Reported by Arni Magnusson . * progmodes/prolog.el (prolog-electric--underscore): Same. 2014-10-12 Michael Albinus @@ -20214,7 +20214,7 @@ (dos-mode-syntax-table): Don't use "w" for symbol chars. (dos-font-lock-keywords): Try to adjust font-lock rules accordingly. -2013-08-07 Arni Magnusson +2013-08-07 Arni Magnusson * progmodes/dos.el: New file. * generic-x.el (bat-generic-mode): Redefine as an obsolete alias to diff --git a/lisp/progmodes/bat-mode.el b/lisp/progmodes/bat-mode.el index 0687a0c9f32..613de34eb7e 100644 --- a/lisp/progmodes/bat-mode.el +++ b/lisp/progmodes/bat-mode.el @@ -1,8 +1,8 @@ ;;; bat-mode.el --- Major mode for editing DOS/Windows scripts -*- lexical-binding: t -*- -;; Copyright (C) 2003, 2008-2024 Free Software Foundation, Inc. +;; Copyright (C) 2003-2024 Free Software Foundation, Inc. -;; Author: Arni Magnusson +;; Author: Arni Magnusson ;; Keywords: languages ;; This file is part of GNU Emacs. From ba44fc9a447be75eff304f606e0cc9ea7ba7656a Mon Sep 17 00:00:00 2001 From: Morgan Willcock Date: Tue, 24 Sep 2024 19:33:11 +0100 Subject: [PATCH 35/50] Restore comment/string check for 'electric-layout-mode' This reverts an accidental change which allowed 'electric-layout-mode' to insert newlines inside strings and comments. The new behavior can be obtained by setting the new variable 'electric-layout-allow-in-comment-or-string' to a non-nil value. * lisp/electric.el (electric-layout-allow-in-comment-or-string): New variable to determine whether inserting newlines is permitted within comments or strings. (electric-layout-post-self-insert-function-1): Restore the previous default behavior of not inserting newlines within comments or strings. --- lisp/electric.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/electric.el b/lisp/electric.el index d02bcb4735b..d84faf5433f 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -385,6 +385,9 @@ If multiple rules match, only first one is executed.") (defvar electric-layout-allow-duplicate-newlines nil "If non-nil, allow duplication of `before' newlines.") +(defvar electric-layout-allow-in-comment-or-string nil + "If non-nil, allow inserting newlines inside a comment or string.") + (defun electric-layout-post-self-insert-function () (when electric-layout-mode (electric-layout-post-self-insert-function-1))) @@ -409,7 +412,10 @@ If multiple rules match, only first one is executed.") (goto-char pos) (funcall probe last-command-event)))) (when res (throw 'done res)))))))))) - (when rule + (when (and rule + (or electric-layout-allow-in-comment-or-string + ;; Not in a comment or string. + (not (nth 8 (save-excursion (syntax-ppss pos)))))) (goto-char pos) (when (functionp rule) (setq rule (funcall rule))) (dolist (sym (if (symbolp rule) (list rule) rule)) From 688201ef18df468dc8c7e8eb2ce6a96a9c625517 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Oct 2024 13:30:30 +0300 Subject: [PATCH 36/50] ; * lisp/window.el (switch-to-prev-buffer-skip-regexp): Doc fix (bug#73545). --- lisp/window.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/window.el b/lisp/window.el index 50fb16b3204..01010072190 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4617,7 +4617,8 @@ Also see `switch-to-prev-buffer-skip-regexp'." "Buffers that `switch-to-prev-buffer' and `switch-to-next-buffer' should skip. The value can either be a regexp or a list of regexps. Buffers whose names match these regexps are skipped by `switch-to-prev-buffer' -and `switch-to-next-buffer'. +and `switch-to-next-buffer', unless there's no other buffer to +switch to. Also see `switch-to-prev-buffer-skip'." :type '(choice regexp From b68b9f291cc52f6120858534ff450fa7f6381d0b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Oct 2024 14:38:48 +0300 Subject: [PATCH 37/50] ; * lisp/progmodes/csharp-mode.el (treesit-query-compile): Declare. --- lisp/progmodes/csharp-mode.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 755303a158d..1f86527191a 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -46,6 +46,7 @@ (declare-function treesit-node-type "treesit.c") (declare-function treesit-node-child-by-field-name "treesit.c") (declare-function treesit-query-capture "treesit.c") +(declare-function treesit-query-compile "treesit.c") (defgroup csharp nil "Major mode for editing C# code." From 2d4d6dc43a417b873024d1bee93036d3749f59af Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 6 Oct 2024 01:47:50 +0200 Subject: [PATCH 38/50] Delete XIE X extension from TODO According to Wikipedia, XIE "is no longer included in the X11 reference distribution, having been removed with X11R6.7 in 2004." Ref: https://en.wikipedia.org/wiki/X_Image_Extension * etc/TODO: Delete item to use XIE X extension. --- etc/TODO | 3 --- 1 file changed, 3 deletions(-) diff --git a/etc/TODO b/etc/TODO index 87ca19f37f2..21c85216964 100644 --- a/etc/TODO +++ b/etc/TODO @@ -788,9 +788,6 @@ to ASCII. *** Provide a user friendly interface to specify fonts -** Use the XIE X extension, if available, for image display -This is obsolete, as XIE itself is now considered obsolete. - ** Make monochrome images honor the face Display those images using the foreground and background colors of the applicable faces. From 37a6c859b04ef9f88c3f9751027d544100cf1d2c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 6 Oct 2024 13:38:57 +0800 Subject: [PATCH 39/50] ; * lisp/emacs-lisp/cl-macs.el (cl-once-only): Fix capitalisation. --- lisp/emacs-lisp/cl-macs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 2e501005bf7..b37f744b175 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2505,7 +2505,7 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...). (defmacro cl-once-only (names &rest body) "Generate code to evaluate each of NAMES just once in BODY. -This macro helps with writing other macros. Each of names is +This macro helps with writing other macros. Each of NAMES is either (NAME FORM) or NAME, which latter means (NAME NAME). During macroexpansion, each NAME is bound to an uninterned symbol. The expansion evaluates each FORM and binds it to the From ed57faafc74e0810b492841deccb3cdc77a258ff Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 7 Oct 2024 17:24:32 -0700 Subject: [PATCH 40/50] Set treesit-primary-parser for tree-sitter modes I debated whether to do this, since technically speaking it's not needed for single-language modes. But ultimately it's better to be explicit and set a good example with builtin modes. * lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode): * lisp/progmodes/csharp-mode.el (csharp-ts-mode): * lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode): * lisp/progmodes/go-ts-mode.el (go-ts-mode): (go-mod-ts-mode): * lisp/progmodes/heex-ts-mode.el (heex-ts-mode): * lisp/progmodes/java-ts-mode.el (java-ts-mode): * lisp/progmodes/json-ts-mode.el (json-ts-mode): * lisp/progmodes/lua-ts-mode.el (lua-ts-mode): * lisp/progmodes/python.el (python-ts-mode): * lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): * lisp/progmodes/rust-ts-mode.el (rust-ts-mode): * lisp/progmodes/sh-script.el: * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode): (tsx-ts-mode): * lisp/textmodes/css-mode.el (css-ts-mode): * lisp/textmodes/html-ts-mode.el (html-ts-mode): * lisp/textmodes/toml-ts-mode.el (toml-ts-mode): * lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode): Set treesit-primary-parser. --- lisp/progmodes/cmake-ts-mode.el | 2 +- lisp/progmodes/csharp-mode.el | 2 +- lisp/progmodes/dockerfile-ts-mode.el | 2 +- lisp/progmodes/go-ts-mode.el | 4 ++-- lisp/progmodes/heex-ts-mode.el | 2 +- lisp/progmodes/java-ts-mode.el | 2 +- lisp/progmodes/json-ts-mode.el | 2 +- lisp/progmodes/lua-ts-mode.el | 2 +- lisp/progmodes/python.el | 2 +- lisp/progmodes/ruby-ts-mode.el | 2 +- lisp/progmodes/rust-ts-mode.el | 2 +- lisp/progmodes/sh-script.el | 2 +- lisp/progmodes/typescript-ts-mode.el | 4 ++-- lisp/textmodes/css-mode.el | 2 +- lisp/textmodes/html-ts-mode.el | 2 +- lisp/textmodes/toml-ts-mode.el | 2 +- lisp/textmodes/yaml-ts-mode.el | 2 +- 17 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lisp/progmodes/cmake-ts-mode.el b/lisp/progmodes/cmake-ts-mode.el index 854adf4ade7..597ef69d9b8 100644 --- a/lisp/progmodes/cmake-ts-mode.el +++ b/lisp/progmodes/cmake-ts-mode.el @@ -208,7 +208,7 @@ Return nil if there is no name or if NODE is not a defun node." :syntax-table cmake-ts-mode--syntax-table (when (treesit-ready-p 'cmake) - (treesit-parser-create 'cmake) + (setq treesit-primary-parser (treesit-parser-create 'cmake)) ;; Comments. (setq-local comment-start "# ") diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 1f86527191a..b86555b1d87 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -1049,7 +1049,7 @@ Key bindings: (error "Tree-sitter for C# isn't available")) ;; Tree-sitter. - (treesit-parser-create 'c-sharp) + (setq treesit-primary-parser (treesit-parser-create 'c-sharp)) ;; Comments. (c-ts-common-comment-setup) diff --git a/lisp/progmodes/dockerfile-ts-mode.el b/lisp/progmodes/dockerfile-ts-mode.el index e31fd86bbdf..42fa7482a87 100644 --- a/lisp/progmodes/dockerfile-ts-mode.el +++ b/lisp/progmodes/dockerfile-ts-mode.el @@ -133,7 +133,7 @@ Return nil if there is no name or if NODE is not a stage node." :syntax-table dockerfile-ts-mode--syntax-table (when (treesit-ready-p 'dockerfile) - (treesit-parser-create 'dockerfile) + (setq treesit-primary-parser (treesit-parser-create 'dockerfile)) ;; Comments. (setq-local comment-start "# ") diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 2d3e6aac090..899f7852c2b 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -253,7 +253,7 @@ :syntax-table go-ts-mode--syntax-table (when (treesit-ready-p 'go) - (treesit-parser-create 'go) + (setq treesit-primary-parser (treesit-parser-create 'go)) ;; Comments. (setq-local comment-start "// ") @@ -453,7 +453,7 @@ what the parent of the node would be if it were a node." :syntax-table go-mod-ts-mode--syntax-table (when (treesit-ready-p 'gomod) - (treesit-parser-create 'gomod) + (setq treesit-primary-parser (treesit-parser-create 'gomod)) ;; Comments. (setq-local comment-start "// ") diff --git a/lisp/progmodes/heex-ts-mode.el b/lisp/progmodes/heex-ts-mode.el index b527d96b579..84fd513525c 100644 --- a/lisp/progmodes/heex-ts-mode.el +++ b/lisp/progmodes/heex-ts-mode.el @@ -148,7 +148,7 @@ With ARG, do it many times. Negative ARG means move backward." :group 'heex-ts (when (treesit-ready-p 'heex) - (treesit-parser-create 'heex) + (setq treesit-primary-parser (treesit-parser-create 'heex)) ;; Comments (setq-local treesit-thing-settings diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 4ceb211ade1..6c7c5a30ab8 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -326,7 +326,7 @@ Return nil if there is no name or if NODE is not a defun node." (unless (treesit-ready-p 'java) (error "Tree-sitter for Java isn't available")) - (treesit-parser-create 'java) + (setq treesit-primary-parser (treesit-parser-create 'java)) ;; Comments. (c-ts-common-comment-setup) diff --git a/lisp/progmodes/json-ts-mode.el b/lisp/progmodes/json-ts-mode.el index 1fb96555010..7409c6be833 100644 --- a/lisp/progmodes/json-ts-mode.el +++ b/lisp/progmodes/json-ts-mode.el @@ -128,7 +128,7 @@ Return nil if there is no name or if NODE is not a defun node." (unless (treesit-ready-p 'json) (error "Tree-sitter for JSON isn't available")) - (treesit-parser-create 'json) + (setq treesit-primary-parser (treesit-parser-create 'json)) ;; Comments. (setq-local comment-start "// ") diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 4ea453c9b65..aea5e1e6116 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -752,7 +752,7 @@ Calls REPORT-FN directly." (use-local-map lua-ts-mode-map) (when (treesit-ready-p 'lua) - (treesit-parser-create 'lua) + (setq treesit-primary-parser (treesit-parser-create 'lua)) ;; Comments. (setq-local comment-start "--") diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0001bdd21a9..e4b9fe2367d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -7147,7 +7147,7 @@ implementations: `python-mode' and `python-ts-mode'." \\{python-ts-mode-map}" :syntax-table python-mode-syntax-table (when (treesit-ready-p 'python) - (treesit-parser-create 'python) + (setq treesit-primary-parser (treesit-parser-create 'python)) (setq-local treesit-font-lock-feature-list '(( comment definition) ( keyword string type) diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index adcdf15c7ad..aff0b8911b9 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -1127,7 +1127,7 @@ leading double colon is not added." (unless (treesit-ready-p 'ruby) (error "Tree-sitter for Ruby isn't available")) - (treesit-parser-create 'ruby) + (setq treesit-primary-parser (treesit-parser-create 'ruby)) (setq-local add-log-current-defun-function #'ruby-ts-add-log-current-function) diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index 571ffa9b220..038955d1ae0 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -507,7 +507,7 @@ See `prettify-symbols-compose-predicate'." :syntax-table rust-ts-mode--syntax-table (when (treesit-ready-p 'rust) - (treesit-parser-create 'rust) + (setq treesit-primary-parser (treesit-parser-create 'rust)) ;; Syntax. (setq-local syntax-propertize-function diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index a348e9ba6fd..8ba64100203 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1623,7 +1623,7 @@ not written in Bash or sh." (add-hook 'flymake-diagnostic-functions #'sh-shellcheck-flymake nil t) (add-hook 'hack-local-variables-hook #'sh-after-hack-local-variables nil t) - (treesit-parser-create 'bash) + (setq treesit-primary-parser (treesit-parser-create 'bash)) (setq-local treesit-font-lock-feature-list '(( comment function) ( command declaration-command keyword string) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 3606a139d50..4860eaf3a34 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -502,7 +502,7 @@ This mode is intended to be inherited by concrete major modes." :syntax-table typescript-ts-mode--syntax-table (when (treesit-ready-p 'typescript) - (treesit-parser-create 'typescript) + (setq treesit-primary-parser (treesit-parser-create 'typescript)) ;; Indent. (setq-local treesit-simple-indent-rules @@ -540,7 +540,7 @@ at least 3 (which is the default value)." :syntax-table typescript-ts-mode--syntax-table (when (treesit-ready-p 'tsx) - (treesit-parser-create 'tsx) + (setq treesit-primary-parser (treesit-parser-create 'tsx)) ;; Comments. (setq-local comment-start "// ") diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index f5a20e0ca0e..c8da28187ee 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1814,7 +1814,7 @@ can also be used to fill comments. (setq-local font-lock-fontify-region-function #'css--fontify-region) ;; Tree-sitter specific setup. - (treesit-parser-create 'css) + (setq treesit-primary-parser (treesit-parser-create 'css)) (setq-local treesit-simple-indent-rules css--treesit-indent-rules) (setq-local treesit-defun-type-regexp "rule_set") (setq-local treesit-defun-name-function #'css--treesit-defun-name) diff --git a/lisp/textmodes/html-ts-mode.el b/lisp/textmodes/html-ts-mode.el index 235e1055fa9..f78fbdde1da 100644 --- a/lisp/textmodes/html-ts-mode.el +++ b/lisp/textmodes/html-ts-mode.el @@ -92,7 +92,7 @@ Return nil if there is no name or if NODE is not a defun node." (unless (treesit-ready-p 'html) (error "Tree-sitter for HTML isn't available")) - (treesit-parser-create 'html) + (setq treesit-primary-parser (treesit-parser-create 'html)) ;; Indent. (setq-local treesit-simple-indent-rules html-ts-mode--indent-rules) diff --git a/lisp/textmodes/toml-ts-mode.el b/lisp/textmodes/toml-ts-mode.el index 3c4533a7fea..806f045c23b 100644 --- a/lisp/textmodes/toml-ts-mode.el +++ b/lisp/textmodes/toml-ts-mode.el @@ -124,7 +124,7 @@ Return nil if there is no name or if NODE is not a defun node." :syntax-table toml-ts-mode--syntax-table (when (treesit-ready-p 'toml) - (treesit-parser-create 'toml) + (setq treesit-primary-parser (treesit-parser-create 'toml)) ;; Comments (setq-local comment-start "# ") diff --git a/lisp/textmodes/yaml-ts-mode.el b/lisp/textmodes/yaml-ts-mode.el index 210835585fe..42d7c2e1798 100644 --- a/lisp/textmodes/yaml-ts-mode.el +++ b/lisp/textmodes/yaml-ts-mode.el @@ -148,7 +148,7 @@ boundaries. JUSTIFY is passed to `fill-paragraph'." :syntax-table yaml-ts-mode--syntax-table (when (treesit-ready-p 'yaml) - (treesit-parser-create 'yaml) + (setq treesit-primary-parser (treesit-parser-create 'yaml)) ;; Comments. (setq-local comment-start "# ") From 52746ceb62592fba6d58595b7bc3199058f30185 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 7 Oct 2024 17:27:13 -0700 Subject: [PATCH 41/50] Remove duplicate indent rules in elixir-ts-mode * lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode): There are two forms adding heex-ts--indent-rules, remove one of them. --- lisp/progmodes/elixir-ts-mode.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index a3e11658468..cacdb266298 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -734,9 +734,6 @@ Return nil if NODE is not a defun node or doesn't have a name." (when (treesit-ready-p 'heex) (setq-local treesit-range-settings elixir-ts--treesit-range-rules) - (setq-local treesit-simple-indent-rules - (append treesit-simple-indent-rules heex-ts--indent-rules)) - (setq-local treesit-font-lock-settings (append treesit-font-lock-settings heex-ts--font-lock-settings)) From 1ea0d9b891bf7abadd291aeb715c51c4cc496dba Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Tue, 8 Oct 2024 17:33:11 -0700 Subject: [PATCH 42/50] Revert "Set treesit-primary-parser for tree-sitter modes" This reverts commit ed57faafc74e0810b492841deccb3cdc77a258ff. --- lisp/progmodes/cmake-ts-mode.el | 2 +- lisp/progmodes/csharp-mode.el | 2 +- lisp/progmodes/dockerfile-ts-mode.el | 2 +- lisp/progmodes/go-ts-mode.el | 4 ++-- lisp/progmodes/heex-ts-mode.el | 2 +- lisp/progmodes/java-ts-mode.el | 2 +- lisp/progmodes/json-ts-mode.el | 2 +- lisp/progmodes/lua-ts-mode.el | 2 +- lisp/progmodes/python.el | 2 +- lisp/progmodes/ruby-ts-mode.el | 2 +- lisp/progmodes/rust-ts-mode.el | 2 +- lisp/progmodes/sh-script.el | 2 +- lisp/progmodes/typescript-ts-mode.el | 4 ++-- lisp/textmodes/css-mode.el | 2 +- lisp/textmodes/html-ts-mode.el | 2 +- lisp/textmodes/toml-ts-mode.el | 2 +- lisp/textmodes/yaml-ts-mode.el | 2 +- 17 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lisp/progmodes/cmake-ts-mode.el b/lisp/progmodes/cmake-ts-mode.el index 597ef69d9b8..854adf4ade7 100644 --- a/lisp/progmodes/cmake-ts-mode.el +++ b/lisp/progmodes/cmake-ts-mode.el @@ -208,7 +208,7 @@ Return nil if there is no name or if NODE is not a defun node." :syntax-table cmake-ts-mode--syntax-table (when (treesit-ready-p 'cmake) - (setq treesit-primary-parser (treesit-parser-create 'cmake)) + (treesit-parser-create 'cmake) ;; Comments. (setq-local comment-start "# ") diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index b86555b1d87..1f86527191a 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -1049,7 +1049,7 @@ Key bindings: (error "Tree-sitter for C# isn't available")) ;; Tree-sitter. - (setq treesit-primary-parser (treesit-parser-create 'c-sharp)) + (treesit-parser-create 'c-sharp) ;; Comments. (c-ts-common-comment-setup) diff --git a/lisp/progmodes/dockerfile-ts-mode.el b/lisp/progmodes/dockerfile-ts-mode.el index 42fa7482a87..e31fd86bbdf 100644 --- a/lisp/progmodes/dockerfile-ts-mode.el +++ b/lisp/progmodes/dockerfile-ts-mode.el @@ -133,7 +133,7 @@ Return nil if there is no name or if NODE is not a stage node." :syntax-table dockerfile-ts-mode--syntax-table (when (treesit-ready-p 'dockerfile) - (setq treesit-primary-parser (treesit-parser-create 'dockerfile)) + (treesit-parser-create 'dockerfile) ;; Comments. (setq-local comment-start "# ") diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 899f7852c2b..2d3e6aac090 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -253,7 +253,7 @@ :syntax-table go-ts-mode--syntax-table (when (treesit-ready-p 'go) - (setq treesit-primary-parser (treesit-parser-create 'go)) + (treesit-parser-create 'go) ;; Comments. (setq-local comment-start "// ") @@ -453,7 +453,7 @@ what the parent of the node would be if it were a node." :syntax-table go-mod-ts-mode--syntax-table (when (treesit-ready-p 'gomod) - (setq treesit-primary-parser (treesit-parser-create 'gomod)) + (treesit-parser-create 'gomod) ;; Comments. (setq-local comment-start "// ") diff --git a/lisp/progmodes/heex-ts-mode.el b/lisp/progmodes/heex-ts-mode.el index 84fd513525c..b527d96b579 100644 --- a/lisp/progmodes/heex-ts-mode.el +++ b/lisp/progmodes/heex-ts-mode.el @@ -148,7 +148,7 @@ With ARG, do it many times. Negative ARG means move backward." :group 'heex-ts (when (treesit-ready-p 'heex) - (setq treesit-primary-parser (treesit-parser-create 'heex)) + (treesit-parser-create 'heex) ;; Comments (setq-local treesit-thing-settings diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 6c7c5a30ab8..4ceb211ade1 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -326,7 +326,7 @@ Return nil if there is no name or if NODE is not a defun node." (unless (treesit-ready-p 'java) (error "Tree-sitter for Java isn't available")) - (setq treesit-primary-parser (treesit-parser-create 'java)) + (treesit-parser-create 'java) ;; Comments. (c-ts-common-comment-setup) diff --git a/lisp/progmodes/json-ts-mode.el b/lisp/progmodes/json-ts-mode.el index 7409c6be833..1fb96555010 100644 --- a/lisp/progmodes/json-ts-mode.el +++ b/lisp/progmodes/json-ts-mode.el @@ -128,7 +128,7 @@ Return nil if there is no name or if NODE is not a defun node." (unless (treesit-ready-p 'json) (error "Tree-sitter for JSON isn't available")) - (setq treesit-primary-parser (treesit-parser-create 'json)) + (treesit-parser-create 'json) ;; Comments. (setq-local comment-start "// ") diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index aea5e1e6116..4ea453c9b65 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -752,7 +752,7 @@ Calls REPORT-FN directly." (use-local-map lua-ts-mode-map) (when (treesit-ready-p 'lua) - (setq treesit-primary-parser (treesit-parser-create 'lua)) + (treesit-parser-create 'lua) ;; Comments. (setq-local comment-start "--") diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index e4b9fe2367d..0001bdd21a9 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -7147,7 +7147,7 @@ implementations: `python-mode' and `python-ts-mode'." \\{python-ts-mode-map}" :syntax-table python-mode-syntax-table (when (treesit-ready-p 'python) - (setq treesit-primary-parser (treesit-parser-create 'python)) + (treesit-parser-create 'python) (setq-local treesit-font-lock-feature-list '(( comment definition) ( keyword string type) diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index aff0b8911b9..adcdf15c7ad 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -1127,7 +1127,7 @@ leading double colon is not added." (unless (treesit-ready-p 'ruby) (error "Tree-sitter for Ruby isn't available")) - (setq treesit-primary-parser (treesit-parser-create 'ruby)) + (treesit-parser-create 'ruby) (setq-local add-log-current-defun-function #'ruby-ts-add-log-current-function) diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index 038955d1ae0..571ffa9b220 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -507,7 +507,7 @@ See `prettify-symbols-compose-predicate'." :syntax-table rust-ts-mode--syntax-table (when (treesit-ready-p 'rust) - (setq treesit-primary-parser (treesit-parser-create 'rust)) + (treesit-parser-create 'rust) ;; Syntax. (setq-local syntax-propertize-function diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 8ba64100203..a348e9ba6fd 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1623,7 +1623,7 @@ not written in Bash or sh." (add-hook 'flymake-diagnostic-functions #'sh-shellcheck-flymake nil t) (add-hook 'hack-local-variables-hook #'sh-after-hack-local-variables nil t) - (setq treesit-primary-parser (treesit-parser-create 'bash)) + (treesit-parser-create 'bash) (setq-local treesit-font-lock-feature-list '(( comment function) ( command declaration-command keyword string) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 4860eaf3a34..3606a139d50 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -502,7 +502,7 @@ This mode is intended to be inherited by concrete major modes." :syntax-table typescript-ts-mode--syntax-table (when (treesit-ready-p 'typescript) - (setq treesit-primary-parser (treesit-parser-create 'typescript)) + (treesit-parser-create 'typescript) ;; Indent. (setq-local treesit-simple-indent-rules @@ -540,7 +540,7 @@ at least 3 (which is the default value)." :syntax-table typescript-ts-mode--syntax-table (when (treesit-ready-p 'tsx) - (setq treesit-primary-parser (treesit-parser-create 'tsx)) + (treesit-parser-create 'tsx) ;; Comments. (setq-local comment-start "// ") diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index c8da28187ee..f5a20e0ca0e 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1814,7 +1814,7 @@ can also be used to fill comments. (setq-local font-lock-fontify-region-function #'css--fontify-region) ;; Tree-sitter specific setup. - (setq treesit-primary-parser (treesit-parser-create 'css)) + (treesit-parser-create 'css) (setq-local treesit-simple-indent-rules css--treesit-indent-rules) (setq-local treesit-defun-type-regexp "rule_set") (setq-local treesit-defun-name-function #'css--treesit-defun-name) diff --git a/lisp/textmodes/html-ts-mode.el b/lisp/textmodes/html-ts-mode.el index f78fbdde1da..235e1055fa9 100644 --- a/lisp/textmodes/html-ts-mode.el +++ b/lisp/textmodes/html-ts-mode.el @@ -92,7 +92,7 @@ Return nil if there is no name or if NODE is not a defun node." (unless (treesit-ready-p 'html) (error "Tree-sitter for HTML isn't available")) - (setq treesit-primary-parser (treesit-parser-create 'html)) + (treesit-parser-create 'html) ;; Indent. (setq-local treesit-simple-indent-rules html-ts-mode--indent-rules) diff --git a/lisp/textmodes/toml-ts-mode.el b/lisp/textmodes/toml-ts-mode.el index 806f045c23b..3c4533a7fea 100644 --- a/lisp/textmodes/toml-ts-mode.el +++ b/lisp/textmodes/toml-ts-mode.el @@ -124,7 +124,7 @@ Return nil if there is no name or if NODE is not a defun node." :syntax-table toml-ts-mode--syntax-table (when (treesit-ready-p 'toml) - (setq treesit-primary-parser (treesit-parser-create 'toml)) + (treesit-parser-create 'toml) ;; Comments (setq-local comment-start "# ") diff --git a/lisp/textmodes/yaml-ts-mode.el b/lisp/textmodes/yaml-ts-mode.el index 42d7c2e1798..210835585fe 100644 --- a/lisp/textmodes/yaml-ts-mode.el +++ b/lisp/textmodes/yaml-ts-mode.el @@ -148,7 +148,7 @@ boundaries. JUSTIFY is passed to `fill-paragraph'." :syntax-table yaml-ts-mode--syntax-table (when (treesit-ready-p 'yaml) - (setq treesit-primary-parser (treesit-parser-create 'yaml)) + (treesit-parser-create 'yaml) ;; Comments. (setq-local comment-start "# ") From cd36e070c24d7828ea1b9bf62ffa920068ac4d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Wed, 9 Oct 2024 06:26:27 -0500 Subject: [PATCH 43/50] Eglot: minor changes to doc and docstrings * doc/misc/eglot.texi (Quick Start): Tweak. (Setting Up LSP Servers): Tweak. (Customizing Eglot): Clarify eglot-connect-hook and eglot-initialized-hook. * lisp/progmodes/eglot.el (eglot-connect-hook) (eglot-server-initialized-hook): Rework docstring. --- doc/misc/eglot.texi | 28 +++++++++++++++++----------- lisp/progmodes/eglot.el | 9 ++++++--- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index fb5b618bd84..959bbfa6857 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -123,14 +123,16 @@ Here's how to start using Eglot with your programming project: @item Select and install a language server. -Eglot comes pre-configured with many popular language servers, see the -value of @code{eglot-server-programs}. If the server(s) mentioned -there satisfy your needs for the programming language(s) with which -you want to use Eglot, you just need to make sure those servers are -installed on your system. Alternatively, install one or more servers -of your choice and add them to the value of +Eglot comes pre-configured for many popular language servers, see the +value of @code{eglot-server-programs}. If the server(s) mentioned there +satisfy your needs for the programming language(s) with which you want +to use Eglot, you just need to make sure those servers are installed on +your system and Eglot can find them. + +Alternatively, install one or more servers of your choice and tell Eglot +where to find them. To do that, you may add to the value of @code{eglot-server-programs}, as described in @ref{Setting Up LSP -Servers}. +Servers} or have Eglot prompt you about it (@pxref{Eglot Commands}). @item Turn on Eglot for your project. @@ -197,7 +199,7 @@ particular server(s) you want to install. To use a language server, Eglot must know how to start it and which programming languages each server supports. This information is -provided by the variable @code{eglot-server-programs}. +commonly provided by the variable @code{eglot-server-programs}. @defvar eglot-server-programs This variable associates major modes with names and command-line @@ -939,12 +941,16 @@ to @w{@code{(disallow-non-standard-keys enforce-required-keys)}}. @vindex eglot-server-initialized-hook @item eglot-server-initialized-hook -A hook run after the server object is successfully initialized. +A hook run after the server object is successfully initialized (which +includes launching the process) but before any LSP communication is +attempted. Each function receives a @code{eglot-lsp-server} instance as +argument. @vindex eglot-connect-hook @item eglot-connect-hook -A hook run after connection to the server is successfully -established. @xref{Starting Eglot}. +A hook run after the LSP connection to the server is successfully +established. Each function receives a @code{eglot-lsp-server} instance +as argument. @xref{Starting Eglot}. @item eglot-managed-mode-hook A hook run after Eglot started or stopped managing a buffer. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 58487924883..e7a0a3ce135 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1487,18 +1487,21 @@ Use current server's or first available Eglot events buffer." (defvar eglot-connect-hook '(eglot-signal-didChangeConfiguration) - "Hook run after connecting in `eglot--connect'.") + "Hook run after connecting to a server. +Each function is passed an `eglot-lsp-server' instance +as argument.") (defvar eglot-server-initialized-hook '() "Hook run after a `eglot-lsp-server' instance is created. -That is before a connection was established. Use +That is before a connection is established. Use `eglot-connect-hook' to hook into when a connection was successfully established and the server on the other side has received the initializing configuration. -Each function is passed the server as an argument") +Each function is passed an `eglot-lsp-server' instance +as argument.") (defun eglot--cmd (contact) "Helper for `eglot--connect'." From 6a5c2edd84fc3fdb879e4a19ea182c2a4d385833 Mon Sep 17 00:00:00 2001 From: Brennan Vincent Date: Wed, 9 Oct 2024 06:30:30 -0500 Subject: [PATCH 44/50] Eglot: use :immediate t when resolving completions (bug#73279) Copyright-paperwork-exempt: Yes * lisp/progmodes/eglot.el (eglot-completion-at-point): Tweak eglot--request call. --- lisp/progmodes/eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index e7a0a3ce135..0a14146a245 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3242,7 +3242,8 @@ for which LSP on-type-formatting should be requested." :resolveProvider) (plist-get lsp-comp :data)) (eglot--request server :completionItem/resolve - lsp-comp :cancel-on-input t) + lsp-comp :cancel-on-input t + :immediate t) lsp-comp)))))) (when (and (consp eglot--capf-session) (= (car bounds) (car (nth 0 eglot--capf-session))) From f520008744b1eb71accded4108888d1f2055402e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 9 Oct 2024 16:21:08 +0300 Subject: [PATCH 45/50] Avoid segfaults in Rmail-MIME Rmail-MIME decodes text of email, including removal of CR characters, but that can segfault if the text of some MIME part is empty. * src/coding.c (decode_coding_raw_text): * lisp/mail/rmailmm.el (rmail-mime-insert-decoded-text): Don't attempt to decode empty text region. --- lisp/mail/rmailmm.el | 12 +++++++----- src/coding.c | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index a5ce5b65cd7..d86e48e6281 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -579,11 +579,13 @@ HEADER is a header component of a MIME-entity object (see (ignore-errors (base64-decode-region pos (point)))) ((string= transfer-encoding "quoted-printable") (quoted-printable-decode-region pos (point)))))) - (decode-coding-region - pos (point) - ;; Use -dos decoding, to remove ^M characters left from base64 or - ;; rogue qp-encoded text. - (coding-system-change-eol-conversion coding-system 1)) + ;; If the text is empty, we don't have anything to decode. + (and (/= pos (point)) + (decode-coding-region + pos (point) + ;; Use -dos decoding, to remove ^M characters left from base64 + ;; or rogue qp-encoded text. + (coding-system-change-eol-conversion coding-system 1))) (if (and (or (not rmail-mime-coding-system) (consp rmail-mime-coding-system)) (not (eq (coding-system-base coding-system) 'us-ascii))) diff --git a/src/coding.c b/src/coding.c index b21ed360578..5591b7fed45 100644 --- a/src/coding.c +++ b/src/coding.c @@ -5270,7 +5270,9 @@ decode_coding_raw_text (struct coding_system *coding) coding->chars_at_source = 1; coding->consumed_char = coding->src_chars; coding->consumed = coding->src_bytes; - if (eol_dos && coding->source[coding->src_bytes - 1] == '\r') + if (eol_dos + && coding->src_bytes > 0 /* empty source text? */ + && coding->source[coding->src_bytes - 1] == '\r') { coding->consumed_char--; coding->consumed--; From e49b479f8692573379a1ee3417bdda9e1f777888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Kvalsvik?= Date: Fri, 4 Oct 2024 21:38:33 +0200 Subject: [PATCH 46/50] Fix c-ts-mode indentation for initializer lists (bug#73661) The intentation behavior differed between c-mode/c++-mode and *-ts-mode for initializer lists where the first element was not at beginning-of-line. The anchor-prev-sibling function gave up and returned nil, but it should (probably) anchor on the first element in the initializer list, such as this: return { v1, v2, ..., y1, y2, ... }; c-ts-mode behaved better and figured out how to align, but I added a test for a similar compound literal to prevent regressions. * lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling): Anchor at first sibling unless bol is found. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New initializer list and compound literal test. Copyright-paperwork-exempt: yes --- lisp/progmodes/c-ts-mode.el | 9 +++-- .../progmodes/c-ts-mode-resources/indent.erts | 39 +++++++++++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index a3379ad7aab..576d715510d 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -324,10 +324,13 @@ characters of the current line." ;; If the start of the previous sibling isn't at the ;; beginning of a line, something's probably not quite ;; right, go a step further. (E.g., comment after a - ;; statement.) + ;; statement.) If the previous sibling is the first named + ;; node then anchor to that, e.g. when returning an aggregate + ;; and starting the items on the same line as {. (_ (goto-char (treesit-node-start prev-sibling)) - (if (looking-back (rx bol (* whitespace)) - (line-beginning-position)) + (if (or (looking-back (rx bol (* whitespace)) + (line-beginning-position))) + (null (treesit-node-prev-sibling prev-sibling t)) (setq continue nil) (setq prev-sibling (treesit-node-prev-sibling prev-sibling))))))) diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts index 599173832b5..a13a74cf8b3 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts @@ -208,6 +208,21 @@ int main() } =-=-= +Name: Return Compund Literal + +=-= +struct pair { int fst, snd; }; +struct pair +make_pair(int long_identifier_a[], int long_identifier_b[], + int offset_a, int offset_b) +{ + int base_offset = 10; + return (struct pair) { long_identifier_a[base_offset + offset_b], + long_identifier_b[base_offset + offset_b] }; +} + +=-=-= + Name: Switch-Case statement =-= @@ -486,6 +501,30 @@ namespace A { } =-=-= +Name: Return Aggregate Initialized Struct + +=-= +struct pair { int x, y; } +pair +make_pair(int long_identifier_a[], int long_identifier_b[], + int offset_a, int offset_b) +{ + int base_offset = 10; + return { long_identifier_a[base_offset + offset_b], + long_identifier_b[base_offset + offset_b] }; +} +=-= +struct pair { int x, y; } +pair +make_pair(int long_identifier_a[], int long_identifier_b[], + int offset_a, int offset_b) +{ + int base_offset = 10; + return { long_identifier_a[base_offset + offset_b], + long_identifier_b[base_offset + offset_b] }; +} +=-=-= + Code: (lambda () (c-ts-mode) From d664227f81aed98097520877a16c5369403a6a2d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 10 Oct 2024 11:03:48 +0300 Subject: [PATCH 47/50] ; More accurate documentation of 'file-newer-than-file-p' * doc/lispref/files.texi (File Attributes): * src/fileio.c (Ffile_newer_than_file_p): Say the comparison uses the last-modification times. (Bug#73709) --- doc/lispref/files.texi | 3 ++- src/fileio.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 70db8521481..5c63f192447 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1299,7 +1299,8 @@ and modification. This function returns @code{t} if the file @var{filename1} is newer than file @var{filename2}. If @var{filename1} does not exist, it returns @code{nil}. If @var{filename1} does exist, but -@var{filename2} does not, it returns @code{t}. +@var{filename2} does not, it returns @code{t}. Otherwise, it compares +the times of last modification of the files. In the following example, assume that the file @file{aug-19} was written on the 19th, @file{aug-20} was written on the 20th, and the file diff --git a/src/fileio.c b/src/fileio.c index 7afe3e75737..2db2760916b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3788,7 +3788,8 @@ DEFUN ("unix-sync", Funix_sync, Sunix_sync, 0, 0, "", DEFUN ("file-newer-than-file-p", Ffile_newer_than_file_p, Sfile_newer_than_file_p, 2, 2, 0, doc: /* Return t if file FILE1 is newer than file FILE2. If FILE1 does not exist, the answer is nil; -otherwise, if FILE2 does not exist, the answer is t. */) +otherwise, if FILE2 does not exist, the answer is t. +For existing files, this compares their last-modified times. */) (Lisp_Object file1, Lisp_Object file2) { struct stat st1, st2; From 6dbe4e99ac41bc1f5bcbdbda3c215941170bc9c5 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 11 Oct 2024 15:26:28 +0200 Subject: [PATCH 48/50] ; * lisp/emacs-lisp/chart.el (chart-bar-quickie): Improve documentation. --- lisp/emacs-lisp/chart.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 2ca9b64be33..b9646e93253 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -574,13 +574,11 @@ R1 and R2 are dotted pairs. Colorize it with FACE." (defun chart-bar-quickie (dir title namelst nametitle numlst numtitle &optional max sort-pred) - "Wash over the complex EIEIO stuff and create a nice bar chart. -Create it going in direction DIR [`horizontal' `vertical'] with TITLE -using a name sequence NAMELST labeled NAMETITLE with values NUMLST -labeled NUMTITLE. -Optional arguments: -Set the chart's max element display to MAX, and sort lists with -SORT-PRED if desired." + "Create a bar chart in direction DIR [`horizontal' `vertical'] named TITLE. +NAMELST is the list of bar names and NAMETITLE is the name the of axis containing +them. NUMLST is the list of values and NUMTITLE is the name of the value +axis. Optional arguments: Set the chart's max element display to MAX, and sort +lists with SORT-PRED if desired." (let ((nc (make-instance 'chart-bar :title title :key-label "8-m" ; This is a text key pic From fb155bcfb6f7dfdec3aaf9f535428d46419a6b4e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Oct 2024 08:44:28 +0300 Subject: [PATCH 49/50] ; * lisp/emacs-lisp/chart.el (chart-bar-quickie): Doc fix. --- lisp/emacs-lisp/chart.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index b9646e93253..c472d421eb0 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -574,11 +574,16 @@ R1 and R2 are dotted pairs. Colorize it with FACE." (defun chart-bar-quickie (dir title namelst nametitle numlst numtitle &optional max sort-pred) - "Create a bar chart in direction DIR [`horizontal' `vertical'] named TITLE. -NAMELST is the list of bar names and NAMETITLE is the name the of axis containing -them. NUMLST is the list of values and NUMTITLE is the name of the value -axis. Optional arguments: Set the chart's max element display to MAX, and sort -lists with SORT-PRED if desired." + "Create a bar chart named TITLE in direction DIR [`horizontal' `vertical']. +NAMELST is the list of bar names and NAMETITLE is the name the of axis +containing them. +NUMLST is the list of values and NUMTITLE is the name of the value +axis. +Optional argument MAX limits the chart's max element display to MAX by +passing it as second argument to `chart-trim', otherwise the chart's +display is unlimited. +Optional argument SORT-PRED is a predicate function passed as second +argument to `chart-sort' to sort the lists if desired." (let ((nc (make-instance 'chart-bar :title title :key-label "8-m" ; This is a text key pic From 0f8f0773183a07a229b23d3f970723ceb9585aef Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Oct 2024 10:17:10 +0300 Subject: [PATCH 50/50] ; * doc/emacs/search.texi (Word Search): Document 'dictionary-search'. --- doc/emacs/search.texi | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 3b52385347b..f23dc1fdb51 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -792,6 +792,46 @@ search engine whose @acronym{URL} is specified by the variable Wowser Manual}). If the region is not active, or doesn't contain any words, this command prompts the user for a URL or keywords to search. +@findex dictionary-search +@findex dictionary +@findex dictionary-tooltip-mode +@cindex dictionary server protocol (DICT) +@cindex word definition search +@vindex dictionary-server + You can also search for definitions of a word by querying dictionary +servers via the @sc{dict} protocol defined by @acronym{RFC} 2229. Emacs +includes a client for this protocol. Type @w{@kbd{M-x dictionary-search +@key{RET}}} to connect to a @sc{dict} server and ask it to provide the +available definitions of a word. This command prompts for the word to +look up, using the word at point as the default, then asks the @sc{dict} +server to provide the definitions of that word in one or more +dictionaries. By default, the command first tries to connect to the +@sc{dict} server installed on the local host, and if that fails, it +tries @file{dict.org} after your confirmation; customize the variable +@code{dictionary-server} to specify, as a string, the URL of a single +server to use (use @samp{localhost} if you want to query only the local +server). Normally, @code{dictionary-search} tells the server to look up +the word in all the dictionaries available to the server, but if you +invoke the command with a prefix argument, it will prompt for a single +dictionary to look. The list of dictionaries available to a server can +be displayed by pressing the @samp{Select dictionary} button shown in +the @file{*Dictionary*} buffer, described below. + + First time you use @code{dictionary-search}, it creates a new +@file{*Dictionary*} buffer and turns on a special mode in it. The +buffer shows buttons for selecting a dictionary, searching a definition +of another word, etc. Subsequent @code{dictionary-search} commands +reuse this buffer. To create another such buffer (e.g., too look up +other words, perhaps in another dictionary), type @w{@kbd{M-x dictionary +@key{RET}}}. + + If you turn on @code{dictionary-tooltip-mode} in a buffer, Emacs will +look up the definitions of the word at mouse pointer and show those +definitions in a tool tip. This is handy when you are reading text with +many words about whose meaning you are unsure. + + For other options of dictionary-search, see the @code{dictionary} +customization group (@pxref{Specific Customization}). @node Symbol Search @section Symbol Search