commit 6ca3a60db3427bc6aef08144c1524920ff3d9c4d (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Fri May 17 09:43:20 2024 +0300 ; Avoid compiler warning in w32term.c * src/w32term.c (w32_draw_glyphless_glyph_string_foreground): Avoid GCC 14 warning about storing address of local variable. diff --git a/src/w32term.c b/src/w32term.c index a9aff304771..2bcd5d86a38 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -1455,7 +1455,7 @@ static void w32_draw_glyphless_glyph_string_foreground (struct glyph_string *s) { struct glyph *glyph = s->first_glyph; - unsigned char2b[8]; + static unsigned char2b[8]; int x, i, j; bool with_background; commit 2f7d011d180b1e8d8dc6784cd9b48cf5690b7c62 Author: Jim Porter Date: Thu May 16 20:33:18 2024 -0700 Add new Eshell built-in command 'funcall' * lisp/eshell/esh-cmd.el (eshell/funcall): New function... * test/lisp/eshell/em-glob-tests.el (em-glob-test/expand/splice-results) (em-glob-test/expand/no-splice-results) (em-glob-test/expand/explicitly-splice-results) (em-glob-test/expand/explicitly-listify-results): * test/lisp/eshell/esh-var-tests.el (esh-var-test/quoted-interp-lisp-indices) (esh-var-test/quoted-interp-cmd-indices) (esh-var-test/interp-convert-quoted-var-number) (esh-var-test/quoted-interp-convert-var-number) (esh-var-test/quoted-interp-convert-quoted-var-number) (esh-var-test/last-status-var-lisp-command) (esh-var-test/last-result-var-split-indices) (esh-var-test/last-arg-var-split-indices): ... use it in tests. * doc/misc/eshell.texi (List of Built-ins): Describe this command. diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 8cb73d4077b..57ee3bf3e9f 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -782,6 +782,14 @@ the buffer is merely buried instead. Set environment variables using input like Bash's @command{export}, as in @samp{export @var{var1}=@var{val1} @var{var2}=@var{val2} @dots{}}. +@cmindex funcall +@item funcall @var{function} [@var{arg}]@dots{} +Call @var{function} with the specified arguments (@var{function} may be +a symbol or a string naming a Lisp function). This command is useful +when you want to call an ordinary Lisp function using Eshell's command +form (@pxref{Invocation}), even if there may be an external program of +the same name. + @cmindex grep @item grep [@var{arg}]@dots{} @cmindex agrep diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index b489822f188..dae1a77552f 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -1480,6 +1480,14 @@ Print the result using `eshell-printn'; if an error occurs, print it via `eshell-errorn'." (eshell-eval* #'eshell-printn #'eshell-errorn form)) +(defun eshell/funcall (func &rest args) + "Eshell built-in command for `funcall' (which see). +This simply calls FUNC with the specified ARGS. FUNC may be a symbol or +a string naming a Lisp function." + (when (stringp func) + (setq func (intern func))) + (apply func args)) + (defvar eshell-last-output-end) ;Defined in esh-mode.el. (defun eshell-lisp-command (object &optional args) diff --git a/test/lisp/eshell/em-glob-tests.el b/test/lisp/eshell/em-glob-tests.el index d7d8f59eda0..2efb3a9df69 100644 --- a/test/lisp/eshell/em-glob-tests.el +++ b/test/lisp/eshell/em-glob-tests.el @@ -72,9 +72,9 @@ component ending in \"symlink\" is treated as a symbolic link." (eshell-glob-splice-results t)) (with-fake-files '("a.el" "b.el" "c.txt") ;; Ensure the default expansion splices the glob. - (eshell-command-result-equal "list *.el" '("a.el" "b.el")) - (eshell-command-result-equal "list *.txt" '("c.txt")) - (eshell-command-result-equal "list *.no" '("*.no"))))) + (eshell-command-result-equal "funcall list *.el" '("a.el" "b.el")) + (eshell-command-result-equal "funcall list *.txt" '("c.txt")) + (eshell-command-result-equal "funcall list *.no" '("*.no"))))) (ert-deftest em-glob-test/expand/no-splice-results () "Test that globs are treated as lists when @@ -83,11 +83,11 @@ component ending in \"symlink\" is treated as a symbolic link." (eshell-glob-splice-results nil)) (with-fake-files '("a.el" "b.el" "c.txt") ;; Ensure the default expansion splices the glob. - (eshell-command-result-equal "list *.el" '(("a.el" "b.el"))) - (eshell-command-result-equal "list *.txt" '(("c.txt"))) + (eshell-command-result-equal "funcall list *.el" '(("a.el" "b.el"))) + (eshell-command-result-equal "funcall list *.txt" '(("c.txt"))) ;; The no-matches case is special here: the glob is just the ;; string, not the list of results. - (eshell-command-result-equal "list *.no" '("*.no"))))) + (eshell-command-result-equal "funcall list *.no" '("*.no"))))) (ert-deftest em-glob-test/expand/explicitly-splice-results () "Test explicitly splicing globs works the same no matter the @@ -97,11 +97,11 @@ value of `eshell-glob-splice-results'." (ert-info ((format "eshell-glob-splice-results: %s" eshell-glob-splice-results)) (with-fake-files '("a.el" "b.el" "c.txt") - (eshell-command-result-equal "list $@{listify *.el}" + (eshell-command-result-equal "funcall list $@{listify *.el}" '("a.el" "b.el")) - (eshell-command-result-equal "list $@{listify *.txt}" + (eshell-command-result-equal "funcall list $@{listify *.txt}" '("c.txt")) - (eshell-command-result-equal "list $@{listify *.no}" + (eshell-command-result-equal "funcall list $@{listify *.no}" '("*.no"))))))) (ert-deftest em-glob-test/expand/explicitly-listify-results () @@ -112,11 +112,11 @@ value of `eshell-glob-splice-results'." (ert-info ((format "eshell-glob-splice-results: %s" eshell-glob-splice-results)) (with-fake-files '("a.el" "b.el" "c.txt") - (eshell-command-result-equal "list ${listify *.el}" + (eshell-command-result-equal "funcall list ${listify *.el}" '(("a.el" "b.el"))) - (eshell-command-result-equal "list ${listify *.txt}" + (eshell-command-result-equal "funcall list ${listify *.txt}" '(("c.txt"))) - (eshell-command-result-equal "list ${listify *.no}" + (eshell-command-result-equal "funcall list ${listify *.no}" '(("*.no")))))))) diff --git a/test/lisp/eshell/esh-var-tests.el b/test/lisp/eshell/esh-var-tests.el index b94e8a276d7..1b46b214e77 100644 --- a/test/lisp/eshell/esh-var-tests.el +++ b/test/lisp/eshell/esh-var-tests.el @@ -436,7 +436,7 @@ nil, use FUNCTION instead." (ert-deftest esh-var-test/quoted-interp-lisp-indices () "Interpolate Lisp form evaluation with index." - (eshell-command-result-equal "concat \"$(list 1 2)[1]\" cool" + (eshell-command-result-equal "funcall concat \"$(list 1 2)[1]\" cool" "2cool")) (ert-deftest esh-var-test/quoted-interp-cmd () @@ -446,7 +446,7 @@ nil, use FUNCTION instead." (ert-deftest esh-var-test/quoted-interp-cmd-indices () "Interpolate command result with index inside double-quotes." - (eshell-command-result-equal "concat \"${listify 1 2}[1]\" cool" + (eshell-command-result-equal "funcall concat \"${listify 1 2}[1]\" cool" "2cool")) (ert-deftest esh-var-test/quoted-interp-temp-cmd () @@ -504,9 +504,9 @@ nil, use FUNCTION instead." (ert-deftest esh-var-test/interp-convert-quoted-var-number () "Interpolate numeric quoted numeric variable." (let ((eshell-test-value 123)) - (eshell-command-result-equal "type-of $'eshell-test-value'" + (eshell-command-result-equal "funcall type-of $'eshell-test-value'" 'integer) - (eshell-command-result-equal "type-of $\"eshell-test-value\"" + (eshell-command-result-equal "funcall type-of $\"eshell-test-value\"" 'integer))) (ert-deftest esh-var-test/interp-convert-quoted-var-split-indices () @@ -546,7 +546,7 @@ nil, use FUNCTION instead." (ert-deftest esh-var-test/quoted-interp-convert-var-number () "Interpolate numeric variable inside double-quotes." (let ((eshell-test-value 123)) - (eshell-command-result-equal "type-of \"$eshell-test-value\"" + (eshell-command-result-equal "funcall type-of \"$eshell-test-value\"" 'string))) (ert-deftest esh-var-test/quoted-interp-convert-var-split-indices () @@ -560,10 +560,11 @@ nil, use FUNCTION instead." (ert-deftest esh-var-test/quoted-interp-convert-quoted-var-number () "Interpolate numeric quoted variable inside double-quotes." (let ((eshell-test-value 123)) - (eshell-command-result-equal "type-of \"$'eshell-test-value'\"" + (eshell-command-result-equal "funcall type-of \"$'eshell-test-value'\"" 'string) - (eshell-command-result-equal "type-of \"$\\\"eshell-test-value\\\"\"" - 'string))) + (eshell-command-result-equal + "funcall type-of \"$\\\"eshell-test-value\\\"\"" + 'string))) (ert-deftest esh-var-test/quoted-interp-convert-quoted-var-split-indices () "Interpolate quoted string variable with indices inside double-quotes." @@ -905,11 +906,11 @@ the value of the $PAGER env var." (ert-deftest esh-var-test/last-status-var-lisp-command () "Test using the \"last exit status\" ($?) variable with a Lisp command." (with-temp-eshell - (eshell-match-command-output "zerop 0; echo $?" + (eshell-match-command-output "funcall zerop 0; echo $?" "t\n0\n") - (eshell-match-command-output "zerop 1; echo $?" + (eshell-match-command-output "funcall zerop 1; echo $?" "0\n") - (eshell-match-command-output "zerop foo; echo $?" + (eshell-match-command-output "funcall zerop foo; echo $?" "1\n" nil t))) (ert-deftest esh-var-test/last-status-var-lisp-form () @@ -972,10 +973,10 @@ This tests when `eshell-lisp-form-nil-is-failure' is nil." "Test using the \"last result\" ($$) variable with split indices." (with-temp-eshell (eshell-match-command-output - "string-join (list \"01\" \"02\") :; + $$[: 1] 3" + "funcall string-join (list \"01\" \"02\") :; + $$[: 1] 3" "01:02\n5\n") (eshell-match-command-output - "string-join (list \"01\" \"02\") :; echo \"$$[: 1]\"" + "funcall string-join (list \"01\" \"02\") :; echo \"$$[: 1]\"" "01:02\n02\n"))) (ert-deftest esh-var-test/last-arg-var () @@ -995,9 +996,11 @@ This tests when `eshell-lisp-form-nil-is-failure' is nil." (ert-deftest esh-var-test/last-arg-var-split-indices () "Test using the \"last arg\" ($_) variable with split indices." (with-temp-eshell - (eshell-match-command-output "concat 01:02 03:04; + $_[0][: 1] 5" - "01:0203:04\n7\n") - (eshell-match-command-output "concat 01:02 03:04; echo \"$_[0][: 1]\"" - "01:0203:04\n02\n"))) + (eshell-match-command-output + "funcall concat 01:02 03:04; + $_[1][: 1] 5" + "01:0203:04\n7\n") + (eshell-match-command-output + "funcall concat 01:02 03:04; echo \"$_[1][: 1]\"" + "01:0203:04\n02\n"))) ;; esh-var-tests.el ends here commit 113bd2082c982df933df9b12c3994d6d582c8268 Author: Dmitry Gutov Date: Fri May 17 01:05:17 2024 +0300 ; Fix search in remote project with relative file names diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 9013729c505..ecaeac18c3a 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -2101,7 +2101,10 @@ Such as the current syntax table and the applied syntax properties." (defun xref--convert-hits (hits regexp) (let (xref--last-file-buffer (tmp-buffer (generate-new-buffer " *xref-temp*")) - (xref--hits-remote-id (file-remote-p default-directory)) + (xref--hits-remote-id (if (file-name-absolute-p (cadar hits)) + ;; TODO: Add some test for this. + (file-remote-p default-directory) + default-directory)) (syntax-needed (xref--regexp-syntax-dependent-p regexp))) (unwind-protect (mapcan (lambda (hit) commit 54a7268763138fdc63bf81feca99013b01337872 Author: Harald Jörg Date: Thu May 16 22:22:37 2024 +0200 ; cperl-mode.el: prevent Emacs from "freezing" (Bug#70948) * cperl-mode.el (defconst): Replace the rx expression for `cperl--basic-identifier-rx' with its actual macro expansion. This makes it efficient under Emacs 29.3, where the expansion by rx.el could make Emacs freeze with a crafted Perl source (Bug#70948). diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 81ecb535b82..cbc23507fca 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1178,7 +1178,12 @@ The expansion is entirely correct because it uses the C preprocessor." (eval-and-compile (defconst cperl--basic-identifier-rx - '(sequence (or alpha "_") (* (or word "_"))) + ;; The rx expression in the following line is a workaround for + ;; bug#70948 under Emacs 29 + '(regex "[_[:alpha:]][_[:word:]]*") + ;; The rx expression in the following line is equivalent but + ;; inefficient under Emacs 29.3 + ;; '(sequence (or alpha "_") (* (or word "_"))) "A regular expression for the name of a \"basic\" Perl variable. Neither namespace separators nor sigils are included. As is, this regular expression applies to labels,subroutine calls where commit 96269209a3e22707635239d057be4feac217b4bc Author: Harald Jörg Date: Thu May 16 21:55:07 2024 +0200 ;cperl-mode.el: Allow running under Emacs >=27 I would like to advertise cperl-mode.el from the repository as a workaround for bug#70948. This can be achieved by safeguarding the call to derived-mode-add-parents with a version check. * lisp/progmodes/cperl-mode.el: Call derived-mode-add-parents only if it is available. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 11709bfe00b..81ecb535b82 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1934,7 +1934,8 @@ or as help on variables `cperl-tips', `cperl-problems', ;; Setup Flymake (add-hook 'flymake-diagnostic-functions #'perl-flymake nil t)) -(derived-mode-add-parents 'cperl-mode '(perl-mode)) +(when (fboundp 'derived-mode-add-parents) ; to run under Emacs <30 + (derived-mode-add-parents 'cperl-mode '(perl-mode))) (defun cperl--set-file-style () (when cperl-file-style commit 650ee9e071eea2ff8504e056131efa9f6ac894e9 Author: Philip Kaludercic Date: Thu May 16 19:51:11 2024 +0200 ; Fix wrong-type-argument in 'rcirc-handler-INVITE' * lisp/net/rcirc.el (rcirc-handler-INVITE): Use 'with-rcirc-process-buffer' instead of passing a process to 'buffer-local-value'. diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 0835d25460c..b913ba9e0a3 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -3694,7 +3694,7 @@ Passwords are stored in `rcirc-authinfo' (which see)." "Notify user of an invitation from SENDER. ARGS should have the form (TARGET CHANNEL). PROCESS is the process object for the current connection." - (let ((self (buffer-local-value 'rcirc-nick rcirc-process)) + (let ((self (with-rcirc-process-buffer process rcirc-nick)) (target (car args)) (chan (cadr args))) ;; `rcirc-channel-filter' is not used here because joining commit acfb2c6163b60507801fb8666129925e793394c9 Author: Stefan Monnier Date: Thu May 16 11:01:11 2024 -0400 (describe-package-1): Handle (nil . "string") in `:maintainer` * lisp/emacs-lisp/package.el (describe-package-1): Refine the check to distinguish the old single-maintainer format from the new multi-maintainer format. (bug#69712) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 8c915766e1c..fda855d2143 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2947,7 +2947,7 @@ Helper function for `describe-package'." (insert " ")) (insert "\n")) (when maintainers - (when (stringp (car maintainers)) + (unless (and (listp (car maintainers)) (listp (cdr maintainers))) (setq maintainers (list maintainers))) (package--print-help-section (if (cdr maintainers) "Maintainers" "Maintainer")) commit ee3ef57c24fe3435cd896e1f096aadff5f9372a0 Author: Stefan Monnier Date: Thu May 16 09:50:39 2024 -0400 * lisp/loadup.el: Add workaround for occasional "bootstrap" failure diff --git a/lisp/loadup.el b/lisp/loadup.el index c6a8dcbb909..aab1231c8be 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -191,6 +191,23 @@ (setq definition-prefixes new)) (load "button") ;After loaddefs, because of define-minor-mode! + +(when (interpreted-function-p (symbol-function 'add-hook)) + ;; `subr.el' is needed early and hence can't use macros like `setf' + ;; liberally. Yet, it does use such macros in code that it knows will not + ;; be executed too early, such as `add-hook'. Usually, by the time we + ;; run that code, either `subr.el' was already compiled to start with + ;; or on the contrary many files aren't compiled yet and have thus caused + ;; macro packages like `gv' to be loaded. But not always. + ;; The specific error we're trying to work around, here, occurs when + ;; `cl-preloaded's `provide' ends up (because of an `eval-after-load') + ;; calling `add-hook' which burps with a "void-function setf" on + ;; (setf (get hook 'hook--depth-alist) depth-sym)'. + ;; FIXME: We should probably split `subr.el' into one that's loaded early + ;; where we refrain from using macros like `setf', and another loaded later + ;; where we can blissfully `require' packages like `gv'. + (require 'gv)) + (load "emacs-lisp/cl-preloaded") (load "emacs-lisp/oclosure") ;Used by cl-generic (load "obarray") ;abbrev.el is implemented in terms of obarrays. commit cdf49336cd06c433d2aa7795672aebe413c92f54 Author: Robert Pluim Date: Tue May 14 17:41:57 2024 +0200 Add multi/unibyte string tests for key-description * test/src/keymap-tests.el (keymap--key-description): Add multi/unibyte tests. This is to check the fix for Bug#59305. diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index 04b897045db..e968a19eadf 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el @@ -357,6 +357,13 @@ g .. h foo "C-x ")) (should (equal (key-description [M-H-right] [?\C-x]) "C-x M-H-")) + ;; Treat latin-1 correctly vs meta. (Bug#59305) + (should (equal (key-description "olá") + "o l á")) + (should (equal (key-description (string ?o ?l ?á)) + "o l á")) + (should (equal (key-description (unibyte-string ?o ?l ?á)) + "o l M-a")) (should (equal (single-key-description 'home) "")) (should (equal (single-key-description 'home t) commit c22b91fd9ca7625a7a4f2d817552f19cc56ee310 Author: Robert Pluim Date: Tue May 14 17:35:04 2024 +0200 * doc/emacs/mule.texi (Unibyte Mode): Mention iso-transl-set-language diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index ab6125f5745..55dd74c48a3 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -1871,6 +1871,12 @@ they too are defined to compose with the following character, once @code{iso-transl} is loaded. Use @kbd{C-x 8 C-h} to list all the available @kbd{C-x 8} translations. + +The set of translations available can be extended with certain +language-specific characters using the @kbd{M-x iso-transl-set-language} +command. Current supported languages are: @samp{French}, @samp{German}, +@samp{Portuguese}, @samp{Spanish}, and @samp{Esperanto}. See +@code{iso-transl-language-alist} for details. @end itemize @node Charsets