commit d70e2aac6cdf36361b16f3be56eb735ac44e162a (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sun Aug 24 07:32:45 2025 +0300 ; * etc/NEWS: Fix punctuation in last change. diff --git a/etc/NEWS b/etc/NEWS index 25304922e57..bd2ce33b851 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -529,7 +529,7 @@ universal argument as in 'C-u C-x p s' always creates a new session. *** 'project-switch-buffer' re-uniquifies buffer names while prompting. When 'uniquify-buffer-name-style' is non-nil, 'project-switch-buffer' changes the buffer names to only make them unique within the given -project, during completion. That makes some items shorter. +project, during completion. That makes some items shorter. *** 'project-switch-buffer' uses 'project-buffer' as completion category. The category defaults are the same as for 'buffer' but any user commit bb0ede711eb630e3cc4b02316bf76079ce760de6 Author: Dmitry Gutov Date: Sun Aug 24 03:22:21 2025 +0300 Have project-switch-to-buffer use a distinct completion category * etc/NEWS: Mention the change. * lisp/minibuffer.el (completion-category-defaults): Add an entry for it. * lisp/progmodes/project.el (project--buffers-completion-table): Return category 'project-buffer'. diff --git a/etc/NEWS b/etc/NEWS index e0ea673ed4a..25304922e57 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -531,6 +531,10 @@ When 'uniquify-buffer-name-style' is non-nil, 'project-switch-buffer' changes the buffer names to only make them unique within the given project, during completion. That makes some items shorter. +*** 'project-switch-buffer' uses 'project-buffer' as completion category. +The category defaults are the same as for 'buffer' but any user +customizations would need to be re-added. + ** Registers *** New functions 'buffer-to-register' and 'file-to-register'. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 3c80d606cfc..3558b14bf78 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1215,6 +1215,7 @@ styles for specific categories, such as files, buffers, etc." ;; A new style that combines substring and pcm might be better, ;; e.g. one that does not anchor to bos. (project-file (styles . (substring))) + (project-buffer (styles . (basic substring))) (xref-location (styles . (substring))) (info-menu (styles . (basic substring))) (symbol-help (styles . (basic shorthand substring)))) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index b5e534519b2..05f3a9991be 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1684,7 +1684,7 @@ Return non-nil if PROJECT is not a remote project." (lambda (string pred action) (cond ((eq action 'metadata) - '(metadata . ((category . buffer) + '(metadata . ((category . project-buffer) (cycle-sort-function . identity)))) ((and (eq action t) (equal string "")) ;Pcm completion or empty prefix. commit 0e379775461f78636afc32ce75e96009b6d0960d Author: Dmitry Gutov Date: Sun Aug 24 03:18:16 2025 +0300 Follow-up to previous changes in project--read-project-buffer * lisp/progmodes/project.el (project--buffers-completion-table): New function, use it to implement the no-internal/internal fallback logic from 'internal-complete-buffer', apply the category and cycle-sort-function (bug#77312). (project--read-project-buffer): Use it. Skip 'read-buffer' in favor of 'completing-read'. But make sure to honor read-buffer-completion-ignore-case and use format-prompt when the function is available. Unify two execution paths. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 8438060afa3..b5e534519b2 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1680,11 +1680,26 @@ non-nil if the project must be removed." Return non-nil if PROJECT is not a remote project." (not (file-remote-p project))) +(defun project--buffers-completion-table (buffers) + (lambda (string pred action) + (cond + ((eq action 'metadata) + '(metadata . ((category . buffer) + (cycle-sort-function . identity)))) + ((and (eq action t) + (equal string "")) ;Pcm completion or empty prefix. + (let* ((all (complete-with-action action buffers string pred)) + (non-internal (cl-remove-if (lambda (b) (= (aref b 0) ?\s)) all))) + (if (null non-internal) + all + non-internal))) + (t + (complete-with-action action buffers string pred))))) + (defun project--read-project-buffer () (let* ((pr (project-current t)) (current-buffer (current-buffer)) (other-buffer (other-buffer current-buffer)) - (other-name (buffer-name other-buffer)) (buffers (project-buffers pr)) (predicate (lambda (buffer) @@ -1693,35 +1708,35 @@ Return non-nil if PROJECT is not a remote project." (not (project--buffer-check buffer project-ignore-buffer-conditions))))) - (buffer + (completion-ignore-case read-buffer-completion-ignore-case) + (buffers-alist (if (and (fboundp 'uniquify-get-unique-names) uniquify-buffer-name-style) - ;; Forgo the use of `buffer-read-function' (often nil) in - ;; favor of uniquifying the buffers better. - (let* ((unique-names - (mapcar - (lambda (name) - (cons name - (get-text-property 0 'uniquify-orig-buffer - (or name "")))) - (uniquify-get-unique-names buffers))) - (other-name (when (funcall predicate (cons other-name other-buffer)) - (car (rassoc other-buffer unique-names)))) - (result (completing-read - "Switch to buffer: " - (project--completion-table-with-category - unique-names - 'buffer) - predicate - nil nil nil - other-name))) - (assoc-default result unique-names #'equal result)) - (read-buffer - "Switch to buffer: " - (when (funcall predicate (cons other-name other-buffer)) - other-name) - nil - predicate)))) + (mapcar + (lambda (name) + (cons name + (get-text-property 0 'uniquify-orig-buffer + (or name "")))) + (uniquify-get-unique-names buffers)) + (mapcar + (lambda (buf) (cons (buffer-name buf) buf)) + buffers))) + (other-name + (when (funcall predicate (cons nil other-buffer)) + (car (rassoc other-buffer buffers-alist)))) + (prompt + (if (fboundp 'format-prompt) + (format-prompt "Switch to buffer" other-name) + "Switch to buffer: ")) + ;; Forgo the use of `buffer-read-function' (often nil) in + ;; favor of showing shorter buffer names with uniquify. + (result + (completing-read + prompt + (project--buffers-completion-table buffers-alist) + predicate nil nil nil + other-name)) + (buffer (assoc-default result buffers-alist #'equal result))) ;; XXX: This check hardcodes the default buffer-belonging relation ;; which `project-buffers' is allowed to override. Straighten ;; this up sometime later. Or not. Since we can add a method commit b2186b5c20d2978a09f19ba7c2da3090eeea5bb5 Author: Dmitry Gutov Date: Fri Aug 22 03:56:04 2025 +0300 Add NEWS entry for project-switch-buffer change from bug#77312 diff --git a/etc/NEWS b/etc/NEWS index f88f7b9e23e..e0ea673ed4a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -525,6 +525,12 @@ shell sessions. For example, 'C-2 C-x p s' switches to or creates a buffer named "*name-of-project-shell<2>*". By comparison, a plain universal argument as in 'C-u C-x p s' always creates a new session. +--- +*** 'project-switch-buffer' re-uniquifies buffer names while prompting. +When 'uniquify-buffer-name-style' is non-nil, 'project-switch-buffer' +changes the buffer names to only make them unique within the given +project, during completion. That makes some items shorter. + ** Registers *** New functions 'buffer-to-register' and 'file-to-register'. commit d3d93bc3825e7ee4319330f81c59ae249eba2e25 Author: Eli Zaretskii Date: Sat Aug 23 10:34:23 2025 -0400 ; * lisp/ldefs-boot.el: Update. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 10328165450..e1f62222e9a 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -6,7 +6,8 @@ ;;; Commentary: ;; This file will be copied to ldefs-boot.el and checked in -;; periodically. +;; periodically. Note: When checking in ldefs-boot.el, don't include +;; changes to any other files in the commit. ;;; Code: @@ -1563,6 +1564,8 @@ disabled. ;;; Generated autoloads from autorevert.el +(defvar auto-revert-buffer-in-progress nil "\ +Non-nil if a `auto-revert-buffer' operation is in progress, nil otherwise.") (autoload 'auto-revert-mode "autorevert" "\ Toggle reverting buffer when the file changes (Auto-Revert Mode). @@ -2982,6 +2985,7 @@ This function attempts to use file contents to determine whether the code is C or C++, and based on that chooses whether to enable `c-ts-mode' or `c++-ts-mode'." t) (make-obsolete 'c-or-c++-ts-mode 'c-or-c++-mode "30.1") +(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(c-mode . c-ts-mode)) (add-to-list 'treesit-major-mode-remap-alist '(c++-mode . c++-ts-mode)) (add-to-list 'treesit-major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode))) (register-definition-prefixes "c-ts-mode" '("c-ts-")) @@ -4699,6 +4703,11 @@ For use inside Lisp programs, see also `c-macro-expansion'. Major mode for editing CMake files, powered by tree-sitter. (fn)" t) +(autoload 'cmake-ts-mode-maybe "cmake-ts-mode" "\ +Enable `cmake-ts-mode' when its grammar is available. +Also propose to install the grammar when `treesit-enabled-modes' +is t or contains the mode name.") +(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\(?:CMakeLists\\.txt\\|\\.cmake\\)\\'" . cmake-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(cmake-mode . cmake-ts-mode))) (register-definition-prefixes "cmake-ts-mode" '("cmake-ts-mode-")) @@ -5923,6 +5932,7 @@ Key bindings: Major mode for editing C# code. (fn)" t) +(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(csharp-mode . csharp-ts-mode))) (register-definition-prefixes "csharp-mode" '("codedoc-font-lock-" "csharp-")) @@ -5952,6 +5962,7 @@ can also be used to fill comments. \\{css-mode-map} (fn)" t) +(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(css-mode . css-ts-mode))) (autoload 'css-mode "css-mode" "\ Major mode to edit Cascading Style Sheets (CSS). \\ @@ -8385,6 +8396,11 @@ disabled. Major mode for editing Dockerfiles, powered by tree-sitter. (fn)" t) +(autoload 'dockerfile-ts-mode-maybe "dockerfile-ts-mode" "\ +Enable `dockerfile-ts-mode' when its grammar is available. +Also propose to install the grammar when `treesit-enabled-modes' +is t or contains the mode name.") +(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\(?:Dockerfile\\(?:\\..*\\)?\\|\\.[Dd]ockerfile\\)\\'" . dockerfile-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(dockerfile-mode . dockerfile-ts-mode))) (register-definition-prefixes "dockerfile-ts-mode" '("dockerfile-ts-mode--")) @@ -8534,6 +8550,7 @@ INIT-VALUE LIGHTER KEYMAP. (fn MODE DOC [KEYWORD VAL ... &rest BODY])" nil t) (function-put 'define-minor-mode 'doc-string-elt 2) (function-put 'define-minor-mode 'lisp-indent-function 'defun) +(function-put 'define-minor-mode 'autoload-macro 'expand) (autoload 'define-globalized-minor-mode "easy-mmode" "\ Make a global mode GLOBAL-MODE corresponding to buffer-local minor MODE. TURN-ON is a function that will be called with no args in every buffer @@ -8577,6 +8594,7 @@ on if the hook has explicitly disabled it. (fn GLOBAL-MODE MODE TURN-ON [KEY VALUE]... BODY...)" nil t) (function-put 'define-globalized-minor-mode 'doc-string-elt 2) (function-put 'define-globalized-minor-mode 'lisp-indent-function 'defun) +(function-put 'define-globalized-minor-mode 'autoload-macro 'expand) (autoload 'easy-mmode-define-keymap "easy-mmode" "\ Return a keymap built from bindings BS. BS must be a list of (KEY . BINDING) where @@ -8925,7 +8943,7 @@ A second call of this function without changing point inserts the next match. A call with prefix PREFIX reads the symbol to insert from the minibuffer with completion. -(fn PREFIX)" '("P")) +(fn PREFIX)" t) (autoload 'ebrowse-tags-loop-continue "ebrowse" "\ Repeat last operation on files in tree. FIRST-TIME non-nil means this is not a repetition, but the first time. @@ -9953,6 +9971,11 @@ mode hooks. Major mode for editing Elixir, powered by tree-sitter. (fn)" t) +(autoload 'elixir-ts-mode-maybe "elixir-ts-mode" "\ +Enable `elixir-ts-mode' when its grammar is available. +Also propose to install the grammar when `treesit-enabled-modes' +is t or contains the mode name.") +(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.elixir\\'" . elixir-ts-mode-maybe)) (add-to-list 'auto-mode-alist '("\\.ex\\'" . elixir-ts-mode-maybe)) (add-to-list 'auto-mode-alist '("\\.exs\\'" . elixir-ts-mode-maybe)) (add-to-list 'auto-mode-alist '("mix\\.lock" . elixir-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(elixir-mode . elixir-ts-mode))) (register-definition-prefixes "elixir-ts-mode" '("elixir-ts-")) @@ -10691,7 +10714,7 @@ ERC assigns SERVER and FULL-NAME the associated keyword values and defers to `erc-compute-port', `erc-compute-user', and `erc-compute-nick' for those respective parameters. -(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME ID)" '((let ((erc--display-context `((erc-interactive-display . erc) ,@erc--display-context))) (erc-select-read-args)))) +(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME ID)" t) (defalias 'erc-select #'erc) (autoload 'erc-tls "erc" "\ Connect to an IRC server over a TLS-encrypted connection. @@ -10714,7 +10737,7 @@ See the alternative entry-point command `erc' as well as Info node `(erc) Connecting' for a fuller description of the various parameters, like ID. -(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME CLIENT-CERTIFICATE ID)" '((let ((erc-default-port erc-default-port-tls) (erc--display-context `((erc-interactive-display . erc-tls) ,@erc--display-context))) (erc-select-read-args)))) +(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME CLIENT-CERTIFICATE ID)" t) (autoload 'erc-handle-irc-url "erc" "\ Use ERC to IRC on HOST:PORT in CHANNEL. If ERC is already connected to HOST:PORT, simply /join CHANNEL. @@ -15112,15 +15135,29 @@ Major mode for editing Go, powered by tree-sitter. \\{go-ts-mode-map} (fn)" t) +(autoload 'go-ts-mode-maybe "go-ts-mode" "\ +Enable `go-ts-mode' when its grammar is available. +Also propose to install the grammar when `treesit-enabled-modes' +is t or contains the mode name.") +(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.go\\'" . go-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(go-mode . go-ts-mode))) (autoload 'go-mod-ts-mode "go-ts-mode" "\ Major mode for editing go.mod files, powered by tree-sitter. (fn)" t) +(autoload 'go-mod-ts-mode-maybe "go-ts-mode" "\ +Enable `go-mod-ts-mode' when its grammar is available. +Also propose to install the grammar when `treesit-enabled-modes' +is t or contains the mode name.") +(when (treesit-available-p) (add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(go-mod-mode . go-mod-ts-mode))) (autoload 'go-work-ts-mode "go-ts-mode" "\ Major mode for editing go.work files, powered by tree-sitter. (fn)" t) -(add-to-list 'auto-mode-alist '("/go\\.work\\'" . go-work-ts-mode)) +(autoload 'go-work-ts-mode-maybe "go-ts-mode" "\ +Enable `go-work-ts-mode' when its grammar is available. +Also propose to install the grammar when `treesit-enabled-modes' +is t or contains the mode name.") +(when (treesit-available-p) (add-to-list 'auto-mode-alist '("/go\\.work\\'" . go-work-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(go-work-mode . go-work-ts-mode))) (register-definition-prefixes "go-ts-mode" '("go-")) @@ -15793,6 +15830,11 @@ Like `hanoi-unix', but with a 64-bit clock." t) Major mode for editing HEEx, powered by tree-sitter. (fn)" t) +(autoload 'heex-ts-mode-maybe "heex-ts-mode" "\ +Enable `heex-ts-mode' when its grammar is available. +Also propose to install the grammar when `treesit-enabled-modes' +is t or contains the mode name.") +(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.[hl]?eex\\'" . heex-ts-mode-maybe)) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(heex-mode . heex-ts-mode))) (register-definition-prefixes "heex-ts-mode" '("heex-ts-")) @@ -18851,6 +18893,7 @@ See Info node `(elisp)Defining Functions' for more details. (fn NAME ARGS &rest BODY)" nil t) (function-put 'define-inline 'lisp-indent-function 'defun) (function-put 'define-inline 'doc-string-elt 3) +(function-put 'define-inline 'autoload-macro 'expand) (register-definition-prefixes "inline" '("inline-")) @@ -19295,6 +19338,7 @@ Return the string read from the minibuffer. Major mode for editing Java, powered by tree-sitter. (fn)" t) +(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(java-mode . java-ts-mode))) (register-definition-prefixes "java-ts-mode" '("java-ts-mode-")) @@ -19341,6 +19385,7 @@ Major mode for editing JavaScript. \\ (fn)" t) +(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(javascript-mode . js-ts-mode))) (autoload 'js-json-mode "js" "\ @@ -19376,6 +19421,7 @@ one of the aforementioned options instead of using this mode. Major mode for editing JSON, powered by tree-sitter. (fn)" t) +(when (treesit-available-p) (defvar treesit-major-mode-remap-alist) (add-to-list 'treesit-major-mode-remap-alist '(js-json-mode . json-ts-mode))) (register-definition-prefixes "json-ts-mode" '("json-ts-")) @@ -19874,7 +19920,7 @@ The first element on the command line should be the (main) loaddefs.el output file, and the rest are the directories to use.") (load "theme-loaddefs.el" t) -(register-definition-prefixes "loaddefs-gen" '("autoload-" "generated-autoload-" "loaddefs-generate--" "no-update-autoloads")) +(register-definition-prefixes "loaddefs-gen" '("autoload-" "generated-autoload-" "loaddefs-" "no-update-autoloads")) ;;; Generated autoloads from loadhist.el @@ -20105,6 +20151,11 @@ Major mode for editing Lua files, powered by tree-sitter. \\{lua-ts-mode-map} (fn)" t) +(autoload 'lua-ts-mode-maybe "lua-ts-mode" "\ +Enable `lua-ts-mode' when its grammar is available. +Also propose to install the grammar when `treesit-enabled-modes' +is t or contains the mode name.") +(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-ts-mode-maybe)) (add-to-list 'interpreter-mode-alist '("\\ Date: Sat Aug 23 10:30:47 2025 -0400 Merge from origin/emacs-30 b3ed4876b63 ; Improve documentation of Edebug fdad3417dcf ; Fix typo in 'cursor-type' widget commit 26329bed6e8863dd2586000104f06c788c6f86a3 Author: Eli Zaretskii Date: Sat Aug 23 16:34:43 2025 +0300 ; * etc/symbol-releases.eld (dired-click-to-select-mode): Add. diff --git a/etc/symbol-releases.eld b/etc/symbol-releases.eld index 9732f60fc16..3c666423cc0 100644 --- a/etc/symbol-releases.eld +++ b/etc/symbol-releases.eld @@ -9,6 +9,8 @@ ;; TYPE being `fun' or `var'. ( + ("30.1" fun dired-click-to-select-mode) + ("30.1" var dired-click-to-select-mode) ("29.1" fun plistp) ("29.1" fun help-key) ("28.1" fun always) commit 90c44826f545f71f0f7621c33eff0e5ec5ec4ffc Author: Eli Zaretskii Date: Sat Aug 23 16:33:45 2025 +0300 Improve and clarify documentation of 'dired-click-to-select-mode' * lisp/dired.el (dired-click-to-select-mode) (dired-post-do-command): * doc/emacs/dired.texi (Marks vs Flags): Improve documentation of 'dired-click-to-select-mode'. diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 602c8e5bfb2..e49823384ce 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -702,14 +702,14 @@ the directory. @kindex touchscreen-hold @r{(Dired)} @findex dired-click-to-select-mode @findex dired-enable-click-to-select-mode -Enter a ``click to select'' mode, where using the mouse button -@kbd{mouse-2} on a file name will cause its mark to be toggled. This -mode is useful when performing file management using a touch screen -device. - -It is enabled when a ``hold'' gesture (@pxref{Touchscreens}) is -detected over a file name, and is automatically disabled once a Dired -command operates on the marked files. +Enter a ``click to select'' mode (@code{dired-click-to-select-mode}), +where using the mouse button @kbd{mouse-2} on a file name will cause its +mark to be toggled. This mode is useful when performing file management +using a touch screen device. + +It is enabled when a ``hold'' gesture (@pxref{Touchscreens}) is detected +over a file name, and is automatically disabled once a Dired command +that operates on the marked files finishes. @end table @node Operating on Files diff --git a/lisp/dired.el b/lisp/dired.el index 103c273ccfd..996ca9c23bb 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -4057,7 +4057,10 @@ non-empty directories is allowed." (message "(No deletions requested)"))))) (defun dired-post-do-command () - "Disable `dired-click-to-select-mode' after an operation." + "Disable `dired-click-to-select-mode' if enabled.. +This is called after Dired finishes an operation on marked files, and it +disables `dired-click-to-select-mode' that is automatically enabled +by the \"hold\" touch-screen gestures." (when dired-click-to-select-mode (dired-click-to-select-mode -1))) @@ -5381,12 +5384,14 @@ When this minor mode is enabled, using `mouse-2' on a file name within a Dired buffer will toggle its mark instead of going to it within another window. -Disabling this minor mode will unmark all files within the Dired -buffer. - -`dired-click-to-select-mode' is automatically disabled after any -Dired operation (command whose name starts with `dired-do') -completes." +This minor mode is intended to be used when performing file management +using a touch-screen device. The mode is automatically enabled when a +\"hold\" gesture over a file name is received, and is therefore +automatically disabled after any Dired operation on the marked +files (any command whose name starts with \"dired-do-\" and which +performs some operation on the marked files) completes. When the mode +is automatically disabled, it unmarks all the marked files in the Dired +buffer." :group 'dired :lighter " Click-To-Select" (unless (derived-mode-p '(dired-mode wdired-mode)) commit 5d23fc9467ebc26a93c1b5bc45bf26026b9319cb Author: Jeremy Bryant Date: Fri Aug 22 21:57:30 2025 +0100 * doc/lispref/control.texi (cond* Macro): Update bind* entry Update manual to match docstring of (bind*) clause, including the qualifier `all subsequent clauses'. (Bug#79246) diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 4d00d27bd46..8df8cd215f5 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -1489,8 +1489,8 @@ Each clause normally has the form @w{@code{(@var{condition} @findex bind* @code{(bind* @var{bindings}@dots{})} means to bind @var{bindings} (like the bindings list in @code{let*}, @pxref{Local Variables}) for the body -of the clause. As a condition, it counts as true if the first binding's -value is non-@code{nil}. +of the clause, and all subsequent clauses. As a condition, it counts as +true if the first binding's value is non-@code{nil}. @findex match* @findex pcase* commit 8e9277042c73b9029c84917ac0021f8f6aeefa3b Author: Eli Zaretskii Date: Sat Aug 23 15:09:31 2025 +0300 Use better temporary file names under 'file-precious-flag' * lisp/files.el (basic-save-buffer-2): Use a more meaningful temporary file name under 'file-precious-flag'. (Bug#79252) * etc/NEWS: Announce the change in behavior. diff --git a/etc/NEWS b/etc/NEWS index 27244565d19..f88f7b9e23e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -709,6 +709,15 @@ to the value 'fill-region-as-paragraph-semlf' to enable functions like 'fill-paragraph' and 'fill-region' to fill text using "semantic linefeeds". +--- +** Temporary files are named differently when 'file-precious-flag' is set. +When the user option 'file-precious-flag' is set to a non-nil value, +Emacs now names the temporary file it creates while saving buffers using +the original file name with ".tmp" appended to it. Thus, if saving the +buffer fails for some reason, and the temporary file is not renamed back +to the original file's name, you can easily identify which file's saving +failed. + +++ ** 'C-u C-x .' clears the fill prefix. You can now use 'C-u C-x .' to clear the fill prefix, similarly to how diff --git a/lisp/files.el b/lisp/files.el index 84e9254ca46..3e85244e4e9 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6245,7 +6245,13 @@ Before and after saving the buffer, this function runs ;; for saving the buffer. (setq tempname (make-temp-file - (expand-file-name "tmp" dir))) + ;; The MSDOS 8+3 restricted namespace cannot be + ;; relied upon to produce a different file name + ;; if we append ".tmp". + (if (and (eq system-type 'ms-dos) + (not (msdos-long-file-names))) + (expand-file-name "tmp" dir) + (concat buffer-file-name ".tmp")))) ;; Pass in nil&nil rather than point-min&max ;; cause we're saving the whole buffer. ;; write-region-annotate-functions may use it. commit 45bc42bddfe8d9376ede6e71e4ddccb02c3d45a3 Author: Eli Zaretskii Date: Sat Aug 23 14:55:09 2025 +0300 Rmail can fetch email from several inboxes with different passwords * lisp/mail/rmail.el (rmail--remote-password-host) (rmail--remote-password-user): New variables. (rmail-get-remote-password): Use them to ask for the password whenever we need to fetch email from an inbox whose user or host are different from the last ones. (Bug#79214) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 41b0813707f..b8aa937aec2 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -4515,6 +4515,11 @@ TEXT and INDENT are not used." ;; to "prying eyes." Obviously, this encoding isn't "real security," ;; nor is it meant to be. +(defvar rmail--remote-password-host nil + "Last recorded value of the HOST argument to `rmail-get-remote-password'.") +(defvar rmail--remote-password-user nil + "Last recorded value of the USER argument to `rmail-get-remote-password'.") + ;;;###autoload (defun rmail-set-remote-password (password) "Set PASSWORD to be used for retrieving mail from a POP or IMAP server." @@ -4535,7 +4540,12 @@ machine mymachine login myloginname password mypassword If auth-source search yields no result, prompt the user for the password." - (when (not rmail-encoded-remote-password) + (when (or (not rmail-encoded-remote-password) + (not (equal user rmail--remote-password-user)) + (not (equal host rmail--remote-password-host))) + ;; Record the values we will be using from now on. + (setq rmail--remote-password-host host + rmail--remote-password-user user) (if (not rmail-remote-password) (setq rmail-remote-password (let ((found (nth 0 (auth-source-search commit aae9eddb58a618d9a90dcd4232688b31b0df9f81 Author: Spencer Baugh Date: Fri Aug 15 10:13:16 2025 -0400 flymake: stop trying to automatically fall back to margins The code to automatically fallback to margins is not correct: it relies implicitly on the buffer being displayed in a window while flymake-mode is running. If the buffer is created while not displayed, we will always automatically fallback to margins, which is incorrect. Avoid the regression by simply disabling this code. I'll try again to fall back automatically in the future. (Bug#79244) * doc/misc/flymake.texi (Customizable variables): Remove section about automatic fallback to margins. * etc/NEWS: Un-announce removed feature. * lisp/progmodes/flymake.el (flymake-indicator-type) (flymake-mode): Stop automatically falling back to margins. (bug#77313) diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index d6c8778d785..cc364813f8b 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -316,10 +316,8 @@ reported. The indicator type which Flymake should use to indicate lines with errors or warnings. Depending on your preference, this can either use @code{fringes} or -@code{margins} for indicating errors. -If set to @code{fringes} (the default), it will automatically fall back -to using margins in windows or frames without fringes, such as text -terminals. +@code{margins} for indicating errors. On text terminals, only +@code{margins} is available. @item flymake-error-bitmap A bitmap used in the fringe to mark lines for which an error has diff --git a/etc/NEWS b/etc/NEWS index 99026f936b6..27244565d19 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2496,11 +2496,6 @@ file names in above buffers. The default is nil. --- ** Flymake -*** Windows without fringes now automatically use margin indicators. -When 'flymake-indicator-type' is set to 'fringes', as is now the default, -flymake will automatically fall back to using margin indicators in -windows without fringes, including any window on a text terminal. - *** Enhanced 'flymake-show-diagnostics-at-end-of-line' The new value 'fancy' allowed for this user option will attempt to layout diagnostics below the affected line using unicode graphics to diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index c5380a9bb64..8b6d477c385 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -195,8 +195,6 @@ margins). Difference between fringes and margin is that fringes support displaying bitmaps on graphical displays and margins display text in a blank area from current buffer that works in both graphical and text displays. -Thus, even when `fringes' is selected, margins will still be used on -text displays and also when fringes are disabled. See Info node `Fringes' and Info node `(elisp)Display Margins'." :version "31.1" @@ -1496,13 +1494,6 @@ special *Flymake log* buffer." :group 'flymake :lighter (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t) (add-hook 'eldoc-documentation-functions 'flymake-eldoc-function t t) - (when (and (eq flymake-indicator-type 'fringes) - (not (cl-case flymake-fringe-indicator-position - (left-fringe (< 0 (nth 0 (window-fringes)))) - (right-fringe (< 0 (nth 1 (window-fringes))))))) - ;; There are no fringes in the buffer, fallback to margins. - (setq-local flymake-indicator-type 'margins)) - ;; AutoResize margins. (flymake--resize-margins) commit 60a2923d50e0dd802cfb131e06506ec7834ac0af Author: Eli Zaretskii Date: Sat Aug 23 14:25:06 2025 +0300 ; * lisp/play/doctor.el (llm): Add. diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el index b3ddabf9823..0e75bd108eb 100644 --- a/lisp/play/doctor.el +++ b/lisp/play/doctor.el @@ -589,6 +589,7 @@ reads the sentence before point, and prints the Doctor's answer." (doctor-put-meaning pc 'mach) (doctor-put-meaning gnu 'mach) (doctor-put-meaning linux 'mach) +(doctor-put-meaning llm 'mach) (doctor-put-meaning bitching 'foul) (doctor-put-meaning shit 'foul) (doctor-put-meaning bastard 'foul) commit b3ed4876b63cc61ef803775cfbb6af4776203a2d Author: Eli Zaretskii Date: Sat Aug 23 13:44:23 2025 +0300 ; Improve documentation of Edebug * doc/lispref/edebug.texi (Edebug Execution Modes, Jumping) (Edebug Misc, Breaks, Breakpoints, Global Break Condition) (Source Breakpoints, Edebug Views, Edebug Eval, Eval List) (Printing in Edebug, Trace Buffer, Coverage Testing) (Checking Whether to Stop, Edebug Display Update) (Edebug Recursive Edit, Edebug and Macros) (Instrumenting Macro Calls, Specification List, Edebug Options): Improve indexing and cross-references. diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index 0effe48e9a3..813a0d85633 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -256,38 +256,47 @@ commands; all except for @kbd{S} resume execution of the program, at least for a certain distance. @table @kbd +@findex edebug-stop @item S Stop: don't execute any more of the program, but wait for more Edebug commands (@code{edebug-stop}). @c FIXME Does not work. https://debbugs.gnu.org/9764 +@findex edebug-step-mode @item @key{SPC} Step: stop at the next stop point encountered (@code{edebug-step-mode}). +@findex edebug-next-mode @item n Next: stop at the next stop point encountered after an expression (@code{edebug-next-mode}). Also see @code{edebug-forward-sexp} in @ref{Jumping}. +@findex edebug-trace-mode @item t Trace: pause (normally one second) at each Edebug stop point (@code{edebug-trace-mode}). +@findex edebug-Trace-fast-mode @item T Rapid trace: update the display at each stop point, but don't actually pause (@code{edebug-Trace-fast-mode}). +@findex edebug-go-mode @item g Go: run until the next breakpoint (@code{edebug-go-mode}). @xref{Breakpoints}. +@findex edebug-continue-mode @item c Continue: pause one second at each breakpoint, and then continue (@code{edebug-continue-mode}). +@findex edebug-Continue-fast-mode @item C Rapid continue: move point to each breakpoint, but don't pause (@code{edebug-Continue-fast-mode}). +@findex edebug-Go-nonstop-mode @item G Go non-stop: ignore breakpoints (@code{edebug-Go-nonstop-mode}). You can still stop the program by typing @kbd{S}, or any editing command. @@ -345,25 +354,30 @@ in trace mode or continue mode. The default is 1 second. The commands described in this section execute until they reach a specified location. All except @kbd{i} make a temporary breakpoint to -establish the place to stop, then switch to go mode. Any other -breakpoint reached before the intended stop point will also stop -execution. @xref{Breakpoints}, for the details on breakpoints. +establish the place to stop, then switch to go mode (@pxref{Edebug +Execution Modes}). Any other breakpoint reached before the intended +stop point will also stop execution. @xref{Breakpoints}, for the +details on breakpoints. These commands may fail to work as expected in case of nonlocal exit, as that can bypass the temporary breakpoint where you expected the program to stop. @table @kbd +@findex edebug-goto-here @item h Proceed to the stop point near where point is (@code{edebug-goto-here}). +@findex edebug-forward-sexp @item f Run the program for one expression (@code{edebug-forward-sexp}). +@findex edebug-step-out @item o Run the program until the end of the containing sexp (@code{edebug-step-out}). +@findex edebug-step-in @item i Step into the function or macro called by the form after point (@code{edebug-step-in}). @@ -397,7 +411,7 @@ containing sexp is a function definition itself, @kbd{o} continues until just before the last sexp in the definition. If that is where you are now, it returns from the function and then stops. In other words, this command does not exit the currently executing function unless you are -positioned after the last sexp. +positioned after the last sexp of that function. Normally, the @kbd{h}, @kbd{f}, and @kbd{o} commands display ``Break'' and pause for @code{edebug-sit-for-seconds} before showing the result @@ -421,14 +435,17 @@ arrange to deinstrument it. Some miscellaneous Edebug commands are described here. @table @kbd +@findex edebug-help @item ? Display the help message for Edebug (@code{edebug-help}). +@findex abort-recursive-edit @r{(Edebug)} @item a @itemx C-] Abort one level back to the previous command level -(@code{abort-recursive-edit}). +(@code{abort-recursive-edit}). @xref{Recursive Editing}. +@findex top-level @r{(Edebug)} @item q Return to the top level editor command loop (@code{top-level}). This exits all recursive editing levels, including all levels of Edebug @@ -436,14 +453,17 @@ activity. However, instrumented code protected with @code{unwind-protect} or @code{condition-case} forms may resume debugging. +@findex edebug-top-level-nonstop @item Q Like @kbd{q}, but don't stop even for protected code (@code{edebug-top-level-nonstop}). +@findex edebug-previous-result @item r Redisplay the most recently known expression result in the echo area (@code{edebug-previous-result}). +@findex edebug-pop-to-backtrace @item d Display a backtrace, excluding Edebug's own functions for clarity (@code{edebug-pop-to-backtrace}). @@ -473,9 +493,10 @@ display a backtrace of all the pending evaluations with @kbd{d}. @node Breaks @subsection Breaks -Edebug's step mode stops execution when the next stop point is reached. -There are three other ways to stop Edebug execution once it has started: -breakpoints, the global break condition, and source breakpoints. +Edebug's step mode (@pxref{Edebug Execution Modes}) stops execution when +the next stop point is reached. There are three other ways to stop +Edebug execution once it has started: breakpoints, the global break +condition, and source breakpoints. @menu * Breakpoints:: Breakpoints at stop points. @@ -495,6 +516,9 @@ the first one at or after point in the source code buffer. Here are the Edebug commands for breakpoints: @table @kbd +@findex edebug-set-breakpoint +@vindex edebug-enabled-breakpoint @r{(face)} +@vindex edebug-disabled-breakpoint @r{(face)} @item b Set a breakpoint at the stop point at or after point (@code{edebug-set-breakpoint}). If you use a prefix argument, the @@ -502,26 +526,34 @@ breakpoint is temporary---it turns off the first time it stops the program. An overlay with the @code{edebug-enabled-breakpoint} or @code{edebug-disabled-breakpoint} faces is put at the breakpoint. +@findex edebug-unset-breakpoint @item u Unset the breakpoint (if any) at the stop point at or after point (@code{edebug-unset-breakpoint}). +@findex edebug-unset-breakpoints @item U Unset any breakpoints in the current form (@code{edebug-unset-breakpoints}). +@findex edebug-toggle-disable-breakpoint @item D Toggle whether to disable the breakpoint near point (@code{edebug-toggle-disable-breakpoint}). This command is mostly useful if the breakpoint is conditional and it would take some work to recreate the condition. +@findex edebug-set-conditional-breakpoint @item x @var{condition} @key{RET} Set a conditional breakpoint which stops the program only if evaluating @var{condition} produces a non-@code{nil} value (@code{edebug-set-conditional-breakpoint}). With a prefix argument, the breakpoint is temporary. +@item X @var{condition} @key{RET} +Set @code{edebug-global-break-condition} to @var{condition}. + +@findex edebug-next-breakpoint @item B Move point to the next breakpoint in the current definition (@code{edebug-next-breakpoint}). @@ -542,6 +574,8 @@ conditional breakpoint, use @kbd{x}, and specify the condition expression in the minibuffer. Setting a conditional breakpoint at a stop point that has a previously established conditional breakpoint puts the previous condition expression in the minibuffer so you can edit it. +(You can also use @kbd{X} to set the global break condition, to be +evaluated at every stop point, @pxref{Global Break Condition}.) You can make a conditional or unconditional breakpoint @dfn{temporary} by using a prefix argument with the command to set the @@ -566,8 +600,9 @@ point in the buffer. condition is satisfied, no matter where that may occur. Edebug evaluates the global break condition at every stop point; if it evaluates to a non-@code{nil} value, then execution stops or pauses -depending on the execution mode, as if a breakpoint had been hit. If -evaluating the condition gets an error, execution does not stop. +depending on the execution mode (@pxref{Edebug Execution Modes}), as if +a breakpoint had been hit. If evaluating the condition gets an error, +execution does not stop. @findex edebug-set-global-break-condition The condition expression is stored in @@ -603,7 +638,8 @@ argument reaches zero: When the @code{fac} definition is instrumented and the function is called, the call to @code{edebug} acts as a breakpoint. Depending on -the execution mode, Edebug stops or pauses there. +the execution mode (@pxref{Edebug Execution Modes}), Edebug stops or +pauses there. If no instrumented code is being executed when @code{edebug} is called, that function calls @code{debug}. @@ -640,17 +676,20 @@ configuration is the collection of windows and contents that were in effect outside of Edebug. @table @kbd +@findex edebug-view-outside @item P @itemx v Switch to viewing the outside window configuration (@code{edebug-view-outside}). Type @kbd{C-x X w} to return to Edebug. +@findex edebug-bounce-point @item p Temporarily display the outside current buffer with point at its outside position (@code{edebug-bounce-point}), pausing for one second before returning to Edebug. With a prefix argument @var{n}, pause for @var{n} seconds instead. +@findex edebug-where @item w Move point back to the current stop point in the source code buffer (@code{edebug-where}). @@ -659,6 +698,7 @@ If you use this command in a different window displaying the same buffer, that window will be used instead to display the current definition in the future. +@findex edebug-toggle-save-windows @item W @c Its function is not simply to forget the saved configuration -- dan Toggle whether Edebug saves and restores the outside window @@ -697,6 +737,7 @@ explicitly saves and restores. @xref{The Outside Context}, for details on this process. @table @kbd +@findex edebug-eval-expression @item e @var{exp} @key{RET} Evaluate expression @var{exp} in the context outside of Edebug (@code{edebug-eval-expression}). That is, Edebug tries to minimize @@ -707,37 +748,47 @@ pretty-print the result there. By default, this command suppresses the debugger during evaluation, so that an error in the evaluated expression won't add a new error on top of the existing one. -Set the @code{debug-allow-recursive-debug} user option to a -non-@code{nil} value to override this. +Set the @code{debug-allow-recursive-debug} user option (@pxref{Error +Debugging}) to a non-@code{nil} value to override this. +@findex eval-expression @r{(Edebug)} @item M-: @var{exp} @key{RET} Evaluate expression @var{exp} in the context of Edebug itself (@code{eval-expression}). +@findex edebug-eval-last-sexp @item C-x C-e Evaluate the expression before point, in the context outside of Edebug -(@code{edebug-eval-last-sexp}). With the prefix argument of zero -(@kbd{C-u 0 C-x C-e}), don't shorten long items (like strings and -lists). Any other prefix will result in the value being -pretty-printed in a separate buffer. +(@code{edebug-eval-last-sexp}) and show the value in the minibuffer. +With the prefix argument of zero (@kbd{C-u 0 C-x C-e}), don't shorten +long items (like strings and lists) when showing the value, due to +@code{edebug-print-length} and @code{edebug-print-level} +(@pxref{Printing in Edebug}). Any other prefix will result in the value +being pretty-printed in a separate buffer instead of the minibuffer. @end table +@xref{Eval List}, for additional Edebug features related to evaluating +lists of expressions interactively. + @cindex lexical binding (Edebug) +@findex cl-macrolet @r{(Edebug)} +@findex cl-symbol-macrolet @r{(Edebug)} Edebug supports evaluation of expressions containing references to lexically bound symbols created by the following constructs in -@file{cl.el}: @code{lexical-let}, @code{macrolet}, and -@code{symbol-macrolet}. +@file{cl-lib.el}: @code{cl-macrolet} and @code{cl-symbol-macrolet}. @c FIXME? What about lexical-binding = t? @node Eval List @subsection Evaluation List Buffer +@cindex evaluation list buffer You can use the @dfn{evaluation list buffer}, called @file{*edebug*}, to evaluate expressions interactively. You can also set up the @dfn{evaluation list} of expressions to be evaluated automatically each time Edebug updates the display. @table @kbd +@findex edebug-visit-eval-list @item E Switch to the evaluation list buffer @file{*edebug*} (@code{edebug-visit-eval-list}). @@ -748,20 +799,25 @@ Interaction mode (@pxref{Lisp Interaction,,, emacs, The GNU Emacs Manual}) as well as these special commands: @table @kbd +@findex edebug-eval-print-last-sexp @item C-j Evaluate the expression before point, in the outside context, and insert the value in the buffer (@code{edebug-eval-print-last-sexp}). With prefix argument of zero (@kbd{C-u 0 C-j}), don't shorten long -items (like strings and lists). +items (like strings and lists) due to @code{edebug-print-length} and +@code{edebug-print-level} (@pxref{Printing in Edebug}). +@findex edebug-eval-last-sexp @item C-x C-e Evaluate the expression before point, in the context outside of Edebug (@code{edebug-eval-last-sexp}). +@findex edebug-update-eval-list @item C-c C-u Build a new evaluation list from the contents of the buffer (@code{edebug-update-eval-list}). +@findex edebug-delete-eval-item @item C-c C-d Delete the evaluation list group that point is in (@code{edebug-delete-eval-item}). @@ -804,24 +860,36 @@ not interrupt your debugging. several expressions have been added to it: @smallexample +@group (current-buffer) # ;--------------------------------------------------------------- +@end group +@group (selected-window) # ;--------------------------------------------------------------- +@end group +@group (point) 196 ;--------------------------------------------------------------- +@end group +@group bad-var "Symbol's value as variable is void: bad-var" ;--------------------------------------------------------------- +@end group +@group (recursion-depth) 0 ;--------------------------------------------------------------- +@end group +@group this-command eval-last-sexp ;--------------------------------------------------------------- +@end group @end smallexample To delete a group, move point into it and type @kbd{C-c C-d}, or simply @@ -832,8 +900,9 @@ the expression at a suitable place, insert a new comment line, then type contents don't matter. After selecting @file{*edebug*}, you can return to the source code -buffer with @kbd{C-c C-w}. The @file{*edebug*} buffer is killed when -you continue execution, and recreated next time it is needed. +buffer with @kbd{C-c C-w} (@pxref{Edebug Views}). The @file{*edebug*} +buffer is killed when you continue execution, and recreated next time it +is needed. @node Printing in Edebug @subsection Printing in Edebug @@ -867,8 +936,10 @@ to a non-@code{nil} value. Here is an example of code that creates a circular structure: @example +@group (setq a (list 'x 'y)) (setcar a a) +@end group @end example @noindent @@ -890,11 +961,14 @@ printing results. The default value is @code{t}. @node Trace Buffer @subsection Trace Buffer @cindex trace buffer +@cindex Edebug trace buffer +@cindex tracing in Edebug Edebug can record an execution trace, storing it in a buffer named @file{*edebug-trace*}. This is a log of function calls and returns, showing the function names and their arguments and values. To enable -trace recording, set @code{edebug-trace} to a non-@code{nil} value. +trace recording, set @code{edebug-trace} to a non-@code{nil} value +(@pxref{Edebug Options}). Making a trace buffer is not the same thing as using trace execution mode (@pxref{Edebug Execution Modes}). @@ -925,7 +999,7 @@ value of the last form in @var{body}. @defun edebug-trace format-string &rest format-args This function inserts text in the trace buffer. It computes the text -with @code{(apply 'format @var{format-string} @var{format-args})}. +with @w{@code{(apply 'format @var{format-string} @var{format-args})}}. It also appends a newline to separate entries. @end defun @@ -952,10 +1026,10 @@ correctly; Edebug will tell you when you have tried enough different conditions that each form has returned two different values. Coverage testing makes execution slower, so it is only done if -@code{edebug-test-coverage} is non-@code{nil}. Frequency counting is -performed for all executions of an instrumented function, even if the -execution mode is Go-nonstop, and regardless of whether coverage testing -is enabled. +@code{edebug-test-coverage} is non-@code{nil} (@pxref{Edebug Options}). +Frequency counting is performed for all executions of an instrumented +function, even if the execution mode is Go-nonstop, and regardless of +whether coverage testing is enabled. @kindex C-x X = @findex edebug-temp-display-freq-count @@ -988,6 +1062,7 @@ breakpoint, and setting @code{edebug-test-coverage} to @code{t}, when the breakpoint is reached, the frequency data looks like this: @example +@group (defun fac (n) (if (= n 0) (edebug)) ;#6 1 = =5 @@ -996,7 +1071,8 @@ the breakpoint is reached, the frequency data looks like this: (* n (fac (1- n))) ;# 5 0 1)) -;# 0 +a;# 0 +@end group @end example The comment lines show that @code{fac} was called 6 times. The @@ -1037,15 +1113,19 @@ using Edebug. You can also enlarge the value of @code{edebug-max-depth} if Edebug reaches the limit of recursion depth instrumenting code that contains very large quoted lists. +@vindex executing-kbd-macro @r{(Edebug)} @item The state of keyboard macro execution is saved and restored. While Edebug is active, @code{executing-kbd-macro} is bound to @code{nil} -unless @code{edebug-continue-kbd-macro} is non-@code{nil}. +unless @code{edebug-continue-kbd-macro} is non-@code{nil} (@pxref{Edebug +Options}). @end itemize @node Edebug Display Update @subsubsection Edebug Display Update +@cindex Edebug and display updates +@cindex display updates, and Edebug @c This paragraph is not filled, because LaLiberte's conversion script @c needs an xref to be on just one line. @@ -1066,13 +1146,13 @@ following data (though some of them are deliberately not restored if an error or quit signal occurs). @itemize @bullet -@item @cindex current buffer point and mark (Edebug) +@item Which buffer is current, and the positions of point and the mark in the current buffer, are saved and restored. -@item @cindex window configuration (Edebug) +@item The outside window configuration is saved and restored if @code{edebug-save-windows} is non-@code{nil} (@pxref{Edebug Options}). If the value of @code{edebug-save-windows} is a list, only the listed @@ -1086,7 +1166,7 @@ The window start and horizontal scrolling of the source code buffer are not restored, however, so that the display remains coherent within Edebug. @cindex buffer point changed by Edebug -@cindex edebug overwrites buffer point position +@cindex Edebug overwrites buffer point position Saving and restoring the outside window configuration can sometimes change the positions of point in the buffers on which the Lisp program you are debugging operates, especially if your program moves point. @@ -1098,11 +1178,14 @@ set @code{edebug-save-windows} to @code{nil} The value of point in each displayed buffer is saved and restored if @code{edebug-save-displayed-buffer-points} is non-@code{nil}. +@vindex overlay-arrow-position @r{(Edebug)} +@vindex overlay-arrow-string @r{(Edebug)} @item The variables @code{overlay-arrow-position} and @code{overlay-arrow-string} are saved and restored, so you can safely invoke Edebug from the recursive edit elsewhere in the same buffer. +@vindex cursor-in-echo-area @r{(Edebug)} @item @code{cursor-in-echo-area} is locally bound to @code{nil} so that the cursor shows up in the window. @@ -1110,6 +1193,8 @@ the cursor shows up in the window. @node Edebug Recursive Edit @subsubsection Edebug Recursive Edit +@cindex Edebug and recursive edit +@cindex recursive edit, and Edebug When Edebug is entered and actually reads commands from the user, it saves (and later restores) these additional data: @@ -1156,6 +1241,8 @@ Edebug is active, @code{defining-kbd-macro} is bound to @node Edebug and Macros @subsection Edebug and Macros +@cindex Edebug and macros +@cindex macros, debugging with Edebug To make Edebug properly instrument expressions that call macros, some extra care is needed. This subsection explains the details. @@ -1179,23 +1266,26 @@ time later.) Therefore, you must define an Edebug specification for each macro that Edebug will encounter, to explain the format of calls to that -macro. To do this, add a @code{debug} declaration to the macro -definition. Here is a simple example that shows the specification for -the @code{for} example macro (@pxref{Argument Evaluation}). +macro. To do this, add a @code{debug} declaration (@pxref{Declare +Form}) to the macro definition. Here is a simple example that shows the +specification for the @code{for} example macro (@pxref{Argument +Evaluation}). @smallexample +@group (defmacro for (var from init to final do &rest body) "Execute a simple \"for\" loop. For example, (for i from 1 to 10 do (print i))." (declare (debug (symbolp "from" form "to" form "do" &rest form))) ...) +@end group @end smallexample The Edebug specification says which parts of a call to the macro are forms to be evaluated. For simple macros, the specification often looks very similar to the formal argument list of the macro definition, but specifications are much more general than macro -arguments. @xref{Defining Macros}, for more explanation of +arguments. @xref{Declare Form}, for more details about the @code{declare} form. @c See, e.g., https://debbugs.gnu.org/10577 @@ -1259,6 +1349,7 @@ are instrumented. @subsubsection Specification List @cindex Edebug specification list +@cindex specification list, Edebug A @dfn{specification list} is required for an Edebug specification if some arguments of a macro call are evaluated while others are not. Some elements in a specification list match one or more arguments, but others @@ -1365,12 +1456,12 @@ This is successful when there are no more arguments to match at the current argument list level; otherwise it fails. See sublist specifications and the backquote example. +@cindex preventing backtracking, in Edebug specification list @item gate -@cindex preventing backtracking No argument is matched but backtracking through the gate is disabled while matching the remainder of the specifications at this level. This -is primarily used to generate more specific syntax error messages. See -@ref{Backtracking}, for more details. Also see the @code{let} example. +is primarily used to generate more specific syntax error messages. +@xref{Backtracking}, for more details. Also see the @code{let} example. @item &error @code{&error} should be followed by a string, an error message, in the @@ -1392,8 +1483,8 @@ sexps whose first element is a symbol and then lets with that head symbol according to @code{pcase--match-pat-args} and pass them to the @var{pf} it received as argument. -@item @var{other-symbol} @cindex indirect specifications +@item @var{other-symbol} Any other symbol in a specification list may be a predicate or an indirect specification. @@ -1415,8 +1506,8 @@ specification fails and the argument is not instrumented. Some suitable predicates include @code{symbolp}, @code{integerp}, @code{stringp}, @code{vectorp}, and @code{atom}. -@item [@var{elements}@dots{}] @cindex [@dots{}] (Edebug) +@item [@var{elements}@dots{}] A vector of elements groups the elements into a single @dfn{group specification}. Its meaning has nothing to do with vectors. @@ -1477,8 +1568,8 @@ The argument, a symbol, is the name of an argument of the defining form. However, lambda-list keywords (symbols starting with @samp{&}) are not allowed. -@item lambda-list @cindex lambda-list (Edebug) +@item lambda-list This matches a lambda list---the argument list of a lambda expression. @item def-body @@ -1798,6 +1889,7 @@ a breakpoint. Set to @code{nil} to prevent the pause, non-@code{nil} to allow it. @end defopt +@cindex Edebug, changing behavior with instrumented code @defopt edebug-behavior-alist By default, this alist contains one entry with the key @code{edebug} and a list of three functions, which are the default implementations @@ -1805,6 +1897,7 @@ of the functions inserted in instrumented code: @code{edebug-enter}, @code{edebug-before} and @code{edebug-after}. To change Edebug's behavior globally, modify the default entry. +@vindex edebug-behavior, symbol property Edebug's behavior may also be changed on a per-definition basis by adding an entry to this alist, with a key of your choice and three functions. Then set the @code{edebug-behavior} symbol property of an commit 1d88931a1c3ed71f9516f254513b4a91187d5924 Author: Michael Albinus Date: Sat Aug 23 12:20:02 2025 +0200 Minor fixes for file notifications on MS Windows * lisp/filenotify.el (file-notify-rm-all-watches): Clear hash. * test/lisp/filenotify-tests.el (file-notify--test-event-test): Fix check. (file-notify-test09-watched-file-in-watched-dir): Adapt test. diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 311da73a8ef..9e35f5413fb 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -500,7 +500,8 @@ DESCRIPTOR should be an object returned by `file-notify-add-watch'." (maphash (lambda (key _value) (file-notify-rm-watch key)) - file-notify-descriptors)) + file-notify-descriptors) + (setq file-notify-descriptors (clrhash file-notify-descriptors))) (defun file-notify-valid-p (descriptor) "Check a watch specified by its DESCRIPTOR. diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index e4cd3a27c2d..d1e1ac25007 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -519,8 +519,9 @@ When returning, they are deleted." We cannot pass arguments, so we assume that `file-notify--test-event' and `file-notify--test-file' are bound somewhere." ;; Check the descriptor. - (should (equal (file-notify--test-event-desc file-notify--test-event) - file-notify--test-desc)) + (unless (eq (file-notify--test-event-action file-notify--test-event) 'stopped) + (should (equal (file-notify--test-event-desc file-notify--test-event) + file-notify--test-desc))) ;; Check the file name. (should (string-prefix-p @@ -1439,7 +1440,8 @@ the file watch." (:random deleted deleted deleted stopped)) (delete-file file-notify--test-tmpfile)) (should (file-notify-valid-p file-notify--test-desc1)) - (should-not (file-notify-valid-p file-notify--test-desc2)) + (unless (string-equal (file-notify--test-library) "w32notify") + (should-not (file-notify-valid-p file-notify--test-desc2))) ;; Now we delete the directory. (file-notify--test-with-actions commit f3434a4f53f210504554006b598ca4320ad9039e Author: Eli Zaretskii Date: Sat Aug 23 11:34:10 2025 +0300 Fix line-prefix display when there's a 'display' string at BOL * src/xdisp.c (push_it): Reset the 'string_from_prefix_prop_p' flag. (try_window_id): Disable this optimization if the last unchanged at-beg row begins with a display or overlay string and there;s a line/wrap-prefix property on the row. (push_prefix_prop): Accept an additional argument FROM_BUFFER to indicate that the prefix property was found on buffer text underlying a display or overlay property, and set up the position to pop to accordingly. Reset the 'string_from_display_prop_p' flag of the iterator after pushing IT to set up for iterating the prefix string. (get_it_property): Use it->string, not it->object, as indication that prefix property is on a string. (get_line_prefix_it_property): Accept an additional argument: pointer to a flag indicating that the prefix property was found on buffer text underlying a display or overlay property. Callers adjusted. (handle_line_prefix): Use the FROM_BUFFER flag to correctly handle prefix properties on buffer text at the same position as a display string. (Bug#79275) diff --git a/src/xdisp.c b/src/xdisp.c index 2691296b282..b8088f692c4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7261,6 +7261,8 @@ push_it (struct it *it, struct text_pos *position) p->from_disp_prop_p = it->from_disp_prop_p; ++it->sp; + it->string_from_prefix_prop_p = false; + /* Save the state of the bidi iterator as well. */ if (it->bidi_p) bidi_push_it (&it->bidi_it); @@ -22657,8 +22659,23 @@ try_window_id (struct window *w) /* Give up if the row starts with a display property that draws on the fringes, since that could prevent correct display of line-prefix and wrap-prefix. */ - if (it.sp > 1 + if ((it.sp > 1 && it.method == GET_FROM_IMAGE && it.image_id == -1) + /* Give up if there's a line/wrap-prefix property on buffer + text, and the row begins with a display or overlay string. + This is because in that case the iterator state produced by + init_to_row_end is already set to the display/overlay + string, and thus cannot be used to display the prefix + before the display/overlay string. */ + || (it.sp == 1 + && it.method == GET_FROM_STRING + && !it.string_from_prefix_prop_p + && (!NILP (Fget_char_property (make_fixnum (IT_CHARPOS (it)), + Qline_prefix, + it.w->contents)) + || !NILP (Fget_char_property (make_fixnum (IT_CHARPOS (it)), + Qwrap_prefix, + it.w->contents))))) GIVE_UP (26); start_pos = it.current.pos; @@ -24710,15 +24727,29 @@ cursor_row_p (struct glyph_row *row) /* Push the property PROP so that it will be rendered at the current - position in IT. Return true if PROP was successfully pushed, false - otherwise. Called from handle_line_prefix to handle the - `line-prefix' and `wrap-prefix' properties. */ + position in IT. FROM_BUFFER non-zero means the property was found on + buffer text, even though IT is set to iterate a string. + Return true if PROP was successfully pushed, false otherwise. + Called from handle_line_prefix to handle the `line-prefix' and + `wrap-prefix' properties. */ static bool -push_prefix_prop (struct it *it, Lisp_Object prop) +push_prefix_prop (struct it *it, Lisp_Object prop, int from_buffer) { - struct text_pos pos = - STRINGP (it->string) ? it->current.string_pos : it->current.pos; + struct text_pos pos; + + if (STRINGP (it->string)) + { + if (from_buffer) /* a string, but prefix property from buffer */ + pos = it->current.string_pos; + else /* a string and prefix property from string */ + pos.charpos = pos.bytepos = 0; /* we have yet to iterate that string */ + } + else /* a buffer and prefix property from buffer */ + pos = it->current.pos; + + bool phoney_display_string = + from_buffer && STRINGP (it->string) && it->string_from_display_prop_p; eassert (it->method == GET_FROM_BUFFER || it->method == GET_FROM_DISPLAY_VECTOR @@ -24737,6 +24768,13 @@ push_prefix_prop (struct it *it, Lisp_Object prop) it->position not yet set when this function is called. */ push_it (it, &pos); + /* Reset this flag, since it is not relevant (comes from a display + string that follows iterator position). If we don't do that, any + display properties on the prefix string will be ignored. The call + to pop_it when we are done with the prefix will restore the flag. */ + if (phoney_display_string) + it->string_from_display_prop_p = false; + if (STRINGP (prop)) { if (SCHARS (prop) == 0) @@ -24794,7 +24832,7 @@ push_prefix_prop (struct it *it, Lisp_Object prop) #endif /* HAVE_WINDOW_SYSTEM */ else { - pop_it (it); /* bogus display property, give up */ + pop_it (it); /* bogus prefix property, give up */ return false; } @@ -24806,11 +24844,14 @@ push_prefix_prop (struct it *it, Lisp_Object prop) static Lisp_Object get_it_property (struct it *it, Lisp_Object prop) { - Lisp_Object position, object = it->object; + Lisp_Object position, object; - if (STRINGP (object)) - position = make_fixnum (IT_STRING_CHARPOS (*it)); - else if (BUFFERP (object)) + if (STRINGP (it->string)) + { + position = make_fixnum (IT_STRING_CHARPOS (*it)); + object = it->string; + } + else if (BUFFERP (it->object)) { position = make_fixnum (IT_CHARPOS (*it)); object = it->window; @@ -24825,15 +24866,21 @@ get_it_property (struct it *it, Lisp_Object prop) current IT->OBJECT and the underlying buffer text. */ static Lisp_Object -get_line_prefix_it_property (struct it *it, Lisp_Object prop) +get_line_prefix_it_property (struct it *it, Lisp_Object prop, + int *from_buffer) { Lisp_Object prefix = get_it_property (it, prop); + *from_buffer = false; + /* If we are looking at a display or overlay string, check also the underlying buffer text. */ - if (NILP (prefix) && it->sp > 0 && STRINGP (it->object)) - return Fget_char_property (make_fixnum (IT_CHARPOS (*it)), prop, - it->w->contents); + if (NILP (prefix) && it->sp > 0 && STRINGP (it->string)) + { + *from_buffer = true; + return Fget_char_property (make_fixnum (IT_CHARPOS (*it)), prop, + it->w->contents); + } return prefix; } @@ -24844,21 +24891,22 @@ handle_line_prefix (struct it *it) { Lisp_Object prefix; bool wrap_prop = false; + int from_buffer; if (it->continuation_lines_width > 0) { - prefix = get_line_prefix_it_property (it, Qwrap_prefix); + prefix = get_line_prefix_it_property (it, Qwrap_prefix, &from_buffer); if (NILP (prefix)) prefix = Vwrap_prefix; wrap_prop = true; } else { - prefix = get_line_prefix_it_property (it, Qline_prefix); + prefix = get_line_prefix_it_property (it, Qline_prefix, &from_buffer); if (NILP (prefix)) prefix = Vline_prefix; } - if (! NILP (prefix) && push_prefix_prop (it, prefix)) + if (! NILP (prefix) && push_prefix_prop (it, prefix, from_buffer)) { /* If the prefix is wider than the window, and we try to wrap it, it would acquire its own wrap prefix, and so on till the commit fdad3417dcfc9e1925e96a035e52fdcad3248f68 Author: john muhl Date: Wed Aug 20 12:28:24 2025 -0500 ; Fix typo in 'cursor-type' widget * lisp/cus-start.el: Swap height/width in descriptions for bar type cursors. (Bug#79281) diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 91cc6e22152..56471c1eae3 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -77,10 +77,10 @@ (const box) integer) (const :tag "Hollow cursor" hollow) (const :tag "Vertical bar" bar) - (cons :tag "Vertical bar with specified height" + (cons :tag "Vertical bar with specified width" (const bar) integer) (const :tag "Horizontal bar" hbar) - (cons :tag "Horizontal bar with specified width" + (cons :tag "Horizontal bar with specified height" (const hbar) integer) (const :tag "None "nil)))) (pcase-dolist