From 06c399914fa868474938c2d00dae96f228e70fbf Mon Sep 17 00:00:00 2001 From: skykanin <3789764+skykanin@users.noreply.github.com> Date: Sat, 16 Dec 2023 16:08:57 +0100 Subject: [PATCH 01/19] Eglot: Add Uiua language server * lisp/progmodes/eglot.el (eglot-server-programs): Add Uiua language server. (Bug#67850) Copyright-paperwork-exempt: yes --- 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 967d86955a4..02469615544 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -259,7 +259,8 @@ chosen (interactively or automatically)." '(("marksman" "server") ("vscode-markdown-language-server" "--stdio")))) (graphviz-dot-mode . ("dot-language-server" "--stdio")) - (terraform-mode . ("terraform-ls" "serve"))) + (terraform-mode . ("terraform-ls" "serve")) + ((uiua-ts-mode uiua-mode) . ("uiua" "lsp"))) "How the command `eglot' guesses the server to start. An association list of (MAJOR-MODE . CONTACT) pairs. MAJOR-MODE identifies the buffers that are to be managed by a specific From f68f3500236bb18b92e4b1a2c0c1b4ede528046e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 16 Dec 2023 21:21:33 +0200 Subject: [PATCH 02/19] Improve documentation of text properties handling when yanking * doc/lispref/text.texi (Text Properties): Mention special handling of text properties while yanking. --- doc/lispref/text.texi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 8fa2100ba11..9759d46ee69 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -2945,7 +2945,10 @@ character. Copying text between strings and buffers preserves the properties along with the characters; this includes such diverse functions as -@code{substring}, @code{insert}, and @code{buffer-substring}. +@code{substring}, @code{insert}, and @code{buffer-substring}. Killing +and then yanking text (@pxref{The Kill Ring}) also preserves the +properties, except that some properties are handled specially and +might be removed when text is yanked; @pxref{Yanking}. @menu * Examining Properties:: Looking at the properties of one character. From 67d9af1c074e0b0ad301ecca91f7bae0531076d1 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 16 Dec 2023 20:33:04 +0100 Subject: [PATCH 03/19] Fix using disabled command without a docstring * lisp/novice.el (disabled-command-function): Fix error when the disable command has no docstring. (Bug#67835) --- lisp/novice.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/novice.el b/lisp/novice.el index 05e4bfc91c9..907126ab49b 100644 --- a/lisp/novice.el +++ b/lisp/novice.el @@ -67,9 +67,10 @@ If nil, the feature is disabled, i.e., all commands work normally.") "Here's the first part of its description:\n\n") ;; Keep only the first paragraph of the documentation. (with-temp-buffer - (insert (condition-case () - (documentation cmd) - (error "<< not documented >>"))) + (insert (or (condition-case () + (documentation cmd) + (error nil)) + "<< not documented >>")) (goto-char (point-min)) (when (search-forward "\n\n" nil t) (delete-region (match-beginning 0) (point-max))) From 75cc15934123b1ffc7d801aa245259585cb8357f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 17 Dec 2023 08:09:22 +0200 Subject: [PATCH 04/19] ; * etc/PROBLEMS: Update the "GnuPG hangs" entry. --- etc/PROBLEMS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index f290b86cb8a..8f0e7864305 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -532,7 +532,9 @@ The solution is to use gawk (GNU awk). This is known to happen with GnuPG v2.4.1. The only known workaround is to downgrade to a version of GnuPG older than 2.4.1 (or, in the future, upgrade to a newer version which solves the problem, when such -a fixed version becomes available). +a fixed version becomes available). Note that GnuPG v2.2.42 and later +also has this problem, so you should also avoid those later 2.2.4x +versions; v2.2.41 is reported to work fine. *** EasyPG loopback pinentry does not work with gpgsm. From b6429b1c1c781655efc761e237a7ae0aa6a0d344 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 17 Dec 2023 09:07:11 +0200 Subject: [PATCH 05/19] ; Improve documentation of ispell.el's dictionary database * lisp/textmodes/ispell.el (ispell-dictionary-base-alist) (ispell-dictionary-alist): Doc fixes. (Bug#67857) --- lisp/textmodes/ispell.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 48d48b07937..6b048a8a805 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -522,7 +522,12 @@ re-start Emacs." "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]" "[']" nil ("-C") "~list" iso-8859-1) ("hebrew" "[\340\341\342\343\344\345\346\347\350\351\353\352\354\356\355\360\357\361\362\364\363\367\366\365\370\371\372]" "[^\340\341\342\343\344\345\346\347\350\351\353\352\354\356\355\360\357\361\362\364\363\367\366\365\370\371\372]" "" nil ("-B") nil cp1255)) - "Base value for `ispell-dictionary-alist'.") + "Base value for `ispell-dictionary-alist'. + +Note that when the speller program is \"aspell\" or \"hunspell\", +some parts of the database, notably OTHERCHARS, will be overridden +by parsing the dictionary data files, see `ispell-aspell-find-dictionary' +and `ispell-parse-hunspell-affix-file'.") (defvar ispell-dictionary-alist nil "An alist of dictionaries and their associated parameters. @@ -577,7 +582,11 @@ when the language uses non-ASCII characters. Note that with \"ispell\" as the speller, the CASECHARS and OTHERCHARS slots of the alist should contain the same character set as casechars and otherchars in the LANGUAGE.aff file \(e.g., -english.aff). Aspell and Hunspell don't have this limitation.") +english.aff). Aspell and Hunspell don't have this limitation. +Allso, when the speller program is \"aspell\" or \"hunspell\", +some parts of the database, notably OTHERCHARS, will be determined +by parsing the dictionary data files, see `ispell-aspell-find-dictionary' +and `ispell-parse-hunspell-affix-file'.") (defvar ispell-really-aspell nil "Non-nil if we can use Aspell extensions.") From 03625c2fefa682f74775abc1e223e17557d58bc7 Mon Sep 17 00:00:00 2001 From: Christophe Deleuze Date: Mon, 18 Dec 2023 11:13:30 +0100 Subject: [PATCH 06/19] Fix passive mode for tnftp client in ange-ftp.el. * lisp/net/ange-ftp.el (ange-ftp-passive-mode): Fix passive mode result string for tnftp client. (Bug#67865) Copyright-paperwork-exempt: yes --- lisp/net/ange-ftp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 4bf87c14f31..b8e8c3f0c33 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -2164,7 +2164,7 @@ Create a new process if needed." proc))) (defun ange-ftp-passive-mode (proc on-or-off) - (if (string-match (concat "Passive mode " on-or-off) + (if (string-match (concat "Passive mode:? " on-or-off) (cdr (ange-ftp-raw-send-cmd proc (concat "passive " on-or-off) "Trying passive mode..." nil))) From 7b315e8a5c966f8d11a4f646db4e29b989b56ab1 Mon Sep 17 00:00:00 2001 From: Denis Zubarev Date: Sun, 12 Nov 2023 01:42:42 +0300 Subject: [PATCH 07/19] Fix an issue when searching subtree backward (bug#67117) * src/treesit.c (treesit_traverse_child_helper): Do not call treesit_traverse_sibling_helper when the named node is required and the last child is the named node. Otherwise treesit_traverse_sibling_helper will move cursor to the previous sibling and last node will be skipped. * test/src/treesit-tests.el (treesit-search-subtree-forward-1): (treesit-search-subtree-backward-1): Add tests. --- src/treesit.c | 4 ++-- test/src/treesit-tests.el | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/treesit.c b/src/treesit.c index 45de82ec096..04ea8958b96 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -3061,9 +3061,9 @@ treesit_traverse_child_helper (TSTreeCursor *cursor, /* First go to the last child. */ while (ts_tree_cursor_goto_next_sibling (cursor)); - if (!named) + if (!named || (named && ts_node_is_named (ts_tree_cursor_current_node(cursor)))) return true; - /* Else named... */ + /* Else named is required and last child is not named node */ if (treesit_traverse_sibling_helper(cursor, false, true)) return true; else diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 69db37fc0b4..9ba3a9340c1 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -1083,6 +1083,36 @@ This tests bug#60355." treesit--ert-defun-navigation-python-program treesit--ert-defun-navigation-top-level-master))) +(ert-deftest treesit-search-subtree-forward-1 () + "Test search subtree forward." + (skip-unless (treesit-language-available-p 'python)) + (require 'python) + (python-ts-mode) + (insert "Temp(1, 2)") + (goto-char (point-min)) + (let ((node (treesit-search-subtree + (treesit--thing-at (point) "call") + (lambda (n) (equal (treesit-node-type n ) "integer"))))) + + (should node) + (should (equal (treesit-node-text node) "1")))) + +(ert-deftest treesit-search-subtree-backward-1 () + "Test search subtree with backward=t." + (skip-unless (treesit-language-available-p 'python)) + (require 'python) + (python-ts-mode) + (insert "Temp(1, 2)") + (goto-char (point-min)) + (let ((node (treesit-search-subtree + (treesit--thing-at (point) "call") + (lambda (n) (equal (treesit-node-type n ) "integer")) + t))) + + (should node) + (should (equal (treesit-node-text node) "2")))) + + ;; TODO ;; - Functions in treesit.el ;; - treesit-load-name-override-list From 2922d683b7899b8b580cbff466478617ea7ad5ad Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 19 Dec 2023 18:53:18 +0200 Subject: [PATCH 08/19] ; * src/treesit.c (treesit_traverse_child_helper): Fix comment. --- src/treesit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/treesit.c b/src/treesit.c index 04ea8958b96..93ed97212d7 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -3063,7 +3063,7 @@ treesit_traverse_child_helper (TSTreeCursor *cursor, if (!named || (named && ts_node_is_named (ts_tree_cursor_current_node(cursor)))) return true; - /* Else named is required and last child is not named node */ + /* Else named is required and last child is not named node. */ if (treesit_traverse_sibling_helper(cursor, false, true)) return true; else From cb3684e9dfa6603298540e3befe99962ff87d7ee Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 20 Dec 2023 15:55:41 +0200 Subject: [PATCH 09/19] Fix script for some characters * lisp/international/characters.el (char-script-table): Fix script for 2 characters. * admin/unidata/blocks.awk: Fix script for Yijing Hexagram Symbols. (Bug#67924) --- admin/unidata/blocks.awk | 3 ++- lisp/international/characters.el | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/unidata/blocks.awk b/admin/unidata/blocks.awk index 80ce7478a45..dd6d5796044 100755 --- a/admin/unidata/blocks.awk +++ b/admin/unidata/blocks.awk @@ -60,6 +60,7 @@ BEGIN { alias["cjk strokes"] = "cjk-misc" alias["cjk symbols and punctuation"] = "cjk-misc" alias["halfwidth and fullwidth forms"] = "cjk-misc" + alias["yijing hexagram symbols"] = "cjk-misc" alias["common indic number forms"] = "north-indic-number" tohex["a"] = 10 @@ -94,7 +95,7 @@ function name2alias(name , w, w2) { if (alias[name]) return alias[name] else if (name ~ /for symbols/) return "symbol" else if (name ~ /latin|combining .* marks|spacing modifier|tone letters|alphabetic presentation/) return "latin" - else if (name ~ /cjk|yijing|enclosed ideograph|kangxi/) return "han" + else if (name ~ /cjk|enclosed ideograph|kangxi/) return "han" else if (name ~ /arabic/) return "arabic" else if (name ~ /^greek/) return "greek" else if (name ~ /^coptic/) return "coptic" diff --git a/lisp/international/characters.el b/lisp/international/characters.el index 21e2b59a1a4..1f002ab723a 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -1480,6 +1480,9 @@ Setup `char-width-table' appropriate for non-CJK language environment." ;; Fix some exceptions that blocks.awk/Blocks.txt couldn't get right. (set-char-table-range char-script-table '(#x2ea . #x2eb) 'bopomofo) (set-char-table-range char-script-table #xab65 'greek) +(set-char-table-range char-script-table #x16fe0 'tangut) +(set-char-table-range char-script-table #x16fe1 'nushu) + ;;; Setting unicode-category-table. From 77678244b83455b34a92e90ddeea4c68799d1d58 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 21 Dec 2023 10:24:29 -0500 Subject: [PATCH 10/19] doc/lispintro: Don't mention `set` (bug#67734) * doc/lispintro/emacs-lisp-intro.texi (Using set): Delete. (Using setq): Adjust accordingly. (setq): Rename from "set & setq" and don't refer to `set` any more. (Review): Don't mention `set` any more. --- doc/lispintro/emacs-lisp-intro.texi | 133 ++++++++++------------------ 1 file changed, 49 insertions(+), 84 deletions(-) diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index eb8ff413b79..68943d9b6f4 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -317,7 +317,7 @@ List Processing * Evaluation:: Running a program. * Variables:: Returning a value from a variable. * Arguments:: Passing information to a function. -* set & setq:: Setting the value of a variable. +* setq:: Setting the value of a variable. * Summary:: The major points. * Error Message Exercises:: @@ -358,7 +358,6 @@ Arguments Setting the Value of a Variable -* Using set:: Setting values. * Using setq:: Setting a quoted value. * Counting:: Using @code{setq} to count. @@ -1060,7 +1059,7 @@ of Lisp. * Evaluation:: Running a program. * Variables:: Returning a value from a variable. * Arguments:: Passing information to a function. -* set & setq:: Setting the value of a variable. +* setq:: Setting the value of a variable. * Summary:: The major points. * Error Message Exercises:: @end menu @@ -1782,7 +1781,7 @@ A symbol can have any value attached to it or, to use the jargon, we can string, @code{"such as this"}; to a list, such as @code{(spruce pine oak)}; we can even bind a variable to a function definition. -A symbol can be bound to a value in several ways. @xref{set & setq, , +A symbol can be bound to a value in several ways. @xref{setq, , Setting the Value of a Variable}, for information about one way to do this. @@ -2273,52 +2272,52 @@ When your fill column is 70 and you evaluate the expression, the message @code{"He saw 38 red foxes leaping."} appears in your echo area. -@node set & setq +@node setq @section Setting the Value of a Variable @cindex Variable, setting value @cindex Setting value of variable @cindex @samp{bind} defined -There are several ways by which a variable can be given a value. One of -the ways is to use either the function @code{set} or the special form -@code{setq}. Another way is to use @code{let} (@pxref{let}). (The -jargon for this process is to @dfn{bind} a variable to a value.) +There are several ways by which a variable can be given a value. +One of the ways is to use the special form @code{setq}. Another way +is to use @code{let} (@pxref{let}). (The jargon for this process is +to @dfn{bind} a variable to a value.) -The following sections not only describe how @code{set} and @code{setq} -work but also illustrate how arguments are passed. +The following sections not only describe how @code{setq} works but +also illustrate how arguments are passed. @menu -* Using set:: Setting values. -* Using setq:: Setting a quoted value. +* Using setq:: Setting variables. * Counting:: Using @code{setq} to count. @end menu -@node Using set -@subsection Using @code{set} +@node Using setq +@subsection Using @code{setq} @findex set -To set the value of the symbol @code{flowers} to the list @code{'(rose +To set the value of the symbol @code{flowers} to the list @code{(rose violet daisy buttercup)}, evaluate the following expression by positioning the cursor after the expression and typing @kbd{C-x C-e}. @smallexample -(set 'flowers '(rose violet daisy buttercup)) +(setq flowers '(rose violet daisy buttercup)) @end smallexample @noindent The list @code{(rose violet daisy buttercup)} will appear in the echo -area. This is what is @emph{returned} by the @code{set} function. As a -side effect, the symbol @code{flowers} is bound to the list; that is, -the symbol @code{flowers}, which can be viewed as a variable, is given -the list as its value. (This process, by the way, illustrates how a -side effect to the Lisp interpreter, setting the value, can be the -primary effect that we humans are interested in. This is because every -Lisp function must return a value if it does not get an error, but it -will only have a side effect if it is designed to have one.) +area. This is what is @emph{returned} by the @code{setq} special +form. As a side effect, the symbol @code{flowers} is bound to the +list; that is, the symbol @code{flowers}, which can be viewed as +a variable, is given the list as its value. (This process, by the +way, illustrates how a side effect to the Lisp interpreter, setting +the value, can be the primary effect that we humans are interested in. +This is because every Lisp function must return a value if it does not +get an error, but it will only have a side effect if it is designed to +have one.) -After evaluating the @code{set} expression, you can evaluate the symbol -@code{flowers} and it will return the value you just set. Here is the -symbol. Place your cursor after it and type @kbd{C-x C-e}. +After evaluating the @code{setq} expression, you can evaluate the +symbol @code{flowers} and it will return the value you just set. +Here is the symbol. Place your cursor after it and type @kbd{C-x C-e}. @smallexample flowers @@ -2336,30 +2335,8 @@ in front of it, what you will see in the echo area is the symbol itself, 'flowers @end smallexample -Note also, that when you use @code{set}, you need to quote both -arguments to @code{set}, unless you want them evaluated. Since we do -not want either argument evaluated, neither the variable -@code{flowers} nor the list @code{(rose violet daisy buttercup)}, both -are quoted. (When you use @code{set} without quoting its first -argument, the first argument is evaluated before anything else is -done. If you did this and @code{flowers} did not have a value -already, you would get an error message that the @samp{Symbol's value -as variable is void}; on the other hand, if @code{flowers} did return -a value after it was evaluated, the @code{set} would attempt to set -the value that was returned. There are situations where this is the -right thing for the function to do; but such situations are rare.) - -@node Using setq -@subsection Using @code{setq} -@findex setq - -As a practical matter, you almost always quote the first argument to -@code{set}. The combination of @code{set} and a quoted first argument -is so common that it has its own name: the special form @code{setq}. -This special form is just like @code{set} except that the first argument -is quoted automatically, so you don't need to type the quote mark -yourself. Also, as an added convenience, @code{setq} permits you to set -several different variables to different values, all in one expression. +Also, as an added convenience, @code{setq} permits you to set several +different variables to different values, all in one expression. To set the value of the variable @code{carnivores} to the list @code{'(lion tiger leopard)} using @code{setq}, the following expression @@ -2369,18 +2346,6 @@ is used: (setq carnivores '(lion tiger leopard)) @end smallexample -@noindent -This is exactly the same as using @code{set} except the first argument -is automatically quoted by @code{setq}. (The @samp{q} in @code{setq} -means @code{quote}.) - -@need 1250 -With @code{set}, the expression would look like this: - -@smallexample -(set 'carnivores '(lion tiger leopard)) -@end smallexample - Also, @code{setq} can be used to assign different values to different variables. The first argument is bound to the value of the second argument, the third argument is bound to the value of the @@ -2400,14 +2365,14 @@ to the symbol @code{herbivores}: not have fit on a page; and humans find it easier to read nicely formatted lists.) -Although I have been using the term ``assign'', there is another way of -thinking about the workings of @code{set} and @code{setq}; and that is to -say that @code{set} and @code{setq} make the symbol @emph{point} to the -list. This latter way of thinking is very common and in forthcoming -chapters we shall come upon at least one symbol that has ``pointer'' as -part of its name. The name is chosen because the symbol has a value, -specifically a list, attached to it; or, expressed another way, -the symbol is set to point to the list. +Although I have been using the term ``assign'', there is another way +of thinking about the workings of @code{setq}; and that is to say that +@code{setq} makes the symbol @emph{point} to the list. This latter +way of thinking is very common and in forthcoming chapters we shall +come upon at least one symbol that has ``pointer'' as part of its +name. The name is chosen because the symbol has a value, specifically +a list, attached to it; or, expressed another way, the symbol is set +to point to the list. @node Counting @subsection Counting @@ -3598,6 +3563,8 @@ and the two are not intended to refer to the same value. The @unnumberedsubsec @code{let} Prevents Confusion @end ifnottex +@c FIXME!! lexbind!! + @cindex @samp{local variable} defined @cindex @samp{variable, local}, defined The @code{let} special form prevents confusion. @code{let} creates a @@ -4471,9 +4438,7 @@ number; it will be printed as the character with that @sc{ascii} code. The @code{setq} special form sets the value of its first argument to the value of the second argument. The first argument is automatically quoted by @code{setq}. It does the same for succeeding pairs of -arguments. Another function, @code{set}, takes only two arguments and -evaluates both of them before setting the value returned by its first -argument to the value returned by its second argument. +arguments. @item buffer-name Without an argument, return the name of the buffer, as a string. @@ -16949,15 +16914,15 @@ Here is the line again; how does it work? @noindent This line is a short, but complete Emacs Lisp expression. -We are already familiar with @code{setq}. It sets the following variable, -@code{major-mode}, to the subsequent value, which is @code{text-mode}. -The single-quote before @code{text-mode} tells Emacs to deal directly -with the @code{text-mode} symbol, not with whatever it might stand for. -@xref{set & setq, , Setting the Value of a Variable}, -for a reminder of how @code{setq} works. -The main point is that there is no difference between the procedure you -use to set a value in your @file{.emacs} file and the procedure you use -anywhere else in Emacs. +We are already familiar with @code{setq}. It sets the following +variable, @code{major-mode}, to the subsequent value, which is +@code{text-mode}. The single-quote before @code{text-mode} tells +Emacs to deal directly with the @code{text-mode} symbol, not with +whatever it might stand for. @xref{setq, , Setting the Value of +a Variable}, for a reminder of how @code{setq} works. The main point +is that there is no difference between the procedure you use to set +a value in your @file{.emacs} file and the procedure you use anywhere +else in Emacs. @need 800 Here is the next line: From 1ad126c0f28aae2b5d2da9b347a33e4300424de9 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 22 Dec 2023 11:45:23 +0100 Subject: [PATCH 11/19] ; Fix typo --- lisp/textmodes/ispell.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 6b048a8a805..be3bdda1d13 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -583,7 +583,7 @@ Note that with \"ispell\" as the speller, the CASECHARS and OTHERCHARS slots of the alist should contain the same character set as casechars and otherchars in the LANGUAGE.aff file \(e.g., english.aff). Aspell and Hunspell don't have this limitation. -Allso, when the speller program is \"aspell\" or \"hunspell\", +Also, when the speller program is \"aspell\" or \"hunspell\", some parts of the database, notably OTHERCHARS, will be determined by parsing the dictionary data files, see `ispell-aspell-find-dictionary' and `ispell-parse-hunspell-affix-file'.") From bd0c75897153ea5ce1e4ba12c81c3b280a0b95e4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 22 Dec 2023 16:49:49 +0200 Subject: [PATCH 12/19] Improve documentation of new native-compilation commands * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu) (emacs-lisp-native-compile, emacs-lisp-native-compile-and-load): Doc fixes. * doc/lispref/compile.texi (Native-Compilation Functions): Document 'emacs-lisp-native-compile' and 'emacs-lisp-native-compile-and-load'. --- doc/lispref/compile.texi | 15 +++++++++++++-- lisp/progmodes/elisp-mode.el | 16 ++++++++++------ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index 96d66445360..3a6a3733055 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -878,8 +878,7 @@ well. You can natively-compile either a single function or macro definition, or a whole file of Lisp code, with the @code{native-compile} function. Natively-compiling a file will -produce both the corresponding @file{.elc} file with byte code and the -@file{.eln} file with native code. +produce the @file{.eln} file with native code. @findex native-comp-limple-mode @vindex native-comp-verbose @@ -971,6 +970,18 @@ compilation subprocesses in parallel, under the control of Variables}). @end defun +@deffn Command emacs-lisp-native-compile +This command compiles the file visited by the current buffer into +native code, if the file was changed since the last time it was +natively-compiled. +@end deffn + +@deffn Command emacs-lisp-native-compile-and-load +This command compiles the file visited by the current buffer into +native code, like @code{emacs-lisp-native-compile}, but it also loads +the native code when the compilation finishes. +@end deffn + The following function allows Lisp programs to test whether native-compilation is available at runtime. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 354d98c50dc..105b017c215 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -85,10 +85,10 @@ All commands in `lisp-mode-shared-map' are inherited by this map." ["Byte-recompile Directory..." byte-recompile-directory :help "Recompile every `.el' file in DIRECTORY that needs recompilation"] ["Native-compile This File" emacs-lisp-native-compile - :help "Compile the current file containing the current buffer to native code" + :help "Compile this buffer's file to native code" :active (native-comp-available-p)] ["Native-compile and Load" emacs-lisp-native-compile-and-load - :help "Compile the current file to native code, then load compiled native code" + :help "Compile this buffer's file to native code, then load compiled native code" :active (native-comp-available-p)] ["Disassemble Byte Compiled Object..." disassemble :help "Print disassembled code for OBJECT in a buffer"] @@ -224,7 +224,9 @@ All commands in `lisp-mode-shared-map' are inherited by this map." (declare-function comp-write-bytecode-file "comp") (defun emacs-lisp-native-compile () - "Native-compile synchronously the current file (if it has changed)." + "Native-compile the current buffer's file (if it has changed). +This invokes a synchronous native-compilation of the file that is +visited by the current buffer." (interactive nil emacs-lisp-mode) (emacs-lisp--before-compile-buffer) (let* ((byte+native-compile t) @@ -234,12 +236,14 @@ All commands in `lisp-mode-shared-map' are inherited by this map." (comp-write-bytecode-file eln)))) (defun emacs-lisp-native-compile-and-load () - "Native-compile synchronously the current file (if it has changed). -Load the compiled code when finished. + "Native-compile the current buffer's file (if it has changed), then load it. +This invokes a synchronous native-compilation of the file that is +visited by the current buffer, then loads the compiled native code +when the compilation is finished. Use `emacs-lisp-byte-compile-and-load' in combination with `native-comp-jit-compilation' set to t to achieve asynchronous -native compilation." +native compilation of the current buffer's file." (interactive nil emacs-lisp-mode) (when-let ((byte-file (emacs-lisp-native-compile))) (load (file-name-sans-extension byte-file)))) From d386a8aa43f77f9317db6f52ef70f43a48237f99 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 22 Dec 2023 22:36:37 +0100 Subject: [PATCH 13/19] Recommend customizing eglot for python-base-mode * doc/misc/eglot.texi (Project-specific configuration): Recommend setting directory local variables for 'python-base-mode' instead of 'python-mode'. This makes any customizations effective also for 'python-ts-mode'. --- doc/misc/eglot.texi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index f7543193f18..bbf323a873f 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -1085,8 +1085,8 @@ To apply this to Eglot, and assuming you chose the :fuzzy t) :pylint (:enabled :json-false))) :gopls (:usePlaceholders t))))) - (python-mode . ((indent-tabs-mode . nil))) - (go-mode . ((indent-tabs-mode . t)))) + (python-base-mode . ((indent-tabs-mode . nil))) + (go-mode . ((indent-tabs-mode . t)))) @end lisp @noindent @@ -1101,7 +1101,7 @@ plists are used inside the value of This following form may also be used: @lisp -((python-mode +((python-base-mode . ((eglot-workspace-configuration . (:pylsp (:plugins (:jedi_completion (:include_params t :fuzzy t) @@ -1116,7 +1116,7 @@ This following form may also be used: @noindent This sets up the value of @code{eglot-workspace-configuration} separately depending on the major mode of each of that project's -buffers. @code{python-mode} buffers will have the variable set to +buffers. @code{python-base-mode} buffers will have the variable set to @code{(:pylsp (:plugins ...))}. @code{go-mode} buffers will have the variable set to @code{(:gopls (:usePlaceholders t))}. @@ -1127,7 +1127,7 @@ want to set a different option for @code{gopls.usePlaceholders} , you may use something like: @lisp -((python-mode +((python-base-mode . ((eglot-workspace-configuration . (:pylsp (:plugins (:jedi_completion (:include_params t :fuzzy t) From d220893216c3c6873b2bb529628e08c526d7f4ff Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Fri, 22 Dec 2023 21:25:00 -0800 Subject: [PATCH 14/19] Fix c++-ts-mode indentation (bug#67975) * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Make indent rule match precise so it doesn't match declaration_list. --- lisp/progmodes/c-ts-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index ca831a9c5f9..d069ddefa6a 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -437,7 +437,7 @@ MODE is either `c' or `cpp'." ((parent-is "function_definition") parent-bol 0) ((parent-is "pointer_declarator") parent-bol 0) - ((parent-is "declaration") parent-bol 0) + ((parent-is ,(rx bos "declaration" eos)) parent-bol 0) ((parent-is "conditional_expression") first-sibling 0) ((parent-is "assignment_expression") parent-bol c-ts-mode-indent-offset) ((parent-is "concatenated_string") first-sibling 0) From 7a00ca92c191a8d105283f73e9b68f6a0378a3a0 Mon Sep 17 00:00:00 2001 From: Denis Zubarev Date: Sun, 12 Nov 2023 01:42:42 +0300 Subject: [PATCH 15/19] Fix treesit test (bug#67117) * test/src/treesit-tests.el (treesit-search-subtree-forward-1): (treesit-search-subtree-backward-1): Replace treesit--thing-at with treesit-query-capture (treesit--thing-at isn't available in Emacs 29). --- test/src/treesit-tests.el | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 9ba3a9340c1..1763c3894f5 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -1090,9 +1090,12 @@ This tests bug#60355." (python-ts-mode) (insert "Temp(1, 2)") (goto-char (point-min)) - (let ((node (treesit-search-subtree - (treesit--thing-at (point) "call") - (lambda (n) (equal (treesit-node-type n ) "integer"))))) + (pcase-let* ((`((,_ . ,call-node)) + (treesit-query-capture (treesit-buffer-root-node) + '((call) @c))) + (node (treesit-search-subtree + call-node + (lambda (n) (equal (treesit-node-type n) "integer"))))) (should node) (should (equal (treesit-node-text node) "1")))) @@ -1104,10 +1107,13 @@ This tests bug#60355." (python-ts-mode) (insert "Temp(1, 2)") (goto-char (point-min)) - (let ((node (treesit-search-subtree - (treesit--thing-at (point) "call") - (lambda (n) (equal (treesit-node-type n ) "integer")) - t))) + (pcase-let* ((`((,_ . ,call-node)) + (treesit-query-capture (treesit-buffer-root-node) + '((call) @c))) + (node (treesit-search-subtree + call-node + (lambda (n) (equal (treesit-node-type n) "integer")) + t))) (should node) (should (equal (treesit-node-text node) "2")))) From 77232826821a60b50ab2c1f315ebffd4ebecfe66 Mon Sep 17 00:00:00 2001 From: Xiyue Deng Date: Wed, 13 Dec 2023 13:38:55 -0800 Subject: [PATCH 16/19] Add sample code to the "let*" section in "forward-paragraph" * doc/lispintro/emacs-lisp-intro.texi (fwd-para let): Add code sample. (Bug#67817) --- doc/lispintro/emacs-lisp-intro.texi | 35 ++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 68943d9b6f4..aaa7511ef30 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -12847,7 +12847,40 @@ The next line of the @code{forward-paragraph} function begins a introduced}), in which Emacs binds a total of seven variables: @code{opoint}, @code{fill-prefix-regexp}, @code{parstart}, @code{parsep}, @code{sp-parstart}, @code{start}, and -@code{found-start}. +@code{found-start}. The first part of the @code{let*} expression +looks like below: + +@smallexample +@group +(let* ((opoint (point)) + (fill-prefix-regexp + (and fill-prefix (not (equal fill-prefix "")) + (not paragraph-ignore-fill-prefix) + (regexp-quote fill-prefix))) + ;; Remove ^ from paragraph-start and paragraph-sep if they are there. + ;; These regexps shouldn't be anchored, because we look for them + ;; starting at the left-margin. This allows paragraph commands to + ;; work normally with indented text. + ;; This hack will not find problem cases like "whatever\\|^something". + (parstart (if (and (not (equal "" paragraph-start)) + (equal ?^ (aref paragraph-start 0))) + (substring paragraph-start 1) + paragraph-start)) + (parsep (if (and (not (equal "" paragraph-separate)) + (equal ?^ (aref paragraph-separate 0))) + (substring paragraph-separate 1) + paragraph-separate)) + (parsep + (if fill-prefix-regexp + (concat parsep "\\|" + fill-prefix-regexp "[ \t]*$") + parsep)) + ;; This is used for searching. + (sp-parstart (concat "^[ \t]*\\(?:" parstart "\\|" parsep "\\)")) + start found-start) + ...) +@end group +@end smallexample The variable @code{parsep} appears twice, first, to remove instances of @samp{^}, and second, to handle fill prefixes. From fba7b9db39771edbbc71a8122c7b0ea1ce24ec96 Mon Sep 17 00:00:00 2001 From: Xiyue Deng Date: Wed, 13 Dec 2023 16:21:10 -0800 Subject: [PATCH 17/19] Add explanation for extra parentheses in ELisp Introduction * doc/lispintro/emacs-lisp-intro.texi (fwd-para while): Add a note to explain the extra parentheses. (Bug#67820) --- doc/lispintro/emacs-lisp-intro.texi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index aaa7511ef30..4a0e8dfa1fc 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -13248,6 +13248,10 @@ The last expression when there is no fill prefix is @end smallexample @noindent +(Note that this code snippet is copied verbatim from the original code, +so the two extra ending parentheses are matching the previous @code{if} +and @code{while}.) + This says that if there is no fill prefix and if we are not at the end, point should move to the beginning of whatever was found by the regular expression search for @code{sp-parstart}. From 1e5357d3d1f5ecf68f1f34d017954d591eaaed14 Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Sat, 21 Oct 2023 14:02:06 +0100 Subject: [PATCH 18/19] * doc/man/emacsclient.1: Add missing sections (bug#66598) Copyright-paperwork-exempt: yes --- doc/man/emacsclient.1 | 60 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/doc/man/emacsclient.1 b/doc/man/emacsclient.1 index 0acf3dd339e..b04923262de 100644 --- a/doc/man/emacsclient.1 +++ b/doc/man/emacsclient.1 @@ -62,9 +62,11 @@ This option applies only to the next file specified. .TP .B \-a, \-\-alternate-editor=COMMAND If the Emacs server is not running, run the specified shell command instead. -This can also be specified via the ALTERNATE_EDITOR environment variable. -If the value of ALTERNATE_EDITOR is the empty string, run "emacs \-\-daemon" to +If the empty string is specified, run "emacs \-\-daemon" to start Emacs in daemon mode, and try to connect to it. + +See also the ALTERNATE_EDITOR environment variable, over which this +option takes precedence. .TP .B -c, \-\-create-frame Create a new frame instead of trying to use the current Emacs frame. @@ -84,7 +86,11 @@ Lisp expressions. .TP .B \-f, \-\-server-file=FILENAME Use TCP configuration file FILENAME for communication. -This can also be specified via the EMACS_SERVER_FILE environment variable. +Relative filenames are relative to "~/.emacs.d/server/" or +"$XDG_CONFIG_HOME/emacs/server/", and the default is "server". + +See also the EMACS_SERVER_FILE environment variable, over which this +option takes precedence. .TP .B \-n, \-\-no-wait Return immediately without waiting for you to "finish" the buffer in @@ -114,7 +120,10 @@ side-effect rather than result. .TP .B \-s, \-\-socket-name=FILENAME Use socket named FILENAME for communication. -This can also be specified via the EMACS_SOCKET_NAME environment variable. +Relative filenames are relative to "$XDG_RUNTIME_DIR/emacs/" or "$TMPDIR/". + +See also the EMACS_SOCKET_NAME environment variable, over which this +option takes precedence. .TP .B \-nw, \-t, \-\-tty Open a new Emacs frame on the current terminal. @@ -122,8 +131,11 @@ Open a new Emacs frame on the current terminal. .B \-T, \-\-tramp=PREFIX Set PREFIX to add to filenames for Emacs to locate files on remote machines using TRAMP. This is mostly useful in combination with using -the Emacs server over TCP with --server-file. This can also be -specified via the EMACSCLIENT_TRAMP environment variable. +the Emacs server on a remote host (either using TCP with +--server-file, or a socket forwarded over SSH). + +See also the EMACSCLIENT_TRAMP environment variable, over which this +option takes precedence. .TP .B \-V, \-\-version Print version information and exit. @@ -133,10 +145,46 @@ Print this usage information message and exit. .SH "EXIT STATUS" Normally, the exit status is 0. If emacsclient shuts down due to Emacs signaling an error, the exit status is 1. +.SH ENVIRONMENT +.TP +.B ALTERNATE_EDITOR +If the Emacs server is not running, run the shell command in this +environment variable instead. If set to the empty string, run +"emacs \-\-daemon" to start Emacs in daemon mode, and try to connect +to it. Will be overridden by the +.B \-\-alternate-editor +option, if present. +.TP +.B EMACSCLIENT_TRAMP +A prefix to add to filenames, intended to allow Emacs to locate files +on remote machines using TRAMP. Will be overridden by the +.B \-\-tramp-prefix +option, if present. +.TP +.B EMACS_SERVER_FILE +Look in this file to discover where to find a TCP Emacs server. +Relative filenames are relative to "~/.emacs.d/server/" or +"$XDG_CONFIG_HOME/emacs/server/", and the +default is "server". Will be overridden by the +.B \-\-server-file +option, if present. +.TP +.B EMACS_SOCKET_NAME +The filename of the socket to use for communication with the Emacs server. +Relative filenames are relative to "$XDG_RUNTIME_DIR/emacs/" or "$TMPDIR/". +Will be overridden by the +.B \-\-socket-name +option, if present. .SH "SEE ALSO" The program is documented fully in .IR "Using Emacs as a Server" available via the Info system. + +The XDG_ environment variables are described in detail in the +.UR https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +XDG Base Directory Specification +.UE . + .SH AUTHOR This manual page was originally written by Stephane Bortzmeyer , for the Debian GNU/Linux system, but is not From a4751657389cf47c18416fa5d148ad2a67e14565 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 23 Dec 2023 12:04:37 +0100 Subject: [PATCH 19/19] * doc/man/emacsclient.1: Fix --tramp option. --- doc/man/emacsclient.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/man/emacsclient.1 b/doc/man/emacsclient.1 index b04923262de..75f38e4e50e 100644 --- a/doc/man/emacsclient.1 +++ b/doc/man/emacsclient.1 @@ -1,5 +1,5 @@ .\" See section COPYING for conditions for redistribution. -.TH EMACSCLIENT 1 "2023-10-25" "GNU Emacs" "GNU" +.TH EMACSCLIENT 1 "2023-12-23" "GNU Emacs" "GNU" .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other params are allowed: see man(7), man(1) .SH NAME @@ -158,7 +158,7 @@ option, if present. .B EMACSCLIENT_TRAMP A prefix to add to filenames, intended to allow Emacs to locate files on remote machines using TRAMP. Will be overridden by the -.B \-\-tramp-prefix +.B \-\-tramp option, if present. .TP .B EMACS_SERVER_FILE