commit bc4c5818dfb3c16f817514d3ae3bc074b4c4c007 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Thu Jan 16 23:19:27 2025 -0800 Update from Gnulib by running admin/merge-gnulib diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index e8413f8f85f..c02cfee842b 100644 --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -101,14 +101,15 @@ enum { /* AI indicates XATTR may be present but wasn't accessible. This is the case when [l]listxattr failed with E2BIG, - or failed with EACCES which in Linux kernel 6.12 NFS can mean merely - that we lack read access. + or is not supported (!acl_errno_valid()), or failed with EACCES + which in Linux kernel 6.12 NFS can mean merely that we lack read access. */ static bool aclinfo_may_indicate_xattr (struct aclinfo const *ai) { - return ai->size < 0 && (ai->u.err == EACCES || ai->u.err == E2BIG); + return ai->size < 0 && (!acl_errno_valid (ai->u.err) + || ai->u.err == EACCES || ai->u.err == E2BIG); } /* Does NAME have XATTR? */ diff --git a/lib/getopt-pfx-core.h b/lib/getopt-pfx-core.h index 391c7af8e71..7c5ea094683 100644 --- a/lib/getopt-pfx-core.h +++ b/lib/getopt-pfx-core.h @@ -37,6 +37,9 @@ # if defined _AIX || defined __hpux || defined __sun || defined __QNX__ # include # endif +# if defined MUSL_LIBC || (defined __FreeBSD__ || defined __DragonFly__) || defined __NetBSD__ || defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined _AIX || defined __sun || defined __minix || defined __HAIKU__ +# include +# endif # ifndef __GETOPT_ID # define __GETOPT_CONCAT(x, y) x ## y diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index b1f0053e582..ce874048f4a 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -2616,17 +2616,17 @@ ifneq (,$(GL_GENERATE_GMP_H_CONDITION)) ifneq (,$(GL_GENERATE_MINI_GMP_H_CONDITION)) # Build gmp.h as a wrapper for mini-gmp.h when using mini-gmp. gmp.h: $(top_builddir)/config.status - echo '#include "mini-gmp.h"' > $@-t - echo '#if GNULIB_LIBGMP_MPQ' >> $@-t - echo '# include "mini-mpq.h"' >> $@-t - echo '#endif' >> $@-t - mv $@-t $@ + $(gl_V_at)echo '#include "mini-gmp.h"' > $@-t + $(AM_V_at)echo '#if GNULIB_LIBGMP_MPQ' >> $@-t + $(AM_V_at)echo '# include "mini-mpq.h"' >> $@-t + $(AM_V_at)echo '#endif' >> $@-t + $(AM_V_at)mv $@-t $@ endif ifneq (,$(GL_GENERATE_GMP_GMP_H_CONDITION)) # Build gmp.h as a wrapper for gmp/gmp.h. gmp.h: $(top_builddir)/config.status - echo '#include ' > $@-t - mv $@-t $@ + $(gl_V_at)echo '#include ' > $@-t + $(AM_V_at)mv $@-t $@ endif else gmp.h: $(top_builddir)/config.status diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 771181cb1bf..dd083cae05d 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -388,6 +388,7 @@ AC_DEFUN([gl_INIT], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1]) ]) gl_UNISTD_MODULE_INDICATOR([getopt-posix]) + gl_MUSL_LIBC AC_REQUIRE([AC_CANONICAL_HOST]) gl_FUNC_GETRANDOM gl_CONDITIONAL([GL_COND_OBJ_GETRANDOM], commit 37b5b3ea91a4ed005664540091e5150d2454d8d6 Author: Po Lu Date: Fri Jan 17 09:25:39 2025 +0800 Fix the Lisp reference manual for older Texinfo * doc/lispref/symbols.texi (Standard Properties): Don't provide empty reference. * doc/lispref/variables.texi (Lexical Binding): Don't abuse xref in a standalone sentence. diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi index 5ac2a32dba0..dc6509c1ae3 100644 --- a/doc/lispref/symbols.texi +++ b/doc/lispref/symbols.texi @@ -560,12 +560,12 @@ symbol. In some cases, the definition cannot be found by looking for the definition of another symbol. For example, a test file might use a -macro to generate calls to @code{ert-deftest} -(@pxref{,,,ert, ERT: Emacs Lisp Regression Testing}) where the code -is boiler plate and only varying data need to be passed in. -In such cases, the @code{find-function-type-alist} property of the -symbol can be an alist that augments @code{find-function-regexp-alist} -telling how to find the definition of symbols of this type. +macro to generate calls to @code{ert-deftest} (@pxref{How to Write +Tests,,,ert, ERT: Emacs Lisp Regression Testing}) where the code is +boiler plate and only varying data need to be passed in. In such cases, +the @code{find-function-type-alist} property of the symbol can be an +alist that augments @code{find-function-regexp-alist} telling how to +find the definition of symbols of this type. In the example of a macro defining calls to @code{ert-deftest}, the macro could put the property @code{find-function-type-alist} on each diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index a2bb1834477..e807d1eb937 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1117,7 +1117,7 @@ cell). will use dynamic binding, even for new bindings such as a @code{let} binding. Depending on how the variable is declared, it can be special globally, for a single file, or for a portion of a file. -@xref{Dynamic Binding} for details. +See @ref{Dynamic Binding} for further details. @node Dynamic Binding @subsection Dynamic Binding commit 863fd1c276549fd70cd765e56f73d9649759ab90 Author: Stephen Gildea Date: Thu Jan 16 15:33:12 2025 -0800 Property definition-type becomes find-function-type-alist lisp/emacs-lisp/find-func.el (find-function-search-for-symbol): Use symbol property 'find-function-type-alist' instead of 'definition-type' (find-function-update-type-alist): New convenience function. * doc/lispref/symbols.texi (Standard Properties): Update example to use 'find-function-type-alist' and 'find-function-update-type-alist' * doc/lispref/functions.texi (Defining Functions): * doc/lispref/tips.texi (Coding Conventions): * doc/misc/ert.texi (How to Write Tests): * etc/NEWS: Change reference to 'definition-type' to name 'find-function-type-alist' instead diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index bad3c926b27..2b5847d2f64 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -754,7 +754,7 @@ to find the source code because generating a function dynamically usually looks very different from the usual static calls to @code{defun}. You can make the job of finding the code that generates such functions easier by using the @code{definition-name} -or @code{definition-type} property, @pxref{Standard Properties}. +or @code{find-function-type-alist} property, @pxref{Standard Properties}. @cindex override existing functions @cindex redefine existing functions diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi index 508ee13a244..5ac2a32dba0 100644 --- a/doc/lispref/symbols.texi +++ b/doc/lispref/symbols.texi @@ -536,9 +536,9 @@ Do not set them directly; they are managed by @code{defcustom} and related functions. @xref{Variable Definitions}. @cindex @code{definition-name} (symbol property) -@cindex @code{definition-type} (symbol property) +@cindex @code{find-function-type-alist} (symbol property) @item definition-name -@itemx definition-type +@itemx find-function-type-alist These properties help find the definition of a symbol in the source code when it might be hard to find the definition by textual search of the source file. @@ -563,16 +563,19 @@ definition of another symbol. For example, a test file might use a macro to generate calls to @code{ert-deftest} (@pxref{,,,ert, ERT: Emacs Lisp Regression Testing}) where the code is boiler plate and only varying data need to be passed in. -In such cases, the @code{definition-type} property of the symbol can -be a symbol that has an entry in @code{find-function-regexp-alist} +In such cases, the @code{find-function-type-alist} property of the +symbol can be an alist that augments @code{find-function-regexp-alist} telling how to find the definition of symbols of this type. In the example of a macro defining calls to @code{ert-deftest}, -the macro could put the property @code{definition-type} on each -test defined. The file defining the macro would also define a -definition-finding function or regexp and add it to -@code{find-function-regexp-alist} after that variable is loaded. -Here is an example using a function to find the definition: +the macro could put the property @code{find-function-type-alist} on each +test defined, associating @code{ert--test} (the internal type of ERT +tests) with the name of a regexp or function that can find the correct +macro call. The file defining the macro would also have to provide that +definition-finding function or regexp. +Here is an example using a function to find the definition. +The example updates the property using convenience function +@code{find-function-update-type-alist}. @example @group @@ -581,29 +584,19 @@ Here is an example using a function to find the definition: (declare (debug (&rest sexp))) (let ((test-name (intern (concat ...)))) `(progn - (put ',test-name 'definition-type 'foo-test-type) - (ert-deftest ,test-name () - ,(concat "Test foo with " ...) - ...)))) + (find-function-update-type-alist + ',test-name 'ert--test 'foo-find-test-def-function) + (ert-deftest ,test-name () + ,(concat "Test foo with " ...) + ...)))) @end group @group (defun foo-find-test-def-function (test-name) "Search for the `define-foo-test' call defining TEST-NAME. Return non-nil if the definition is found." - (save-match-data - (let ((regexp ...)) - (save-restriction - (widen) - (goto-char (point-min)) - (re-search-forward regexp nil t))))) -@end group - -@group -(with-eval-after-load "find-func" - (add-to-list - 'find-function-regexp-alist - '(foo-test-type . foo-find-test-def-function))) + (let ((regexp ...)) + (re-search-forward regexp nil t))) @end group @end example diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index c2fba3cba8d..1bf52886971 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -228,7 +228,7 @@ definition automatically. Avoid constructing the names in the macro itself, since that would confuse these tools. If your macro cannot be written in this style, the macro can still help these tools find the defining call by putting the property -@code{definition-name} or @code{definition-type} on the name. +@code{definition-name} or @code{find-function-type-alist} on the name. @xref{Standard Properties}. @item diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index c8aac971ec7..0e03afc98ff 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -524,7 +524,7 @@ find where a test was defined only if the test was loaded from a file. If the test definition is generated by a macro, the macro may want to help ERT find the defining call to the macro by putting the property -@code{definition-type} on the test name. +@code{find-function-type-alist} on the test name. @xref{Standard Properties,,,elisp, GNU Emacs Lisp Reference Manual}. diff --git a/etc/NEWS b/etc/NEWS index 9efe16da791..e86bb80cec8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1175,11 +1175,14 @@ It offers a more concise way to create a completion table with metadata. ** 'all-completions' and 'unintern' no longer support old calling conventions. +++ -** New symbol property 'definition-type' used by 'find-function' and friends. +** New symbol property 'find-function-type-alist' used by 'find-function' etc. Macros that define an object in a way that makes the object's name and -the macro call site defining the object hard to associate can put the -property 'definition-type' on the object's name to provide instructions -for finding the definition. +the macro call site defining the object hard to associate can add an +entry to the property 'find-function-type-alist' on the object's name to +provide instructions for finding the definition. + +New convenience function 'find-function-update-type-alist' offers a +concise way to update a symbol's 'find-function-type-alist' property. * Changes in Emacs 31.1 on Non-Free Operating Systems diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 40bcdfe756a..c367d4a3624 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -152,7 +152,11 @@ Each regexp variable's value should actually be a format string to be used to substitute the desired symbol name into the regexp. Instead of regexp variable, types can be mapped to functions as well, in which case the function is called with one argument (the object -we're looking for) and it should search for it.") +we're looking for) and it should search for it. + +Symbols can have their own version of this alist on +the property `find-function-type-alist'. +See the function `find-function-update-type-alist'.") (put 'find-function-regexp-alist 'risky-local-variable t) (define-obsolete-variable-alias 'find-function-source-path @@ -402,9 +406,9 @@ or just (BUFFER . nil) if the definition can't be found in the file. If TYPE is nil, look for a function definition, otherwise, TYPE specifies the kind of definition. -If SYMBOL has a property `definition-type', -the property value is used instead of TYPE. -TYPE is interpreted via `find-function-regexp-alist'. +TYPE is looked up in SYMBOL's property `find-function-type-alist' +(which can be maintained with `find-function-update-type-alist') +or the variable `find-function-regexp-alist'. The search is done in the source for library LIBRARY." (if (null library) @@ -413,9 +417,6 @@ The search is done in the source for library LIBRARY." ;; that defines something else. (while (and (symbolp symbol) (get symbol 'definition-name)) (setq symbol (get symbol 'definition-name))) - (setq type (or (and (symbolp symbol) - (get symbol 'definition-type)) - type)) (if (string-match "\\`src/\\(.*\\.\\(c\\|m\\)\\)\\'" library) (find-function-C-source symbol (match-string 1 library) type) (when (string-match "\\.el\\(c\\)\\'" library) @@ -425,7 +426,10 @@ The search is done in the source for library LIBRARY." (when (string-match "\\.emacs\\(.el\\)\\'" library) (setq library (substring library 0 (match-beginning 1)))) (let* ((filename (find-library-name library)) - (regexp-symbol (cdr (assq type find-function-regexp-alist)))) + (regexp-symbol + (or (and (symbolp symbol) + (alist-get type (get symbol 'find-function-type-alist))) + (alist-get type find-function-regexp-alist)))) (with-current-buffer (find-file-noselect filename) (let ((regexp (if (functionp regexp-symbol) regexp-symbol (format (symbol-value regexp-symbol) @@ -467,6 +471,13 @@ The search is done in the source for library LIBRARY." (find-function--search-by-expanding-macros (current-buffer) symbol type)))))))))) +;;;###autoload +(defun find-function-update-type-alist (symbol type variable) + "Update SYMBOL property `find-function-type-alist' with (TYPE . VARIABLE). +Property `find-function-type-alist' is a symbol-specific version +of variable `find-function-regexp-alist' and has the same format." + (setf (alist-get type (get symbol 'find-function-type-alist)) variable)) + (defun find-function--try-macroexpand (form) "Try to macroexpand FORM in full or partially. This is a best-effort operation in which if macroexpansion fails, commit dace7fa2ab468aeeca664541490eb9f291427a63 Author: Stefan Monnier Date: Thu Jan 16 17:48:21 2025 -0500 (cl-block, cl-return-from): Fix bug#75498 * lisp/emacs-lisp/cl-macs.el (cl-block, cl-return-from): Change encoding so it obeys variable coping (i.e. lexical scoping when `lexical-binding` is non-nil). (cl--block-wrapper, cl--block-throw): Adjust accordingly. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--test-cl-block-lexbind-bug-75498): New test. diff --git a/etc/NEWS b/etc/NEWS index 5d056711ebd..9efe16da791 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -383,6 +383,9 @@ Emacs 25.1), and gnudoit (obsolete since Emacs 25.1). *** 'cl-labels' now also accepts '(FUNC EXP)' bindings, like 'cl-flet'. Such bindings make it possible to compute which function to bind to FUNC. +--- +*** 'cl-block' names are now lexically scoped, as documented. + ** Whitespace --- diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 01e7b35cc52..7559c58e77a 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -901,9 +901,13 @@ references may appear inside macro expansions, but not inside functions called from BODY." (declare (indent 1) (debug (symbolp body))) (if (cl--safe-expr-p `(progn ,@body)) `(progn ,@body) - `(cl--block-wrapper - (catch ',(intern (format "--cl-block-%s--" name)) - ,@body)))) + (let ((var (intern (format "--cl-block-%s--" name)))) + `(cl--block-wrapper + ;; Build a unique "tag" in the form of a fresh cons. + ;; We include `var' in the cons, just in case it help debugging. + (let ((,var (cons ',var nil))) + (catch ,var + ,@body)))))) ;;;###autoload (defmacro cl-return (&optional result) @@ -921,7 +925,7 @@ This is compatible with Common Lisp, but note that `defun' and `defmacro' do not create implicit blocks as they do in Common Lisp." (declare (indent 1) (debug (symbolp &optional form))) (let ((name2 (intern (format "--cl-block-%s--" name)))) - `(cl--block-throw ',name2 ,result))) + `(cl--block-throw ,name2 ,result))) ;;; The "cl-loop" macro. @@ -3672,20 +3676,24 @@ macro that returns its `&whole' argument." (defvar cl--active-block-names nil) -(cl-define-compiler-macro cl--block-wrapper (cl-form) - (let* ((cl-entry (cons (nth 1 (nth 1 cl-form)) nil)) - (cl--active-block-names (cons cl-entry cl--active-block-names)) - (cl-body (macroexpand-all ;Performs compiler-macro expansions. - (macroexp-progn (cddr cl-form)) - macroexpand-all-environment))) - ;; FIXME: To avoid re-applying macroexpand-all, we'd like to be able - ;; to indicate that this return value is already fully expanded. - (if (cdr cl-entry) - `(catch ,(nth 1 cl-form) ,@(macroexp-unprogn cl-body)) - cl-body))) +(cl-define-compiler-macro cl--block-wrapper (form) + (pcase form + (`(let ((,var . ,val)) (catch ,var . ,body)) + (let* ((cl-entry (cons var nil)) + (cl--active-block-names (cons cl-entry cl--active-block-names)) + (cl-body (macroexpand-all ;Performs compiler-macro expansions. + (macroexp-progn body) + macroexpand-all-environment))) + ;; FIXME: To avoid re-applying macroexpand-all, we'd like to be able + ;; to indicate that this return value is already fully expanded. + (if (cdr cl-entry) + `(let ((,var . ,val)) (catch ,var ,@(macroexp-unprogn cl-body))) + cl-body))) + ;; `form' was somehow mangled, god knows what happened, let's not touch it. + (_ form))) (cl-define-compiler-macro cl--block-throw (cl-tag cl-value) - (let ((cl-found (assq (nth 1 cl-tag) cl--active-block-names))) + (let ((cl-found (and (symbolp cl-tag) (assq cl-tag cl--active-block-names)))) (if cl-found (setcdr cl-found t))) `(throw ,cl-tag ,cl-value)) diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 663961dc317..628bae36e48 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el @@ -728,6 +728,15 @@ collection clause." (cons (f1 7) 8))) '(7 . 8)))) +(ert-deftest cl-macs--test-cl-block-lexbind-bug-75498 () + (should (equal + (let ((ret (lambda (f) + (cl-block a (funcall f) (cl-return-from a :ret))))) + (cl-block a + (list :oops + (funcall ret (lambda () (cl-return-from a :clo)))))) + :clo))) + (ert-deftest cl-flet/edebug () "Check that we can instrument `cl-flet' forms (bug#65344)." (with-temp-buffer commit 8fc5001ba5bc9fef3c438a070c87059fc19146a4 Author: Stefan Monnier Date: Thu Jan 16 17:18:24 2025 -0500 (asm-mode): Fix bug#75542 * lisp/progmodes/asm-mode.el (asm-mode): Be careful not to override changes in the mode map or in `comment-start`. Move the use of `asm-mode-set-comment-hook` back to where it was before commit 0cff4e67f1de. (asm-mode-set-comment-hook): Declare it obsolete. diff --git a/etc/NEWS b/etc/NEWS index 4c84919678c..5d056711ebd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -333,6 +333,11 @@ modal editing packages. * Changes in Specialized Modes and Packages in Emacs 31.1 +--- +** ASM mode +*** 'asm-mode-set-comment-hook' is obsolete. +You can now set `asm-comment-char' from 'asm-mode-hook' instead. + --- ** Ibuffer *** New column 'recency' in Ibuffer display. diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el index a2334505db9..2d1c645f42c 100644 --- a/lisp/progmodes/asm-mode.el +++ b/lisp/progmodes/asm-mode.el @@ -40,10 +40,7 @@ ;; ;; Code is indented to the first tab stop level. -;; This mode runs two hooks: -;; 1) `asm-mode-set-comment-hook' before the part of the initialization -;; depending on `asm-comment-char', and -;; 2) `asm-mode-hook' at the end of initialization. +;; This mode runs the hook `asm-mode-hook' at the end of initialization. ;;; Code: @@ -105,6 +102,8 @@ cpp-font-lock-keywords) "Additional expressions to highlight in Assembler mode.") +(make-obsolete-variable 'asm-mode-set-comment-hook 'asm-mode-hook "31.0") + ;;;###autoload (define-derived-mode asm-mode prog-mode "Assembler" "Major mode for editing typical assembler code. @@ -117,9 +116,7 @@ Features a private abbrev table and the following bindings: The character used for making comments is set by the variable `asm-comment-char' (which defaults to `?\\;'). - -Alternatively, you may set this variable in `asm-mode-set-comment-hook', -which is called near the beginning of mode initialization. +Alternatively, you may set this variable in `asm-mode-hook'. Turning on Asm mode runs the hook `asm-mode-hook' at the end of initialization. @@ -127,15 +124,18 @@ Special commands: \\{asm-mode-map}" :after-hook (progn - (run-hooks 'asm-mode-set-comment-hook) ;; Make our own local child of `asm-mode-map' ;; so we can define our own comment character. - (use-local-map (make-composed-keymap nil asm-mode-map)) - (local-set-key (vector asm-comment-char) #'asm-comment) + ;; FIXME: Use `post-self-insert-hook' instead and make it conditional + ;; on some "electricity" config var. + (unless (lookup-key asm-mode-map (vector asm-comment-char)) + (use-local-map (make-composed-keymap nil asm-mode-map)) + (local-set-key (vector asm-comment-char) #'asm-comment)) (set-syntax-table (make-syntax-table asm-mode-syntax-table)) (modify-syntax-entry asm-comment-char "< b") - (setq-local comment-start (string asm-comment-char))) + (unless (local-variable-p 'comment-start) + (setq-local comment-start (string asm-comment-char)))) (setq local-abbrev-table asm-mode-abbrev-table) (setq-local font-lock-defaults '(asm-font-lock-keywords)) @@ -143,6 +143,8 @@ Special commands: ;; Stay closer to the old TAB behavior (was tab-to-tab-stop). (setq-local tab-always-indent nil) + (run-hooks 'asm-mode-set-comment-hook) + (setq-local comment-add 1) (setq-local comment-start-skip "\\(?:\\s<+\\|/[/*]+\\)[ \t]*") (setq-local comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)") commit 78f5ea750a25145086c008991db6dd6f6dd2a466 Author: Thierry Volpiatto Date: Wed Jan 8 10:45:55 2025 +0100 Handle correctly DISPLAY-FUNCTION arg in 'bookmark--jump-via' This fixes bug #75354 where when jumping to a eww bmk to other window (or frame) the buffer is displayed both in other window and current window. Previously 'bookmark--jump-via' was calling DISPLAY-FUNCTION on the current-buffer from the new buffer created by bookmark handler (e.g. eww) now DISPLAY-FUNCTION is called on the new buffer from the current buffer (winconf is saved when calling handler). In addition to make eww bookmarks displayed properly, this fix as well w3m bookmarks and as a side effect fix the eww quit function which restore properly winconf after quitting (previously leaving two windows open). * lisp/bookmark.el (bookmark--jump-via): Fix it. diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 0048330e790..215377635f7 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1256,33 +1256,34 @@ Useful for example to unhide text in `outline-mode'.") (defun bookmark--jump-via (bookmark-name-or-record display-function) "Handle BOOKMARK-NAME-OR-RECORD, then call DISPLAY-FUNCTION. -DISPLAY-FUNCTION is called with the current buffer as argument. +DISPLAY-FUNCTION is called with the new buffer as argument. After calling DISPLAY-FUNCTION, set window point to the point specified by BOOKMARK-NAME-OR-RECORD, if necessary, run `bookmark-after-jump-hook', and then show any annotations for this bookmark." - (bookmark-handle-bookmark bookmark-name-or-record) - ;; Store `point' now, because `display-function' might change it. - (let ((point (point))) - (save-current-buffer - (funcall display-function (current-buffer))) - (let ((win (get-buffer-window (current-buffer) 0))) - (if win (set-window-point win point)))) - ;; FIXME: we used to only run bookmark-after-jump-hook in - ;; `bookmark-jump' itself, but in none of the other commands. - (when bookmark-fringe-mark - (let ((overlays (overlays-in (pos-bol) (1+ (pos-bol)))) - temp found) - (while (and (not found) (setq temp (pop overlays))) - (when (eq 'bookmark (overlay-get temp 'category)) - (setq found t))) - (unless found - (bookmark--set-fringe-mark)))) - (run-hooks 'bookmark-after-jump-hook) - (if bookmark-automatically-show-annotations + (let (buf point) + (save-window-excursion + (bookmark-handle-bookmark bookmark-name-or-record) + (setq buf (current-buffer) + point (point))) + (funcall display-function buf) + (when-let* ((win (get-buffer-window buf 0))) + (set-window-point win point)) + (when bookmark-fringe-mark + (let ((overlays (overlays-in (pos-bol) (1+ (pos-bol)))) + temp found) + (while (and (not found) (setq temp (pop overlays))) + (when (eq 'bookmark (overlay-get temp 'category)) + (setq found t))) + (unless found + (bookmark--set-fringe-mark)))) + ;; FIXME: we used to only run bookmark-after-jump-hook in + ;; `bookmark-jump' itself, but in none of the other commands. + (run-hooks 'bookmark-after-jump-hook) + (when bookmark-automatically-show-annotations ;; if there is an annotation for this bookmark, ;; show it in a buffer. - (bookmark-show-annotation bookmark-name-or-record))) + (bookmark-show-annotation bookmark-name-or-record)))) ;;;###autoload commit edec6e2264ec4269d3bcdc5fadc22c793f5af7c2 Author: Kierin Bell Date: Sat Jan 11 17:25:51 2025 -0500 Improve usability and documentation of Iroquoian input methods * lisp/leim/quail/iroquoian.el: Add variants for Mohawk and Oneida endonyms in comments and docstrings. Update the 'oneida-postfix' input method to make the most commonly used glottal stop character easiest to input. Update the 'onondaga-postfix' input method with mnemonic keys for nasals in the Onondaga Nation, New York orthography. (Bug#75448) * etc/NEWS: Add variants for Mohawk and Oneida endonyms to NEWS entry. diff --git a/etc/NEWS b/etc/NEWS index 2f04204ad94..4c84919678c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -277,12 +277,13 @@ 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ʌ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. +[Kanien’kéha / Kanyen’kéha / Onkwehonwehnéha]), 'oneida-postfix' (Oneida +[Onʌyote’a·ká· / Onyota’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 63c24cf4590..6671a1d20f1 100644 --- a/lisp/leim/quail/iroquoian.el +++ b/lisp/leim/quail/iroquoian.el @@ -27,8 +27,8 @@ ;; Input methods are implemented for all Five Nations Iroquois ;; languages: -;; - Mohawk (Kanien’kéha / Onkwehonwehnéha) -;; - Oneida (Onʌyote’a·ká· / Ukwehuwehnéha) +;; - Mohawk (Kanien’kéha / Kanyen’kéha / Onkwehonwehnéha) +;; - Oneida (Onʌyote’a·ká· / Onyota’a:ká: / Ukwehuwehnéha) ;; - Onondaga (Onųdaʔgegáʔ) ;; - Cayuga (Gayogo̱ho:nǫhnéha:ˀ) ;; - Seneca (Onödowá’ga:’) @@ -123,7 +123,7 @@ Entries are as with rules in `quail-define-rules'.") (quail-define-package "mohawk-postfix" "Mohawk" "MOH<" t - "Mohawk (Kanien’kéha) input method with postfix modifiers + "Mohawk (Kanien’kéha/Kanyen’kéha) input method with postfix modifiers Stress diacritics: @@ -216,8 +216,8 @@ Entries are as with rules in `quail-define-rules'.") Entries are as with rules in `quail-define-rules'.") (defconst iroquoian-oneida-consonant-alist - '((";;" ?\N{MODIFIER LETTER GLOTTAL STOP}) - (";'" ?\N{RIGHT SINGLE QUOTATION MARK})) + '((";;" ?\N{RIGHT SINGLE QUOTATION MARK}) + (";'" ?\N{MODIFIER LETTER GLOTTAL STOP})) "Alist of rules for consonant letters in Oneida input methods. Entries are as with rules in `quail-define-rules'.") @@ -229,7 +229,7 @@ Entries are as with rules in `quail-define-rules'.") (quail-define-package "oneida-postfix" "Oneida" "ONE<" t - "Oneida (Onʌyote’a·ká·) input method with postfix modifiers + "Oneida (Onʌyote’a·ká·/Onyota’a:ká:) input method with postfix modifiers Modifiers: @@ -258,8 +258,8 @@ Consonants: | Key | Translation | Description | |-----+-------------+--------------------------| -| ;; | ˀ | Glottal stop | -| ;\\=' | \\=’ | Glottal stop (alternate) | +| ;; | \\=’ | Glottal stop | +| ;\\=' | ˀ | Glottal stop (alternate) | h, k, l, n, s, t, w, and y are bound to a single key. @@ -393,9 +393,11 @@ Entries are as with rules in `quail-define-rules'.") Entries are as with rules in `quail-define-rules'.") (defconst iroquoian-onondaga-nasal-alist - '(("n-" ?ñ) + '(("n~" ?ñ) + ("n-" ["ñ"]) ("n--" ["n-"]) - ("N-" ?Ñ) + ("N~" ?Ñ) + ("N-" ["Ñ"]) ("N--" ["N-"])) "Alist of rules for nasal modifier letters in Onondaga input methods. Entries are as with rules in `quail-define-rules'.") @@ -433,10 +435,14 @@ Vowels: |-----------------------------------------------------------| | Onondaga Nation, New York orthography | |-----------------------------------------------------------| -| 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ñ | (same as above) | +| EN~ | EÑ | Mid front nasal vowel (capital) | +| EN- | EÑ | (same as above) | +| on~ | oñ | Back high nasal vowel | +| on- | oñ | (same as above) | +| ON~ | OÑ | Back high nasal vowel (capital) | +| ON- | OÑ | (same as above) | | a\" | ä | Low front rounded vowel | | A\" | Ä | Low front rounded vowel (capital) | |-----------------------------------------------------------| @@ -895,8 +901,8 @@ 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ʌyote’a·ká· / Ukwehuwehnéha) +- Mohawk (Kanien’kéha / Kanyen’kéha / Onkwehonwehnéha) +- Oneida (Onʌyote’a·ká· / Onyota’a:ká: / Ukwehuwehnéha) - Cayuga (Gayogo̱ho:nǫhnéha:ˀ) - Onondaga (Onųdaʔgegáʔ) - Seneca (Onödowá’ga:’) @@ -942,10 +948,14 @@ 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ñ | (same as above) | +| EN~ | EÑ | Mid front nasal vowel (capital) | +| EN- | EÑ | (same as above) | +| on~ | oñ | Back high nasal vowel | +| on- | oñ | (same as above) | +| ON~ | OÑ | Back high nasal vowel (capital) | +| ON- | OÑ | (same as above) | | a\" | ä | Low front rounded vowel | | A\" | Ä | Low front rounded vowel (capital) | | -------------------------------------------------------------------- | @@ -991,8 +1001,8 @@ Consonants: |----------------------------------------------------------------------| | Oneida | | -------------------------------------------------------------------- | -| ;\\=' | ˀ | Glottal stop | -| ;; | \\=’ | Glottal stop (alternate) | +| ;; | \\=’ | Glottal stop | +| ;\\=' | ˀ | Glottal stop (alternate) | | Single-key consonants: h k l n s t w y | |----------------------------------------------------------------------| | Onondaga | commit 7fdec438ef2538aea2cd02e91216d32348e6eb59 Author: Pip Cet Date: Thu Jan 16 15:55:30 2025 +0000 ; * src/font.c (syms_of_font): Fix typo. diff --git a/src/font.c b/src/font.c index d88757ee7a9..dfe479f9355 100644 --- a/src/font.c +++ b/src/font.c @@ -5995,7 +5995,7 @@ This variable cannot be set; trying to do so will signal an error. */); /* Because the above 3 variables are slots in the vector we create below, and because that vector is staticpro'd, we don't explicitly - staticpro the variables, to avoid wasting slots in ststicvec[]. */ + staticpro the variables, to avoid wasting slots in staticvec[]. */ staticpro (&font_style_table); font_style_table = CALLN (Fvector, Vfont_weight_table, Vfont_slant_table, Vfont_width_table); commit 8d471adecef540d49807dad114f7a11fb3fe2a95 Author: Eli Zaretskii Date: Thu Jan 16 17:51:47 2025 +0200 Fix subtle problem with updating 'font_style_table' * src/font.c (font_style_to_value): Update the Vfont_* variables to keep them in sync with their slots in 'font_style_table'. (Bug#75521) (syms_of_font): Comment on usage of DEFVAR_LISP_NOPRO. diff --git a/src/font.c b/src/font.c index 86382267a4a..d88757ee7a9 100644 --- a/src/font.c +++ b/src/font.c @@ -418,8 +418,24 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val, eassert (len < 255); elt = make_vector (2, make_fixnum (100)); ASET (elt, 1, val); - ASET (font_style_table, prop - FONT_WEIGHT_INDEX, - CALLN (Fvconcat, table, make_vector (1, elt))); + Lisp_Object new_table = CALLN (Fvconcat, table, make_vector (1, elt)); + /* Update the corresponding variable with the new value of the + modified slot of font_style_table. */ + switch (prop) + { + case FONT_WEIGHT_INDEX: + Vfont_weight_table = new_table; + break; + case FONT_SLANT_INDEX: + Vfont_slant_table = new_table; + break; + case FONT_WIDTH_INDEX: + Vfont_width_table = new_table; + break; + default: + break; + } + ASET (font_style_table, prop - FONT_WEIGHT_INDEX, new_table); return (100 << 8) | (i << 4); } else @@ -5977,6 +5993,9 @@ This variable cannot be set; trying to do so will signal an error. */); Vfont_width_table = BUILD_STYLE_TABLE (width_table); make_symbol_constant (intern_c_string ("font-width-table")); + /* Because the above 3 variables are slots in the vector we create + below, and because that vector is staticpro'd, we don't explicitly + staticpro the variables, to avoid wasting slots in ststicvec[]. */ staticpro (&font_style_table); font_style_table = CALLN (Fvector, Vfont_weight_table, Vfont_slant_table, Vfont_width_table); commit b86b8f52a6fe91af239ddda73dc4d8ee32c26fc0 Author: Eli Zaretskii Date: Thu Jan 16 17:15:42 2025 +0200 ; * lisp/emacs-lisp/rx.el: Remove extra dash. (Bug#75603) diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index a0c8e4d607f..8fbe35220f1 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -1,4 +1,4 @@ -;;; rx.el --- S-exp notation for regexps --*- lexical-binding: t -*- +;;; rx.el --- S-exp notation for regexps -*- lexical-binding: t -*- ;; Copyright (C) 2001-2025 Free Software Foundation, Inc. commit d30351e03815e5914ec486607441e449c02c6c45 Author: Stephen Gildea Date: Thu Jan 16 06:10:57 2025 -0800 Update recent find-func change to fix elisp-mode-tests * lisp/emacs-lisp/find-func.el (find-function-search-for-symbol): Check that symbol is a symbol before trying to get a property. diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 643b6aba2a6..40bcdfe756a 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -413,7 +413,8 @@ The search is done in the source for library LIBRARY." ;; that defines something else. (while (and (symbolp symbol) (get symbol 'definition-name)) (setq symbol (get symbol 'definition-name))) - (setq type (or (get symbol 'definition-type) + (setq type (or (and (symbolp symbol) + (get symbol 'definition-type)) type)) (if (string-match "\\`src/\\(.*\\.\\(c\\|m\\)\\)\\'" library) (find-function-C-source symbol (match-string 1 library) type)