commit fb15f86248667063c45097d0036cc0b2d9309043 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Fri Sep 19 09:28:17 2025 +0800 ; * src/bytecode.c (exec_byte_code): Fix coding style. diff --git a/src/bytecode.c b/src/bytecode.c index 424d00f20ec..9bdc2eaeefe 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -961,7 +961,7 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, { /* No need to restore old quitcounter; just check at the next backward branch. */ - quitcounter = (unsigned char)-1; + quitcounter = (unsigned char) -1; struct handler *c = handlerlist; handlerlist = c->next; top = c->bytecode_top; commit 7d5633d0f4785881fc3a1ad302b0a8d3f11dcc25 Author: Mattias EngdegÄrd Date: Thu Sep 18 22:10:55 2025 +0200 * src/bytecode.c (exec_byte_code): Better quitcounter reset value. This value forces a quit check at the next backward branch, to avoid rare situations being hard to interrupt. Suggested by Pip Cet. diff --git a/src/bytecode.c b/src/bytecode.c index 318b96a12be..424d00f20ec 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -959,7 +959,9 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, if (sys_setjmp (c->jmp)) { - quitcounter = 1; /* no need to restore old value */ + /* No need to restore old quitcounter; just check at the next + backward branch. */ + quitcounter = (unsigned char)-1; struct handler *c = handlerlist; handlerlist = c->next; top = c->bytecode_top; commit 27853a2bca63b339bb2264d6c92c7c5ddcd51a75 Author: Juri Linkov Date: Thu Sep 18 18:20:15 2025 +0300 * lisp/textmodes/mhtml-ts-mode.el: Fix for recent changes in js-ts-mode. (mhtml-ts-mode--treesit-font-lock-settings): Replace variable 'js--treesit-font-lock-settings' with the function call. (mhtml-ts-mode--treesit-indent-rules): Replace variable 'js--treesit-indent-rules' with the function call (bug#79363). diff --git a/lisp/textmodes/mhtml-ts-mode.el b/lisp/textmodes/mhtml-ts-mode.el index 793e28ed0de..94350d6d304 100644 --- a/lisp/textmodes/mhtml-ts-mode.el +++ b/lisp/textmodes/mhtml-ts-mode.el @@ -261,7 +261,7 @@ NODE and PARENT are ignored." (defvar mhtml-ts-mode--treesit-font-lock-settings (append html-ts-mode--font-lock-settings - js--treesit-font-lock-settings + (js--treesit-font-lock-settings) ;; Let's replace a css rule with a new one that adds color to ;; the css value. (treesit-replace-font-lock-feature-settings @@ -308,7 +308,7 @@ NODE and PARENT are ignored." `((javascript ((parent-is "program") mhtml-ts-mode--js-css-tag-bol mhtml-ts-mode--js-css-indent-offset))) - js--treesit-indent-rules + (js--treesit-indent-rules) :replace) (treesit-simple-indent-modify-rules 'css commit 0767f1818a25f1efeefeb24a96eecf553396b2ed Author: Mattias EngdegÄrd Date: Thu Sep 18 16:25:02 2025 +0200 Don't save quitcounter across longjmp in exec_byte_code * src/bytecode.c (exec_byte_code): Reset quitcounter to 1 after longjmp; the exact value isn't important. This may reduce register pressure a tiny bit or at least remove a useless stack slot. diff --git a/src/bytecode.c b/src/bytecode.c index debb08c2347..318b96a12be 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -526,7 +526,6 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, for (ptrdiff_t i = nargs - rest; i < nonrest; i++) PUSH (Qnil); - unsigned char volatile saved_quitcounter; #if GCC_LINT && __GNUC__ && !__clang__ Lisp_Object *volatile saved_vectorp; unsigned char const *volatile saved_bytestr_data; @@ -960,7 +959,7 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, if (sys_setjmp (c->jmp)) { - quitcounter = saved_quitcounter; + quitcounter = 1; /* no need to restore old value */ struct handler *c = handlerlist; handlerlist = c->next; top = c->bytecode_top; @@ -990,7 +989,6 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, goto op_branch; } - saved_quitcounter = quitcounter; #if GCC_LINT && __GNUC__ && !__clang__ saved_vectorp = vectorp; saved_bytestr_data = bytestr_data; commit 979ddc06019cce249a9ada359b85f3cd4b6a0149 Author: Michael Albinus Date: Thu Sep 18 14:56:05 2025 +0200 Fix failed tests on emba * test/lisp/autorevert-tests.el (auto-revert-test05-global-notify) (auto-revert-test07-auto-revert-several-buffers): Adapt tests. * test/src/comp-resources/comp-test-funcs.el (foo): Define error symbol. diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el index ca38084b2b5..8f00996d584 100644 --- a/test/lisp/autorevert-tests.el +++ b/test/lisp/autorevert-tests.el @@ -572,7 +572,7 @@ Set modified file time in order to trigger auto-revert." nil 'local)))) (ert-deftest auto-revert-test05-global-notify () - "Test `global-auto-revert-mode' without polling." + "Test `global-auto-revert-mode'." (skip-unless (or file-notify--library (file-remote-p auto-revert--test-rootdir))) @@ -584,7 +584,6 @@ Set modified file time in order to trigger auto-revert." (ert-with-temp-file file-3 :prefix ert-temp-file-prefix (let ((auto-revert-use-notify t) - (auto-revert-avoid-polling t) (was-in-global-auto-revert-mode global-auto-revert-mode) (file-2b (concat file-2 "-b")) require-final-newline buf-1 buf-2 buf-3) @@ -592,8 +591,12 @@ Set modified file time in order to trigger auto-revert." (progn (setq buf-1 (find-file-noselect file-1)) (auto-revert-test--instrument-kill-buffer-hook buf-1) + (should-not (buffer-local-value 'auto-revert-mode buf-1)) + (should-not (buffer-local-value 'auto-revert--global-mode buf-1)) (setq buf-2 (find-file-noselect file-2)) (auto-revert-test--instrument-kill-buffer-hook buf-2) + (should-not (buffer-local-value 'auto-revert-mode buf-2)) + (should-not (buffer-local-value 'auto-revert--global-mode buf-2)) ;; File stamps of remote files have an accuracy of 1 ;; second. Wait a little bit. (when (file-remote-p file-1) @@ -604,6 +607,10 @@ Set modified file time in order to trigger auto-revert." (global-auto-revert-mode 1) ; Turn it on. (auto-revert--skip-unless-proper-library-and-monitor buf-1) + (should-not (buffer-local-value 'auto-revert-mode buf-1)) + (should (buffer-local-value 'auto-revert--global-mode buf-1)) + (should-not (buffer-local-value 'auto-revert-mode buf-2)) + (should (buffer-local-value 'auto-revert--global-mode buf-2)) ;; buf-1 should have been reverted immediately when the mode ;; was enabled. @@ -611,23 +618,17 @@ Set modified file time in order to trigger auto-revert." (string-equal (auto-revert-test--buffer-string buf-1) "1-a")) ;; Alter a file. - (ert-with-message-capture auto-revert--messages - (auto-revert-test--write-region "2-a" file-2 buf-2) - (auto-revert--wait-for-revert buf-2)) + (auto-revert-test--write-region "2-a" file-2) + (auto-revert-test--wait-for-buffer-text + buf-2 "2-a" (auto-revert--timeout)) (should (string-equal (auto-revert-test--buffer-string buf-2) "2-a")) ;; Visit a file, and modify it on disk. (setq buf-3 (find-file-noselect file-3)) (auto-revert-test--instrument-kill-buffer-hook buf-3) - ;; Newly opened buffers won't be use notification until the - ;; first poll cycle; wait for it. - (auto-revert-test--wait-for - (lambda () (buffer-local-value - 'auto-revert-notify-watch-descriptor buf-3)) - (auto-revert--timeout)) - (should (buffer-local-value - 'auto-revert-notify-watch-descriptor buf-3)) + (should-not (buffer-local-value 'auto-revert-mode buf-3)) + (should (buffer-local-value 'auto-revert--global-mode buf-3)) (auto-revert-test--write-region "3-a" file-3) (auto-revert-test--wait-for-buffer-text buf-3 "3-a" (auto-revert--timeout)) @@ -644,8 +645,6 @@ Set modified file time in order to trigger auto-revert." ;; while polling. So increase the timeout. (auto-revert-test--wait-for-buffer-text buf-1 "1-b" (* 2 (auto-revert--timeout))) - (should (buffer-local-value - 'auto-revert-notify-watch-descriptor buf-1)) ;; Write a buffer to a new file, then modify the new ;; file on disk. @@ -655,9 +654,7 @@ Set modified file time in order to trigger auto-revert." (string-equal (auto-revert-test--buffer-string buf-2) "2-a")) (auto-revert-test--write-region "2-b" file-2b) (auto-revert-test--wait-for-buffer-text - buf-2 "2-b" (auto-revert--timeout)) - (should (buffer-local-value - 'auto-revert-notify-watch-descriptor buf-2))) + buf-2 "2-b" (auto-revert--timeout))) ;; Clean up. (unless was-in-global-auto-revert-mode @@ -776,9 +773,6 @@ Set modified file time in order to trigger auto-revert." (auto-revert-mode 0) (should-not auto-revert-mode)) (with-current-buffer (car buffers) - (should - (buffer-local-value - 'auto-revert-notify-watch-descriptor (current-buffer))) (should auto-revert-mode))) ;; Killing an indirect buffer does not disable autorevert in @@ -786,9 +780,6 @@ Set modified file time in order to trigger auto-revert." (dolist (buf (cdr buffers)) (kill-buffer buf)) (with-current-buffer (car buffers) - (should - (buffer-local-value - 'auto-revert-notify-watch-descriptor (current-buffer))) (should auto-revert-mode))) ;; Exit. diff --git a/test/src/comp-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el index 5154b875499..04e3afe49fa 100644 --- a/test/src/comp-resources/comp-test-funcs.el +++ b/test/src/comp-resources/comp-test-funcs.el @@ -261,6 +261,8 @@ (defun comp-tests-trampoline-removal-f () (make-hash-table)) +(define-error 'foo "foo") + (defun comp-tests-signal-f () (signal 'foo t)) commit dd622e06e7db8362ecdb69ecbd42b2fb01a5168b Author: Andrea Corallo Date: Thu Sep 18 11:24:18 2025 +0200 * Clean-up some compilation warnings in vc-hooks.el * lisp/vc/vc-hooks.el(vc-diff-outgoing-base) (vc-root-diff-outgoing-base, vc-apply-to-other-working-tree) (vc-apply-root-to-other-working-tree): Declare. diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index da67f7f1815..15ec3adf00e 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -31,6 +31,12 @@ (eval-when-compile (require 'cl-lib)) +(declare-function vc-diff-outgoing-base "vc" (&optional upstream-location fileset)) +(declare-function vc-root-diff-outgoing-base "vc" (&optional upstream-location)) +(declare-function vc-apply-to-other-working-tree "vc" (directory &optional move)) +(declare-function vc-apply-root-to-other-working-tree "vc" + (directory &optional move preview)) + ;; Faces (defgroup vc-faces nil commit d3a2541798e1c2f6f900c4fd72ec46807a23d9d1 Author: Sean Whitton Date: Thu Sep 18 12:48:32 2025 +0100 Refactor vc-git checkin functions * lisp/vc/vc-git.el (vc-git-patch-string): Delete. All uses changed. (vc-git--checkin): Rename vc-git-checkin to this. (vc-git-checkin-patch, vc-git-checkin): New wrapper functions. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index eb2f6037dbd..e9539616765 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1109,12 +1109,6 @@ It is based on `log-edit-mode', and has Git-specific extensions." (1 'vc-git-log-edit-summary-target-warning prepend t) (2 'vc-git-log-edit-summary-max-warning prepend t)))))) -(defvar vc-git-patch-string nil) - -(defun vc-git-checkin-patch (patch-string comment) - (let ((vc-git-patch-string patch-string)) - (vc-git-checkin nil comment))) - (autoload 'vc-switches "vc") (defun vc-git--log-edit-extract-headers (comment) @@ -1143,7 +1137,12 @@ It is based on `log-edit-mode', and has Git-specific extensions." (defalias 'vc-git-async-checkins #'always) -(defun vc-git-checkin (files comment &optional _rev) +(defun vc-git--checkin (comment &optional files patch-string) + "Workhorse routine for `vc-git-checkin' and `vc-git-checkin-patch'. +COMMENT is the commit message. +For a regular checkin, FILES is the list of files to check in. +To check in a patch, PATCH-STRING is the patch text. +It is an error to supply both or neither." (let* ((file1 (or (car files) default-directory)) (root (vc-git-root file1)) (default-directory (expand-file-name root)) @@ -1167,7 +1166,7 @@ It is based on `log-edit-mode', and has Git-specific extensions." default-directory))) (make-nearby-temp-file "git-msg")))) to-stash) - (when vc-git-patch-string + (when patch-string (unless (zerop (vc-git-command nil t nil "diff" "--cached" "--quiet")) ;; Check that what's already staged is compatible with what ;; we want to commit (bug#60126). @@ -1200,23 +1199,23 @@ It is based on `log-edit-mode', and has Git-specific extensions." (when (and (looking-at "^diff --git a/\\(.+\\) b/\\(.+\\)") (string= (match-string 1) (match-string 2))) (setq file-name (match-string 1))) - (forward-line 1) ; skip current "diff --git" line + (forward-line 1) ; skip current "diff --git" line (setq file-header (buffer-substring pos (point))) (search-forward "diff --git" nil 'move) (move-beginning-of-line 1) (setq file-diff (buffer-substring pos (point))) - (cond ((and (setq file-beg (string-search - file-diff vc-git-patch-string)) + (cond ((and (setq file-beg + (string-search file-diff patch-string)) ;; Check that file diff ends with an empty string ;; or the beginning of the next file diff. (string-match-p "\\`\\'\\|\\`diff --git" - (substring - vc-git-patch-string - (+ file-beg (length file-diff))))) - (setq vc-git-patch-string - (string-replace file-diff "" vc-git-patch-string))) + (substring patch-string + (+ file-beg + (length file-diff))))) + (setq patch-string + (string-replace file-diff "" patch-string))) ((string-match (format "^%s" (regexp-quote file-header)) - vc-git-patch-string) + patch-string) (if (and file-name (yes-or-no-p (format "Unstage already-staged changes to %s?" @@ -1225,7 +1224,7 @@ It is based on `log-edit-mode', and has Git-specific extensions." (user-error "Index not empty"))) (t (push file-name to-stash))) (setq pos (point)))))) - (unless (string-empty-p vc-git-patch-string) + (unless (string-empty-p patch-string) (let (;; Temporarily countermand the let-binding at the ;; beginning of this function. (coding-system-for-write @@ -1236,9 +1235,9 @@ It is based on `log-edit-mode', and has Git-specific extensions." (or pcsw vc-git-commits-coding-system) 'unix))) (vc-git--with-apply-temp-to-staging patch (with-temp-file patch - (insert vc-git-patch-string))))) + (insert patch-string))))) (when to-stash (vc-git--stash-staged-changes to-stash))) - (let ((files (and only (not vc-git-patch-string) files)) + (let ((files (and only (not patch-string) files)) (args (vc-git--log-edit-extract-headers comment)) (buffer (format "*vc-git : %s*" (expand-file-name root))) (post @@ -1262,7 +1261,7 @@ It is based on `log-edit-mode', and has Git-specific extensions." ;; When operating on the whole tree, better pass ;; "-a" than ".", since "." fails when we're ;; committing a merge. - (and (not vc-git-patch-string) + (and (not patch-string) (if only (list "--only" "--") '("-a"))))) (if vc-async-checkin (progn (vc-wait-for-process-before-save @@ -1278,6 +1277,15 @@ It is based on `log-edit-mode', and has Git-specific extensions." (apply #'vc-git-command nil 0 files args) (funcall post))))) +(defun vc-git-checkin-patch (patch-string comment) + "Git-specific version of `vc-BACKEND-checkin-patch'." + (vc-git--checkin comment nil patch-string)) + +(defun vc-git-checkin (files comment &optional _rev) + "Git-specific version of `vc-BACKEND-checkin'. +REV is ignored." + (vc-git--checkin comment files nil)) + (defun vc-git--stash-staged-changes (files) "Stash only the staged changes to FILES." ;; This is necessary because even if you pass a list of file names commit 0b4fe2628c7be38d12a069e22cbe2e788ed97c0a Author: Sean Whitton Date: Thu Sep 18 12:33:56 2025 +0100 vc--prompt-other-working-tree: Fail when no other working trees * lisp/vc/vc.el (vc--prompt-other-working-tree): When there are no other working trees, signal an error. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index ce950b18caf..ee8d901e4b6 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -4547,15 +4547,18 @@ When called from Lisp, BACKEND is the VC backend." "Invoke `project-prompter' to choose another working tree. BACKEND is the VC backend. PROMPT is the prompt string for `project-prompter'." - (let ((trees (vc-call-backend backend 'known-other-working-trees))) - (require 'project) - (dolist (tree trees) - (when-let* ((p (project-current nil tree))) - (project-remember-project p nil t))) - (funcall project-prompter prompt - (lambda (k &optional _v) - (member (or (car-safe k) k) trees)) - t))) + (if-let* ((trees (vc-call-backend backend 'known-other-working-trees))) + (progn (require 'project) + (dolist (tree trees) + (when-let* ((p (project-current nil tree))) + (project-remember-project p nil t))) + (funcall project-prompter prompt + (lambda (k &optional _v) + (member (or (car-safe k) k) trees)) + t)) + (user-error + (substitute-command-keys + "No other working trees. Use \\[vc-add-working-tree] to add one")))) (defvar project-current-directory-override) commit 23a8c06a23a1280018b8f7d40781e5e7f030ce8c Author: Leo C. Stein Date: Sat Sep 13 10:45:34 2025 -0500 Skip over possible blank lines returned by kpsewhich * lisp/ffap.el (ffap-latex-mode): Starting with TeXlive 2025, the kpsewhich utility may return blank lines before the first valid path for `ffap'. The old behavior of `ffap-latex-mode' was to simply return the first line of output from kpsewhich (if the output was nonempty). The fix simply skips all \r and \n chars. (Bug#79397) Copyright-paperwork-exempt: yes diff --git a/lisp/ffap.el b/lisp/ffap.el index 4766b3f208a..4cf2dfebc0f 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1044,10 +1044,16 @@ out of NAME." (exec-path (buffer-local-value 'exec-path curbuf))) (apply #'call-process "kpsewhich" nil t nil (mapcar (lambda (rule) - (concat (car rule) name (cdr rule))) - guess-rules))) - (when (< (point-min) (point-max)) - (buffer-substring (goto-char (point-min)) (line-end-position)))))))) + (concat (car rule) name (cdr rule))) + guess-rules))) + ;; Starting with TeXlive 2025, kpsewhich returns blank + ;; lines when multiple filenames are given and a given file + ;; is not found, so we have to go to the first non-blank + ;; line in order to find a file-path (bug#79397): + (goto-char (point-min)) + (skip-chars-forward "\r\n") + (when (< (point) (line-end-position)) + (buffer-substring (point) (line-end-position)))))))) (defun ffap-tex (name) (ffap-tex-init)