commit b099777b52da1232e14883f50775a75d4d6aba62 (HEAD, refs/remotes/origin/master) Author: Stefan Kangas Date: Thu Jan 9 06:22:21 2025 +0100 ; * lib-src/make-fingerprint.c: Fix copyright year. This file is new with the portable dumper. diff --git a/lib-src/make-fingerprint.c b/lib-src/make-fingerprint.c index 4db1199f03f..c3e4c1dac61 100644 --- a/lib-src/make-fingerprint.c +++ b/lib-src/make-fingerprint.c @@ -1,7 +1,6 @@ /* Hash inputs and generate C file with the digest. -Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2016, 2018-2025 Free -Software Foundation, Inc. +Copyright (C) 2018-2025 Free Software Foundation, Inc. This file is part of GNU Emacs. commit b6bec47c4abe84263cb88eda56d3a9d77f153f71 Author: Stefan Kangas Date: Thu Jan 9 05:12:14 2025 +0100 ; Fix indentation in itree.c diff --git a/src/itree.c b/src/itree.c index 85f835178f7..3a91a7a534d 100644 --- a/src/itree.c +++ b/src/itree.c @@ -513,7 +513,7 @@ itree_size (struct itree_tree *tree) static void itree_rotate_left (struct itree_tree *tree, - struct itree_node *node) + struct itree_node *node) { eassert (node->right != NULL); @@ -556,7 +556,7 @@ itree_rotate_left (struct itree_tree *tree, static void itree_rotate_right (struct itree_tree *tree, - struct itree_node *node) + struct itree_node *node) { eassert (tree && node && node->left != NULL); @@ -595,7 +595,7 @@ itree_rotate_right (struct itree_tree *tree, static void itree_insert_fix (struct itree_tree *tree, - struct itree_node *node) + struct itree_node *node) { eassert (tree->root->red == false); @@ -801,8 +801,8 @@ itree_subtree_min (uintmax_t otick, struct itree_node *node) static void itree_remove_fix (struct itree_tree *tree, - struct itree_node *node, - struct itree_node *parent) + struct itree_node *node, + struct itree_node *parent) { if (parent == NULL) eassert (node == tree->root); @@ -917,8 +917,8 @@ itree_total_offset (struct itree_node *node) Requires both nodes to be using the same effective 'offset'. */ static void itree_replace_child (struct itree_tree *tree, - struct itree_node *source, - struct itree_node *dest) + struct itree_node *source, + struct itree_node *dest) { eassert (tree && dest != NULL); eassert (source == NULL @@ -943,8 +943,8 @@ itree_replace_child (struct itree_tree *tree, effective 'offset'. */ static void itree_transplant (struct itree_tree *tree, - struct itree_node *source, - struct itree_node *dest) + struct itree_node *source, + struct itree_node *dest) { itree_replace_child (tree, source, dest); source->left = dest->left; @@ -1304,7 +1304,7 @@ itree_iter_next_in_subtree (struct itree_node *node, return next; } } - } + } return NULL; case ITREE_POST_ORDER: commit 493bb2eaf1610ec950e4a2f7229d6e1f939064b9 Author: Gabriel Santos Date: Fri Dec 27 10:43:20 2024 -0300 Add button navigation to treesit-explorer (bug#75141) * lisp/treesit.el (treesit--explorer-tree-mode-map): Define it as a child of special-mode-map, adding keys for button navigation. diff --git a/lisp/treesit.el b/lisp/treesit.el index 9dd8419b32f..4746e7a16a8 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -4047,6 +4047,16 @@ covers point. PARSER-NAME are unique." "Mode for displaying syntax trees for `treesit-explore-mode'." nil) +(defvar-keymap treesit--explorer-tree-mode-map + :doc "Keymap for the treesit tree explorer. + +Navigates from button to button." + :parent special-mode-map + "n" #'forward-button + "p" #'backward-button + "TAB" #'forward-button + "" #'backward-button) + (defun treesit-explorer-switch-parser (parser) "Switch explorer to use PARSER." (interactive commit 40fbed939a254566f3bce50c6f16c21e5d2441ad Author: Stefan Kangas Date: Thu Jan 9 02:54:08 2025 +0100 Improve 'gethash' docstring * src/fns.c (Fgethash): Improve docstring. Avoid exposing the C identifier 'dflt' to Lisp by providing a "usage:" string. diff --git a/src/fns.c b/src/fns.c index 0329430572b..191154c651a 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5931,7 +5931,10 @@ DEFUN ("clrhash", Fclrhash, Sclrhash, 1, 1, 0, DEFUN ("gethash", Fgethash, Sgethash, 2, 3, 0, doc: /* Look up KEY in TABLE and return its associated value. -If KEY is not found, return DFLT which defaults to nil. */) +If KEY is not found in table, return DEFAULT, or nil if DEFAULT is not +provided. + +usage: (gethash KEY TABLE &optional DEFAULT) */) (Lisp_Object key, Lisp_Object table, Lisp_Object dflt) { struct Lisp_Hash_Table *h = check_hash_table (table); commit bdccd4ea9e903dcabfa65cdd44d979838cae4d29 Author: Kierin Bell Date: Wed Jan 8 18:29:55 2025 -0500 Fix documentation of Iroquoian input methods * lisp/leim/quail/iroquoian.el: Fix typos in Oneida endonym and in the docstring of `haudenosaunee-postfix' about keys for inputting Onondaga nasals. (Bug#75448) * etc/NEWS: Fix typo in Oneida endonym. diff --git a/etc/NEWS b/etc/NEWS index 37e5669b139..ba73843825d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -260,12 +260,12 @@ The Tifinagh script is used to write the Berber languages. *** New input methods for Northern Iroquoian languages. Input methods are now implemented for Haudenosaunee languages in the Northern Iroquoian language family: 'mohawk-postfix' (Mohawk -[Kanien’kéha / Onkwehonwehnéha]), 'oneida-postfix' (Oneida [Onʌyota:ká: -/ Ukwehuwehnéha]), 'cayuga-postfix' (Cayuga [Gayogo̱ho:nǫhnéha:ˀ]), -'onondaga-postfix' (Onondaga [Onųdaʔgegáʔ]), and 'seneca-postfix' -(Seneca [Onödowá’ga:’]). Additionally, there is a general-purpose -'haudenosaunee-postfix' input method to facilitate writing in the -orthographies of the five languages simultaneously. +[Kanien’kéha / Onkwehonwehnéha]), 'oneida-postfix' (Oneida +[Onʌyote’a·ká· / Ukwehuwehnéha]), 'cayuga-postfix' (Cayuga +[Gayogo̱ho:nǫhnéha:ˀ]), 'onondaga-postfix' (Onondaga [Onųdaʔgegáʔ]), and +'seneca-postfix' (Seneca [Onödowá’ga:’]). Additionally, there is a +general-purpose 'haudenosaunee-postfix' input method to facilitate +writing in the orthographies of the five languages simultaneously. --- ** 'visual-wrap-prefix-mode' now supports variable-pitch fonts. diff --git a/lisp/leim/quail/iroquoian.el b/lisp/leim/quail/iroquoian.el index 51d02e822a9..63c24cf4590 100644 --- a/lisp/leim/quail/iroquoian.el +++ b/lisp/leim/quail/iroquoian.el @@ -28,7 +28,7 @@ ;; languages: ;; - Mohawk (Kanien’kéha / Onkwehonwehnéha) -;; - Oneida (Onʌyota:ká: / Ukwehuwehnéha) +;; - Oneida (Onʌyote’a·ká· / Ukwehuwehnéha) ;; - Onondaga (Onųdaʔgegáʔ) ;; - Cayuga (Gayogo̱ho:nǫhnéha:ˀ) ;; - Seneca (Onödowá’ga:’) @@ -229,7 +229,7 @@ Entries are as with rules in `quail-define-rules'.") (quail-define-package "oneida-postfix" "Oneida" "ONE<" t - "Oneida (Onʌyota:ká:) input method with postfix modifiers + "Oneida (Onʌyote’a·ká·) input method with postfix modifiers Modifiers: @@ -896,7 +896,7 @@ Entries are as with rules in `quail-define-rules'.") This input method can be used to enter the following languages: - Mohawk (Kanien’kéha / Onkwehonwehnéha) -- Oneida (Onʌyota:ká: / Ukwehuwehnéha) +- Oneida (Onʌyote’a·ká· / Ukwehuwehnéha) - Cayuga (Gayogo̱ho:nǫhnéha:ˀ) - Onondaga (Onųdaʔgegáʔ) - Seneca (Onödowá’ga:’) @@ -942,10 +942,10 @@ Vowels: | -------------------------------------------------------------------- | | (Onondaga Nation, New York) | | -------------------------------------------------------------------- | -| en~ | eñ | Mid front nasal vowel | -| EN~ | EÑ | Mid front nasal vowel (capital) | -| on~ | oñ | Back high nasal vowel | -| ON~ | OÑ | Back high nasal vowel (capital) | +| en- | eñ | Mid front nasal vowel | +| EN- | EÑ | Mid front nasal vowel (capital) | +| on- | oñ | Back high nasal vowel | +| ON- | OÑ | Back high nasal vowel (capital) | | a\" | ä | Low front rounded vowel | | A\" | Ä | Low front rounded vowel (capital) | | -------------------------------------------------------------------- | commit b71225ed90ab28ad88c22f8fcd1b87c5681eb0a7 Author: Arash Esbati Date: Wed Jan 8 20:47:43 2025 +0100 Remove support for supertabular from RefTeX * doc/misc/reftex.texi (Builtin Label Environments): * lisp/textmodes/reftex-vars.el (reftex-label-alist-builtin) (reftex-default-label-alist-entries): Delete entries for the supertabular environment. supertabular is an extension of the normal tabular environment, and therefore doesn't contain a caption and label. Hence, supporting supertabular in RefTeX is useless. diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi index 9287858fe29..56d3bbb655f 100644 --- a/doc/misc/reftex.texi +++ b/doc/misc/reftex.texi @@ -1128,11 +1128,6 @@ the @code{\endnote} macro (from @file{endnotes.sty}) the @code{\subfigure} and @code{\subtable} macros (from @file{subfig.sty}) @item -@cindex @code{supertab}, LaTeX package -@cindex LaTeX packages, @code{supertab} -@cindex @code{supertabular}, LaTeX environment -@code{supertabular} (@file{supertab.sty}) -@item @cindex @code{wrapfig}, LaTeX package @cindex LaTeX packages, @code{wrapfig} @cindex @code{wrapfigure}, LaTeX environment diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 3214f0b98ba..49343b85de7 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -91,9 +91,6 @@ ("\\subtable[][]{}" ?t "tab:" "~\\subref{%s}" "\\\\subtable\\(?:\\(?:\\[[^]]*\\]\\)?\\[\\|{\\)"))) - (supertab "Supertabular environment" - (("supertabular" ?t nil nil "\\tablecaption{"))) - (wrapfig "The wrapfigure and wraptable environments" (("wrapfigure" ?f nil nil caption) ("wraptable" ?t nil nil caption))) @@ -462,7 +459,7 @@ If nil, `follow-mode' will be suspended for stuff in unvisited files." (defcustom reftex-default-label-alist-entries '( amsmath endnotes fancybox floatfig longtable picinpar - rotating sidecap subfig supertab wrapfig + rotating sidecap subfig wrapfig listings minted ctable LaTeX) "Default label alist specifications. LaTeX should always be the last entry. The value of this variable is a list of symbols with associations in the commit ab3cb717a08ef8a9939e38652f25a5ef312c76ce Author: Stephen Gildea Date: Wed Jan 8 10:24:55 2025 -0800 ; "time stamp" also can be spelled "timestamp" * lisp/time-stamp.el (time-stamp): * doc/emacs/files.texi (Time Stamps): Be findable as "timestamps". diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 620d16ddf11..1d3fc59e3fe 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -996,6 +996,7 @@ File Shadowing is not available on MS Windows. @node Time Stamps @subsection Updating Time Stamps Automatically @cindex time stamps +@cindex timestamps @cindex modification dates @cindex last modified time diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index fb3c6cb81da..2aa5ba74dc3 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@ -307,7 +307,7 @@ See also `time-stamp-count' and `time-stamp-inserts-lines'.") ;;;###autoload (defun time-stamp () - "Update any time stamp string(s) in the buffer. + "Update any time stamp strings (timestamps) in the buffer. Look for a time stamp template and update it with the current date, time, and/or other info. @@ -830,7 +830,7 @@ if they didn't read the documentation)." (standard-form (concat "Conversions that are changing are ambiguous and should be replaced by\n" - "stable conversions that makes your intention clear.\n"))) + "stable conversions that make your intention clear.\n"))) "\n" "The following obsolescent `time-stamp-format' conversion(s) were found:\n\n"))))) (insert old-form " -- use " new-form) commit 5c3deffd9f4647e0dff33ffc84a28eb6fedb3012 Author: Arash Esbati Date: Wed Jan 8 19:12:49 2025 +0100 Replace obsolete subfigure package with subfig * doc/misc/reftex.texi (Builtin Label Environments): Mention the subfig LaTeX package instead of the obsolete subfigure. * lisp/textmodes/reftex-vars.el (reftex-label-alist-builtin): Replace obsolete subfigure entry with subfig. Adjust the macro names accordingly and the regexp for matching the context. Unify the descriptions of all entries. (reftex-default-label-alist-entries): Use subfig as well. diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi index 5973140734f..9287858fe29 100644 --- a/doc/misc/reftex.texi +++ b/doc/misc/reftex.texi @@ -1121,12 +1121,12 @@ the @code{\endnote} macro (from @file{endnotes.sty}) @cindex @code{sidewaystable}, LaTeX environment @code{sidewaysfigure}, @code{sidewaystable} (@file{rotating.sty}) @item -@cindex @code{subfigure}, LaTeX package -@cindex LaTeX packages, @code{subfigure} -@cindex @code{subfigure}, LaTeX environment -@cindex @code{subfigure*}, LaTeX environment -@code{subfigure}, @code{subfigure*}, the @code{\subfigure} macro -(@file{subfigure.sty}) +@cindex @code{subfig}, LaTeX package +@cindex LaTeX packages, @code{subfig} +@cindex @code{\subfigure}, LaTeX macro +@cindex @code{\subtable}, LaTeX macro +the @code{\subfigure} and @code{\subtable} macros (from +@file{subfig.sty}) @item @cindex @code{supertab}, LaTeX package @cindex LaTeX packages, @code{supertab} diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index c6275c94015..3214f0b98ba 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -69,41 +69,46 @@ (("figwindow" ?f nil nil 1) ("tabwindow" ?f nil nil 1))) - (rotating "Sidewaysfigure and table" + (rotating "The sidewaysfigure and sidewaystable environments" (("sidewaysfigure" ?f nil nil caption) ("sidewaysfigure*" ?f nil nil caption) ("sidewaystable" ?t nil nil caption) ("sidewaystable*" ?t nil nil caption))) - (sidecap "SCfigure and SCtable" + (sidecap "The SCfigure and SCtable environments" (("SCfigure" ?f nil nil caption) ("SCfigure*" ?f nil nil caption) ("SCtable" ?t nil nil caption) ("SCtable*" ?t nil nil caption))) - (subfigure "Subfigure environments/macro" - (("subfigure" ?f nil nil caption) - ("subfigure*" ?f nil nil caption) - ("\\subfigure[]{}" ?f nil nil 1))) + (subfig "The \\subfigure and \\subtable macros" + ;; The main macro \subfloat is ambiguous, so we only support the + ;; compat macros for the old subfigure package. The context regexp + ;; must match combinations of + ;; \subfigure[list-capt.][sub-capt.]{body} + (("\\subfigure[][]{}" ?f "fig:" "~\\subref{%s}" + "\\\\subfigure\\(?:\\(?:\\[[^]]*\\]\\)?\\[\\|{\\)") + ("\\subtable[][]{}" ?t "tab:" "~\\subref{%s}" + "\\\\subtable\\(?:\\(?:\\[[^]]*\\]\\)?\\[\\|{\\)"))) (supertab "Supertabular environment" (("supertabular" ?t nil nil "\\tablecaption{"))) - (wrapfig "The wrapfig package" + (wrapfig "The wrapfigure and wraptable environments" (("wrapfigure" ?f nil nil caption) ("wraptable" ?t nil nil caption))) - (ctable "The ctable package" + (ctable "The \\ctable macro" (("\\ctable[]{}{}{}" ?t "tab:" "~\\ref{%s}" 1 ("table" "Tabelle")))) - (listings "The listings package" + (listings "The lstlisting environment" (("lstlisting" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting")))) - (minted "The minted package" + (minted "The listing environment" (("listing" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting")))) ;; The LaTeX core stuff - (LaTeX "LaTeX default environments" + (LaTeX "LaTeX default macros and environments" (("section" ?s "%S" "~\\ref{%s}" (nil . t) (regexp "parts?" "chapters?" "chap\\." "sections?" "sect?\\." "paragraphs?" "par\\." @@ -456,9 +461,9 @@ If nil, `follow-mode' will be suspended for stuff in unvisited files." :group 'reftex-label-support) (defcustom reftex-default-label-alist-entries - '(amsmath endnotes fancybox floatfig longtable picinpar - rotating sidecap subfigure supertab wrapfig - listings minted ctable LaTeX) + '( amsmath endnotes fancybox floatfig longtable picinpar + rotating sidecap subfig supertab wrapfig + listings minted ctable LaTeX) "Default label alist specifications. LaTeX should always be the last entry. The value of this variable is a list of symbols with associations in the constant `reftex-label-alist-builtin'. Check that constant for a full list @@ -474,7 +479,8 @@ of options." (list 'const :tag (concat (symbol-name (nth 0 x)) ": " (nth 1 x)) (nth 0 x))) - reftex-label-alist-builtin))) + reftex-label-alist-builtin)) + :version "31.1") (defcustom reftex-label-alist nil "Alist with information on environments for \\label-\\ref use. commit 6df0e18fed3f3012d56a72f1d5f6a44f2f039ce2 Author: Arsen Arsenović Date: Wed Jan 8 13:57:33 2025 +0000 Add keywords var and final to Java Mode * lisp/progmodes/cc-langs.el (c-type-modifier-prefix-kwds): Add java entry for final. (c-no-type-kwds): Add java entry for var. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 51730bae410..8fee8af2fcf 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -2384,6 +2384,7 @@ fontified with the keyword face and not the type face." c '("const" "restrict" "volatile") c++ '("const" "noexcept" "volatile") objc '("const" "volatile") + java '("final") t (append (c-lang-const c-no-type-kwds) (c-lang-const c-type-modifier-prefix-kwds))) @@ -2635,7 +2636,8 @@ will be handled." (c-lang-defconst c-no-type-kwds "Keywords which remove the need to specify a type in declarations" t nil - c++ '("auto")) + c++ '("auto") + java '("var")) (c-lang-defconst c-no-type-key ;; Regexp matching an entry from `c-no-type-kwds' commit 5eca08bb23415b983bd4a80394554019b339a715 Author: Eli Zaretskii Date: Wed Jan 8 16:06:19 2025 +0200 ; * src/lisp.h (struct Lisp_Subr): Fix comment (again). diff --git a/src/lisp.h b/src/lisp.h index c93d4d15b33..e3142f3b8cc 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2229,8 +2229,8 @@ struct Lisp_Subr } intspec; Lisp_Object command_modes; /* Positive values: offset into etc/DOC. Negative values: one's - complement of index into the native comp unit's function's - documentation vector. */ + complement of index into the native comp unit's vector of + documentation strings. */ EMACS_INT doc; #ifdef HAVE_NATIVE_COMP Lisp_Object native_comp_u; commit 191a0bcf636218a32eaeff41c1c39f06658755fc Merge: a427927123c 67be8db5188 Author: Eli Zaretskii Date: Wed Jan 8 15:44:11 2025 +0200 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit a427927123cea5ddbf2f2edc1db69ec7d83f2d42 Author: Eli Zaretskii Date: Wed Jan 8 15:43:40 2025 +0200 ; * src/lisp.h (struct Lisp_Subr): Fix comment. diff --git a/src/lisp.h b/src/lisp.h index 4c09afc77e2..c93d4d15b33 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2228,8 +2228,8 @@ struct Lisp_Subr Lisp_Object native; } intspec; Lisp_Object command_modes; - /* positive values: offset into etc/DOC. Negative values: one's - complement of index into the native comp unit's function + /* Positive values: offset into etc/DOC. Negative values: one's + complement of index into the native comp unit's function's documentation vector. */ EMACS_INT doc; #ifdef HAVE_NATIVE_COMP commit 67be8db518828bbf8fb3efc5bf87d02e4ce6d8d6 Author: Richard M. Stallman Date: Wed Jan 8 08:40:32 2025 -0500 subr.el doc clarifications. * subr.el (when-let, when-let*, and-let*): Doc clarifications. Make `when-let* doc string self-contained. diff --git a/lisp/subr.el b/lisp/subr.el index 5be8d8f52d4..84e8bbd14ad 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2643,7 +2643,8 @@ SYMBOL is checked for nil." (defmacro when-let* (varlist &rest body) "Bind variables according to VARLIST and conditionally evaluate BODY. Evaluate each binding in turn, stopping if a binding value is nil. -If all are non-nil, return the value of the last form in BODY. +If all are non-nil, evaluate the forms in BODY +and return the value of the last form. The variable list VARLIST is the same as in `if-let*'. @@ -2653,8 +2654,12 @@ See also `and-let*'." (defmacro and-let* (varlist &rest body) "Bind variables according to VARLIST and conditionally evaluate BODY. -Like `when-let*', except if BODY is empty and all the bindings -are non-nil, then the result is the value of the last binding. +Evaluate each binding in turn, stopping if a binding value is nil. +If all bindings are non-nil, evaluate the forms in BODY +and return the value of the last form, or else the last binding value +if BODY is empty. + +Like `when-let*', except for the handling of an empty BODY. Some Lisp programmers follow the convention that `and' and `and-let*' are for forms evaluated for return value, and `when' and `when-let*' are @@ -2690,7 +2695,8 @@ binding." (defmacro when-let (spec &rest body) "Bind variables according to SPEC and conditionally evaluate BODY. Evaluate each binding in turn, stopping if a binding value is nil. -If all are non-nil, return the value of the last form in BODY. +If all are non-nil, evaluate the forms in BODY +and return the value of the last form. The variable list SPEC is the same as in `if-let'." (declare (indent 1) (debug if-let) commit 2a3385ab50c2f7281812b8fb582bcdba899f5f47 Author: Richard M. Stallman Date: Wed Jan 8 08:26:40 2025 -0500 Add autoload cookie and doc fix cond-star.el (cond*): Add autoload cookie. Doc fix. diff --git a/lisp/emacs-lisp/cond-star.el b/lisp/emacs-lisp/cond-star.el index 58ec12d1474..50566c97e70 100644 --- a/lisp/emacs-lisp/cond-star.el +++ b/lisp/emacs-lisp/cond-star.el @@ -40,6 +40,7 @@ (require 'cl-lib) ; for cl-assert +;;;###autoload (defmacro cond* (&rest clauses) "Extended form of traditional Lisp `cond' construct. A `cond*' construct is a series of clauses, and a clause @@ -68,10 +69,9 @@ in its body becomes the return value of the `cond*' construct. Non-exit clause: If a clause has only one element, or if its first element is -t, or if it ends with the keyword :non-exit, then -this clause never exits the `cond*' construct. Instead, -control falls through to the next clause (if any). -The bindings made in CONDITION for the BODY of the non-exit clause +a `bind*' clause, this clause never exits the `cond*' construct. +Instead, control always falls through to the next clause (if any). +All bindings made in CONDITION for the BODY of the non-exit clause are passed along to the rest of the clauses in this `cond*' construct. \\[match*\\] for documentation of the patterns for use in `match*'." commit ac52993b996927031a6913927e1028de47be4312 Author: Pip Cet Date: Wed Jan 8 12:15:30 2025 +0000 Fix store_function_docstring for native subrs (Bug#74966) Since native subrs can have either etc/DOC indexes or vector indexes, we use the sign bit of the 'doc' field to distinguish the two cases. * src/comp.c (native_function_doc, make_subr): Use one's complement of doc index for native subrs. * src/doc.c (store_function_docstring): Add assertion. * src/lisp.h (struct Lisp_Subr): Document 'doc' sign bit. diff --git a/src/comp.c b/src/comp.c index 70a9a64a714..b96fae4ae95 100644 --- a/src/comp.c +++ b/src/comp.c @@ -5488,7 +5488,10 @@ native_function_doc (Lisp_Object function) if (!VECTORP (cu->data_fdoc_v)) xsignal2 (Qnative_lisp_file_inconsistent, cu->file, build_string ("missing documentation vector")); - return AREF (cu->data_fdoc_v, XSUBR (function)->doc); + EMACS_INT doc = XSUBR (function)->doc; + if (doc < 0) + return AREF (cu->data_fdoc_v, -doc - 1); + return make_fixnum (doc); } static Lisp_Object @@ -5529,7 +5532,8 @@ make_subr (Lisp_Object symbol_name, Lisp_Object minarg, Lisp_Object maxarg, x->s.symbol_name = xstrdup (SSDATA (symbol_name)); x->s.intspec.native = intspec; x->s.command_modes = command_modes; - x->s.doc = XFIXNUM (doc_idx); + x->s.doc = -XFIXNUM (doc_idx) - 1; + eassert (x->s.doc < 0); #ifdef HAVE_NATIVE_COMP x->s.native_comp_u = comp_u; x->s.native_c_name = xstrdup (SSDATA (c_name)); diff --git a/src/doc.c b/src/doc.c index 88be9121dab..04afe50d3dd 100644 --- a/src/doc.c +++ b/src/doc.c @@ -479,7 +479,10 @@ store_function_docstring (Lisp_Object obj, EMACS_INT offset) fun = XCDR (fun); /* Lisp_Subrs have a slot for it. */ if (SUBRP (fun)) - XSUBR (fun)->doc = offset; + { + XSUBR (fun)->doc = offset; + eassert (XSUBR (fun)->doc >= 0); + } else if (CLOSUREP (fun)) { /* This bytecode object must have a slot for the docstring, since diff --git a/src/lisp.h b/src/lisp.h index 4217dd9e347..4c09afc77e2 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2228,6 +2228,9 @@ struct Lisp_Subr Lisp_Object native; } intspec; Lisp_Object command_modes; + /* positive values: offset into etc/DOC. Negative values: one's + complement of index into the native comp unit's function + documentation vector. */ EMACS_INT doc; #ifdef HAVE_NATIVE_COMP Lisp_Object native_comp_u;