commit b7560fb63dce3a1c7cc7048ebcfca7c694e566d2 (HEAD, refs/remotes/origin/master) Author: Eshel Yaron Date: Sat Jun 7 21:35:57 2025 +0200 ; Use completion category 'recentf' in 'recentf-open' * lisp/recentf.el (recentf-open): Specify a completion category, 'recentf', when prompting for a recent file name. This allows users the customize the behavior of recent file name completion via 'completion-category-overrides'. (Bug#78596) diff --git a/lisp/recentf.el b/lisp/recentf.el index a773ea9ec01..006b3159bb9 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -505,7 +505,9 @@ Enable `recentf-mode' if it isn't already." (list (progn (unless recentf-mode (recentf-mode 1)) (completing-read (format-prompt "Open recent file" nil) - recentf-list nil t)))) + (completion-table-with-metadata + recentf-list '((category . recentf))) + nil t)))) (when file (funcall recentf-menu-action file))) commit 62014576dcd7fb71aa0e5dce01d451de8c24efc6 Author: Eli Zaretskii Date: Sat Jun 7 16:35:42 2025 +0300 Fix 'save-some-buffers' when file name has embedded '%' * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't assume the prompt will never include the '%' character. (Bug#78715) diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el index fc9912f189e..9c08f8dc2eb 100644 --- a/lisp/emacs-lisp/map-ynp.el +++ b/lisp/emacs-lisp/map-ynp.el @@ -167,13 +167,13 @@ The function's value is the number of actions taken." 'quit)) ;; Prompt in the echo area. (let ((cursor-in-echo-area (not no-cursor-in-echo-area))) - (message (substitute-command-keys - (format - (apply #'propertize - "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') " - minibuffer-prompt-properties) - prompt user-keys - (help-key)))) + (message "%s" (substitute-command-keys + (format + (apply #'propertize + "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') " + minibuffer-prompt-properties) + prompt user-keys + (help-key)))) (if minibuffer-auto-raise (raise-frame (window-frame (minibuffer-window)))) (unwind-protect @@ -194,14 +194,14 @@ The function's value is the number of actions taken." (when (fboundp 'set-text-conversion-style) (set-text-conversion-style text-conversion-style))) ;; Show the answer to the question. - (message (substitute-command-keys - (format - "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') %s" - prompt user-keys - (help-key) - (if (equal char -1) - "[end-of-keyboard-macro]" - (single-key-description char)))))) + (message "%s" (substitute-command-keys + (format + "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') %s" + prompt user-keys + (help-key) + (if (equal char -1) + "[end-of-keyboard-macro]" + (single-key-description char)))))) (setq def (lookup-key map (vector char)))) (cond ((eq def 'exit) (setq next (lambda () nil))) @@ -276,10 +276,10 @@ Type \\`SPC' or \\`y' to %s the current %s; (funcall try-again)) (t ;; Random char. - (message (substitute-command-keys - (format - "Type \\`%s' for help" - (help-key)))) + (message "%s" (substitute-command-keys + (format + "Type \\`%s' for help" + (help-key)))) (beep) (sit-for 1) (funcall try-again)))) commit b195ccfe892277075503f6b9c4c67a12db2632c1 Author: Sean Whitton Date: Sat Jun 7 13:25:59 2025 +0100 vc-git: Properly track unstaged deletions * lisp/vc/vc-git.el (vc-git--git-status-to-vc-state) (vc-git-after-dir-status-stage): Return/set 'missing' VC state, not 'removed' state, for unstaged deletions. (vc-git-dir-status-goto-stage): Add 'ls-files-missing' stage. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 52e480e0129..94a9a621194 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -374,11 +374,9 @@ in the order given by `git status'." (pcase code ("!!" 'ignored) ("??" 'unregistered) - ;; I have only seen this with a file that is only present in the - ;; index. Let us call this `removed'. - ("AD" 'removed) + ("D " 'removed) (_ (cond - ((string-match-p "^[ RD]+$" code) 'removed) + ((string-match-p "^.D$" code) 'missing) ((string-match-p "^[ M]+$" code) 'edited) ((string-match-p "^[ A]+$" code) 'added) ((string-match-p "^[ U]+$" code) 'conflict) @@ -594,9 +592,9 @@ or an empty string if none." (files (vc-git-dir-status-state->files git-state))) ;; First stage is always update-index. ;; After that, if no commits yet, ls-files-added. - ;; Otherwise, if there are commits, diff-index. - ;; After diff-index, if FILES non-nil, ls-files-up-to-date. - ;; After diff-index, if FILES nil, ls-files-conflict. + ;; Otherwise (there are commits), diff-index then ls-files-missing. + ;; After ls-files-missing, if FILES non-nil, ls-files-up-to-date. + ;; After ls-files-missing, if FILES nil, ls-files-conflict. ;; Then always ls-files-unknown. ;; Finally, if FILES non-nil, ls-files-ignored. (goto-char (point-min)) @@ -636,6 +634,11 @@ or an empty string if none." (vc-git-dir-status-update-file git-state name 'conflict (vc-git-create-extra-fileinfo perm perm))))) + ('ls-files-missing + (setq next-stage (if files 'ls-files-up-to-date 'ls-files-conflict)) + (while (re-search-forward "\\([^\0]*?\\)\0" nil t 1) + (vc-git-dir-status-update-file git-state (match-string 1) 'missing + (vc-git-create-extra-fileinfo 0 0)))) ('ls-files-unknown (when files (setq next-stage 'ls-files-ignored)) (while (re-search-forward "\\([^\0]*?\\)\0" nil t 1) @@ -649,7 +652,12 @@ or an empty string if none." ;; This is output from 'git diff-index' without --cached. ;; Therefore this stage compares HEAD and the working tree and ;; ignores the index (cf. git-diff-index(1) "RAW OUTPUT FORMAT"). - (setq next-stage (if files 'ls-files-up-to-date 'ls-files-conflict)) + ;; In particular that means it cannot distinguish between + ;; `removed' (deletion staged) and `missing' (deleted only in + ;; working tree). Set them all to `removed' and then do + ;; `ls-files-missing' as the next stage to possibly change some + ;; of those just set to `removed', to `missing'. + (setq next-stage 'ls-files-missing) (while (re-search-forward ":\\([0-7]\\{6\\}\\) \\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\(\\([ADMUT]\\)\0\\([^\0]+\\)\\|\\([CR]\\)[0-9]*\0\\([^\0]+\\)\0\\([^\0]+\\)\\)\0" nil t 1) @@ -720,6 +728,9 @@ or an empty string if none." ('ls-files-conflict (vc-git-command (current-buffer) 'async files "ls-files" "-z" "-u" "--")) + ('ls-files-missing + (vc-git-command (current-buffer) 'async files + "ls-files" "-z" "-d" "--")) ('ls-files-unknown (vc-git-command (current-buffer) 'async files "ls-files" "-z" "-o" "--exclude-standard" "--")) commit 29990aadda8d4f9fcf8961fdbc0a107469829e8c Author: Sean Whitton Date: Sat Jun 7 13:09:19 2025 +0100 ; * lisp/vc/vc-git.el (vc-git-after-dir-status-stage): Comments. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index ba72a3f0db5..52e480e0129 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -592,6 +592,13 @@ or an empty string if none." "Process sentinel for the various dir-status stages." (let (next-stage (files (vc-git-dir-status-state->files git-state))) + ;; First stage is always update-index. + ;; After that, if no commits yet, ls-files-added. + ;; Otherwise, if there are commits, diff-index. + ;; After diff-index, if FILES non-nil, ls-files-up-to-date. + ;; After diff-index, if FILES nil, ls-files-conflict. + ;; Then always ls-files-unknown. + ;; Finally, if FILES non-nil, ls-files-ignored. (goto-char (point-min)) (pcase (vc-git-dir-status-state->stage git-state) ('update-index @@ -639,6 +646,9 @@ or an empty string if none." (vc-git-dir-status-update-file git-state (match-string 1) 'ignored (vc-git-create-extra-fileinfo 0 0)))) ('diff-index + ;; This is output from 'git diff-index' without --cached. + ;; Therefore this stage compares HEAD and the working tree and + ;; ignores the index (cf. git-diff-index(1) "RAW OUTPUT FORMAT"). (setq next-stage (if files 'ls-files-up-to-date 'ls-files-conflict)) (while (re-search-forward ":\\([0-7]\\{6\\}\\) \\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\(\\([ADMUT]\\)\0\\([^\0]+\\)\\|\\([CR]\\)[0-9]*\0\\([^\0]+\\)\0\\([^\0]+\\)\\)\0" commit 82109aa7261ef98f41201b775f92d50ab7a4e6bb Author: Sean Whitton Date: Sat Jun 7 12:50:52 2025 +0100 Inline sole call to vc-git--state-code * lisp/vc/vc-git.el (vc-git--state-code): Delete. (vc-git-after-dir-status-stage): Inline it here. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index bea1a2a282a..ba72a3f0db5 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -314,15 +314,6 @@ Good example of file name that needs this: \"test[56].xx\".") (string= (substring str 0 (1+ (length name))) (concat name "\0")))))))) -(defun vc-git--state-code (code) - "Convert from a string to an added/deleted/modified state." - (pcase (string-to-char code) - (?M 'edited) - (?A 'added) - (?D 'removed) - (?U 'edited) ;; FIXME - (?T 'edited))) ;; FIXME - (defvar vc-git--program-version nil) (connection-local-set-profile-variables @@ -657,7 +648,7 @@ or an empty string if none." (state (or (match-string 4) (match-string 6))) (name (or (match-string 5) (match-string 7))) (new-name (match-string 8))) - (if new-name ; Copy or rename. + (if new-name ; Copy or rename. (if (eq ?C (string-to-char state)) (vc-git-dir-status-update-file git-state new-name 'added @@ -671,7 +662,13 @@ or an empty string if none." (vc-git-create-extra-fileinfo old-perm new-perm 'rename name))) (vc-git-dir-status-update-file - git-state name (vc-git--state-code state) + git-state name (pcase (string-to-char state) + (?M 'edited) + (?A 'added) + (?C 'added) + (?D 'removed) + (?U 'edited) ;; FIXME + (?T 'edited)) ;; FIXME (vc-git-create-extra-fileinfo old-perm new-perm))))))) ;; If we had files but now we don't, it's time to stop. (when (and files (not (vc-git-dir-status-state->files git-state))) commit 58797a67358754249d594f5f113b59031ca82e64 Merge: bd4674f93dc e4ba279b014 Author: Eli Zaretskii Date: Sat Jun 7 06:59:30 2025 -0400 Merge from origin/emacs-30 e4ba279b014 ; * doc/emacs/misc.texi (Network Security): Fix typo. 8fdb2d19b49 ; * lisp/treesit.el (treesit-beginning-of-defun): Doc fix... commit bd4674f93dc96a11dec6fab28c61103a879f7de7 Merge: c5e54fef676 41f8dc18dfd Author: Eli Zaretskii Date: Sat Jun 7 06:59:29 2025 -0400 ; Merge from origin/emacs-30 The following commit was skipped: 41f8dc18dfd Make xoauth2 auth fail when a smtp server replies 334 (Bu... commit c5e54fef6769fdb50262193555d35593b6f4d276 Merge: bed490f0f2d cd57a05542b Author: Eli Zaretskii Date: Sat Jun 7 06:59:29 2025 -0400 Merge from origin/emacs-30 cd57a05542b ; * etc/PROBLEMS: Improve the item about 'C-S-u' in PGTK ... commit bed490f0f2d2a8ec7181a7a6b65520a7e40f78fb Author: Eli Zaretskii Date: Sat Jun 7 13:32:41 2025 +0300 ; Fix last change (bug#78396) * lisp/paren.el (show-paren-not-in-comments-or-strings): * etc/NEWS: * doc/emacs/programs.texi (Matching): Fix wording and punctuation in doc string, defcustom tags, manual, and NEWS. diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 56cc321866d..446f1c864c7 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -1061,8 +1061,10 @@ nonblank line. @vindex show-paren-not-in-comments-or-strings If the value of @code{show-paren-not-in-comments-or-strings} is @code{all}, delimiters inside comments and strings will not be -highlighted. Otherwise if the value is set to @code{on-mismatch}, the -mismatched delimiters inside comments will not be highlighted. +highlighted. Otherwise, if the value is set to @code{on-mismatch}, the +mismatched delimiters inside comments will not be highlighted. The +default is @code{nil}, so delimiters inside comments and strings are +always highlighted. @end itemize @cindex Electric Pair mode diff --git a/etc/NEWS b/etc/NEWS index 1c65e2b1ad3..1f29fe5f0b4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -483,12 +483,13 @@ setting is an alternative to 'help-at-pt-display-when-idle'. Customize this to nil to disable starting new asynchronous native compilations while AC power is not connected. -** New user option 'show-paren-not-in-comments-or-strings' -This option tells show-paren not to highlight the parens that are inside -a comment or string. If set to 'all', do not highlight the parens that -are inside comments or strings. If set to 'on-mismatch', the parens -mismatched inside comments will not be highlighted. If set to nil (the -default), highlight the parens wherever they are. +** New user option 'show-paren-not-in-comments-or-strings'. +If this option is non-nil, it tells 'show-paren-mode' not to highlight +the parens that are inside comments and strings. If set to 'all', +'show-paren-mode' will never highlight parens that are inside comments +or strings. If set to 'on-mismatch', mismatched parens inside comments +and strings will not be highlighted. If set to nil (the default), +highlight the parens wherever they are. * Editing Changes in Emacs 31.1 diff --git a/lisp/paren.el b/lisp/paren.el index 986576a8e1d..5a70e2771b3 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -111,16 +111,17 @@ On non-graphical frames, the context is shown in the echo area." :version "29.1") (defcustom show-paren-not-in-comments-or-strings nil - "Do not highlight the paren that are inside a comment or string. -If set to `all', do not highlight the paren that are inside comments -or strings. -If set to `on-mismatch', the paren mismatched inside comments will not be -highlighted. -If set to nil (by default), highlight the paren wherever it is." + "If non-nil, do not highlight the parens inside comments and strings. +If set to `all', never highlight parens inside comments and strings. +If set to `on-mismatch', do not highlight mismatched parens inside +comments and strings. +If set to nil (the default), always highlight parens wherever they are." :type '(choice - (const :tag "Never highlight" all) - (const :tag "Don't highlight when mismatched" on-mismatch) - (const :tag "Always highlight" nil)) + (const :tag "Never highlight parens in comments and strings" all) + (const + :tag "Don't highlight mismatched parens in comments and strings" + on-mismatch) + (const :tag "Always highlight parens" nil)) :version "31.1") (defvar show-paren--idle-timer nil) commit 12397e3eb00c052455f03dc024e9335834f0c6ef Author: Elías Gabriel Pérez Date: Mon May 12 12:04:46 2025 -0600 Add option for not highlight parens inside comments or strings * lisp/paren.el (show-paren-not-in-comments-or-strings): New user option. (Bug#78396) (show-paren-function): Enclose code in 'catch' function. * etc/NEWS: Announce changes. * doc/emacs/programs.texi (Matching): Document new option. diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 0462f1925b7..56cc321866d 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -1056,6 +1056,13 @@ the opening delimiter is offscreen. The context is usually the line that contains the opening delimiter, except if the opening delimiter is on its own line, in which case the context includes the previous nonblank line. + +@item +@vindex show-paren-not-in-comments-or-strings +If the value of @code{show-paren-not-in-comments-or-strings} is +@code{all}, delimiters inside comments and strings will not be +highlighted. Otherwise if the value is set to @code{on-mismatch}, the +mismatched delimiters inside comments will not be highlighted. @end itemize @cindex Electric Pair mode diff --git a/etc/NEWS b/etc/NEWS index b054827a678..1c65e2b1ad3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -483,6 +483,13 @@ setting is an alternative to 'help-at-pt-display-when-idle'. Customize this to nil to disable starting new asynchronous native compilations while AC power is not connected. +** New user option 'show-paren-not-in-comments-or-strings' +This option tells show-paren not to highlight the parens that are inside +a comment or string. If set to 'all', do not highlight the parens that +are inside comments or strings. If set to 'on-mismatch', the parens +mismatched inside comments will not be highlighted. If set to nil (the +default), highlight the parens wherever they are. + * Editing Changes in Emacs 31.1 diff --git a/lisp/paren.el b/lisp/paren.el index 9d7f131e043..986576a8e1d 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -110,6 +110,19 @@ On non-graphical frames, the context is shown in the echo area." (const :tag "In child-frame" child-frame)) :version "29.1") +(defcustom show-paren-not-in-comments-or-strings nil + "Do not highlight the paren that are inside a comment or string. +If set to `all', do not highlight the paren that are inside comments +or strings. +If set to `on-mismatch', the paren mismatched inside comments will not be +highlighted. +If set to nil (by default), highlight the paren wherever it is." + :type '(choice + (const :tag "Never highlight" all) + (const :tag "Don't highlight when mismatched" on-mismatch) + (const :tag "Always highlight" nil)) + :version "31.1") + (defvar show-paren--idle-timer nil) (defvar show-paren--overlay (let ((ol (make-overlay (point) (point) nil t))) (delete-overlay ol) ol) @@ -450,88 +463,97 @@ It is the default value of `show-paren-data-function'." (setq show-paren--last-pos (point))) ;; Found something to highlight. - (let* ((here-beg (nth 0 data)) - (here-end (nth 1 data)) - (there-beg (nth 2 data)) - (there-end (nth 3 data)) - (mismatch (nth 4 data)) - (highlight-expression - (or (eq show-paren-style 'expression) - (and there-beg - (eq show-paren-style 'mixed) - (let ((closest (if (< there-beg here-beg) - (1- there-end) (1+ there-beg)))) - (not (pos-visible-in-window-p closest)))))) - (face - (cond - (mismatch - (if show-paren-ring-bell-on-mismatch - (beep)) - 'show-paren-mismatch) - (highlight-expression 'show-paren-match-expression) - (t 'show-paren-match)))) - ;; - ;; If matching backwards, highlight the closeparen - ;; before point as well as its matching open. - ;; If matching forward, and the openparen is unbalanced, - ;; highlight the paren at point to indicate misbalance. - ;; Otherwise, turn off any such highlighting. - (if (or (not here-beg) - (and (not show-paren-highlight-openparen) - (> here-end (point)) - (<= here-beg (point)) - (integerp there-beg))) - (delete-overlay show-paren--overlay-1) - (move-overlay show-paren--overlay-1 - here-beg here-end (current-buffer)) - ;; Always set the overlay face, since it varies. - (overlay-put show-paren--overlay-1 'priority show-paren-priority) - (overlay-put show-paren--overlay-1 'face face)) - ;; - ;; Turn on highlighting for the matching paren, if found. - ;; If it's an unmatched paren, turn off any such highlighting. - (if (not there-beg) - (delete-overlay show-paren--overlay) - (if highlight-expression - (move-overlay show-paren--overlay - (if (< there-beg here-beg) here-end here-beg) - (if (< there-beg here-beg) there-beg there-end) - (current-buffer)) - (move-overlay show-paren--overlay - there-beg there-end (current-buffer))) - ;; If `show-paren-context-when-offscreen' is non-nil and - ;; point is at a closing paren, show the context around the - ;; opening paren. - (let ((openparen (min here-beg there-beg))) - (when (and show-paren-context-when-offscreen - (not (eql show-paren--last-pos (point))) - (< there-beg here-beg) - ;; Either OPENPAREN position is fully visible... - (not (or (pos-visible-in-window-p openparen) - (let ((dfh4 (* 0.25 (default-font-height))) - (part - (pos-visible-in-window-p openparen - nil t))) - ;; ...or partially visible, and the - ;; invisible part is less than 1/4th - ;; of the default font height - (and (>= (length part) 4) - (< (nth 2 part) dfh4) - (< (nth 3 part) dfh4)))))) - (let ((context (blink-paren-open-paren-line-string - openparen)) - (message-log-max nil)) + (catch 'sp-exit + (let* ((here-beg (nth 0 data)) + (here-end (nth 1 data)) + (there-beg (nth 2 data)) + (there-end (nth 3 data)) + (mismatch (nth 4 data)) + (highlight-expression + (or (eq show-paren-style 'expression) + (and there-beg + (eq show-paren-style 'mixed) + (let ((closest (if (< there-beg here-beg) + (1- there-end) (1+ there-beg)))) + (not (pos-visible-in-window-p closest)))))) + (face (cond - ((eq show-paren-context-when-offscreen 'child-frame) - (show-paren--show-context-in-child-frame context)) - ((eq show-paren-context-when-offscreen 'overlay) - (show-paren--show-context-in-overlay context)) - (show-paren-context-when-offscreen - (minibuffer-message "Matches %s" context)))))) - (setq show-paren--last-pos (point)) - ;; Always set the overlay face, since it varies. - (overlay-put show-paren--overlay 'priority show-paren-priority) - (overlay-put show-paren--overlay 'face face)))))) + (mismatch + (if (and (eq show-paren-not-in-comments-or-strings 'on-mismatch) + (save-excursion + (syntax-ppss-context (syntax-ppss here-beg)))) + (throw 'sp-exit nil)) + (if show-paren-ring-bell-on-mismatch + (beep)) + 'show-paren-mismatch) + (highlight-expression 'show-paren-match-expression) + (t 'show-paren-match)))) + (if (and (eq show-paren-not-in-comments-or-strings 'all) + (save-excursion + (syntax-ppss-context (syntax-ppss here-beg)))) + (throw 'sp-exit nil)) + ;; + ;; If matching backwards, highlight the closeparen + ;; before point as well as its matching open. + ;; If matching forward, and the openparen is unbalanced, + ;; highlight the paren at point to indicate misbalance. + ;; Otherwise, turn off any such highlighting. + (if (or (not here-beg) + (and (not show-paren-highlight-openparen) + (> here-end (point)) + (<= here-beg (point)) + (integerp there-beg))) + (delete-overlay show-paren--overlay-1) + (move-overlay show-paren--overlay-1 + here-beg here-end (current-buffer)) + ;; Always set the overlay face, since it varies. + (overlay-put show-paren--overlay-1 'priority show-paren-priority) + (overlay-put show-paren--overlay-1 'face face)) + ;; + ;; Turn on highlighting for the matching paren, if found. + ;; If it's an unmatched paren, turn off any such highlighting. + (if (not there-beg) + (delete-overlay show-paren--overlay) + (if highlight-expression + (move-overlay show-paren--overlay + (if (< there-beg here-beg) here-end here-beg) + (if (< there-beg here-beg) there-beg there-end) + (current-buffer)) + (move-overlay show-paren--overlay + there-beg there-end (current-buffer))) + ;; If `show-paren-context-when-offscreen' is non-nil and + ;; point is at a closing paren, show the context around the + ;; opening paren. + (let ((openparen (min here-beg there-beg))) + (when (and show-paren-context-when-offscreen + (not (eql show-paren--last-pos (point))) + (< there-beg here-beg) + ;; Either OPENPAREN position is fully visible... + (not (or (pos-visible-in-window-p openparen) + (let ((dfh4 (* 0.25 (default-font-height))) + (part + (pos-visible-in-window-p openparen + nil t))) + ;; ...or partially visible, and the + ;; invisible part is less than 1/4th + ;; of the default font height + (and (>= (length part) 4) + (< (nth 2 part) dfh4) + (< (nth 3 part) dfh4)))))) + (let ((context (blink-paren-open-paren-line-string + openparen)) + (message-log-max nil)) + (cond + ((eq show-paren-context-when-offscreen 'child-frame) + (show-paren--show-context-in-child-frame context)) + ((eq show-paren-context-when-offscreen 'overlay) + (show-paren--show-context-in-overlay context)) + (show-paren-context-when-offscreen + (minibuffer-message "Matches %s" context)))))) + (setq show-paren--last-pos (point)) + ;; Always set the overlay face, since it varies. + (overlay-put show-paren--overlay 'priority show-paren-priority) + (overlay-put show-paren--overlay 'face face))))))) (provide 'paren) commit 9b30934756ab4872134847ad98350637d690b988 Author: JD Smith Date: Wed Jun 4 16:47:48 2025 -0400 Fix vertical-motion when an image is at EOL under word-wrap * src/xdisp.c (move_it_in_display_line_to): Fix return value under word-wrap when a screen line ends with an image that "just fits". (Bug#67604) diff --git a/src/xdisp.c b/src/xdisp.c index 9f3a684f25e..291e069395b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10392,10 +10392,21 @@ move_it_in_display_line_to (struct it *it, if (BUFFER_POS_REACHED_P ()) { if (ITERATOR_AT_END_OF_LINE_P (it)) - result = MOVE_POS_MATCH_OR_ZV; - else - result = MOVE_LINE_CONTINUED; - break; + { + result = MOVE_POS_MATCH_OR_ZV; + break; + } + /* When word-wrapping IMAGES or + STRETCHES which just fit on a line, + do not return early, before the + wrap point can be restored */ + else if ((prev_method != GET_FROM_STRETCH + && prev_method != GET_FROM_IMAGE) + || it->line_wrap != WORD_WRAP) + { + result = MOVE_LINE_CONTINUED; + break; + } } if (ITERATOR_AT_END_OF_LINE_P (it) && (it->line_wrap != WORD_WRAP commit 0bc2a5a2c178ac5e79ea577affe91e711b410123 Author: Eli Zaretskii Date: Sat Jun 7 12:43:39 2025 +0300 ; Fix last change (bug#77945) * lisp/faces.el (face-all-attributes): * etc/NEWS: Reformat and fix wording in documentation. diff --git a/etc/NEWS b/etc/NEWS index 04b3386aacd..b054827a678 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2058,8 +2058,8 @@ This option tells 'flash-face-bell-function' and for flash. +++ -*** 'face-all-attributes' now accepts an optional inherit argument. -'inherit' has the same meaning as the same argument to 'face-attribute', +*** 'face-all-attributes' now accepts an optional argument INHERIT. +It has the same meaning as the INHERIT argument to 'face-attribute', which already takes this argument for a single attribute. This is useful when you want the face attributes to be absolute and not 'unspecified'. diff --git a/lisp/faces.el b/lisp/faces.el index 3b48c243587..cf81013118b 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -444,11 +444,11 @@ If `inhibit-x-resources' is non-nil, this function does nothing." (defun face-all-attributes (face &optional frame inherit) "Return an alist stating the attributes of FACE. -Each element of the result has the form (ATTR-NAME . ATTR-VALUE). If -FRAME is omitted or nil the value describes the default attributes, but -if you specify FRAME, the value describes the attributes of FACE on -FRAME. INHERIT has the same meaning as the same argument to -`face-attribute', which see." +Each element of the result has the form (ATTR-NAME . ATTR-VALUE). +If FRAME is omitted or nil the value describes the default attributes, +but if you specify FRAME, the value describes the attributes of FACE +on FRAME. +INHERIT has the same meaning as in `face-attribute', which see." (mapcar (lambda (pair) (let ((attr (car pair))) (cons attr (face-attribute face attr (or frame t) inherit)))) commit 13fa74b73c36de2439f7cae13f25647fb46161e9 Author: shipmints Date: Sun Apr 20 13:09:35 2025 -0400 Add optional inherit argument to 'face-all-attributes' (bug#77945) * lisp/faces.el (face-all-attributes): Add 'inherit' argument and pass to 'face-attribute'. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 3b48cb93405..55652682505 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -3186,18 +3186,21 @@ For example: @end example @end defun -@defun face-all-attributes face &optional frame +@defun face-all-attributes face &optional frame inherit This function returns an alist of attributes of @var{face}. The elements of the result are name-value pairs of the form @w{@code{(@var{attr-name} . @var{attr-value})}}. Optional argument @var{frame} specifies the frame whose definition of @var{face} to return; if omitted or @code{nil}, the returned value describes the default attributes of @var{face} for newly created frames, i.e.@: the -values these attributes have before applying the face spec in the -face's @code{defface} definition or the spec set by -@code{face-spec-set}. These default values of the attributes are -normally @code{unspecified}, unless you have specified some other -value using @code{set-face-attribute}; see below. +values these attributes have before applying the face spec in the face's +@code{defface} definition or the spec set by @code{face-spec-set}. +These default values of the attributes are normally @code{unspecified}, +unless you have specified some other value using +@code{set-face-attribute}; see below. The optional argument +@var{inherit} has the same meaning as the same argument to +@code{face-attribute}, which see. This is useful when you want the face +attributes to be absolute and not @code{unspecified}. @end defun @defun merge-face-attribute attribute value1 value2 diff --git a/etc/NEWS b/etc/NEWS index 0ecd911633c..04b3386aacd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2057,6 +2057,13 @@ This option tells 'flash-face-bell-function' and 'flash-echo-area-bell-function' which face attributes should be used for flash. ++++ +*** 'face-all-attributes' now accepts an optional inherit argument. +'inherit' has the same meaning as the same argument to 'face-attribute', +which already takes this argument for a single attribute. This is +useful when you want the face attributes to be absolute and not +'unspecified'. + --- ** Flymake diff --git a/lisp/faces.el b/lisp/faces.el index dbc0a2e04f6..3b48c243587 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -442,15 +442,16 @@ If `inhibit-x-resources' is non-nil, this function does nothing." (symbol-name (check-face face))) -(defun face-all-attributes (face &optional frame) +(defun face-all-attributes (face &optional frame inherit) "Return an alist stating the attributes of FACE. -Each element of the result has the form (ATTR-NAME . ATTR-VALUE). -If FRAME is omitted or nil the value describes the default attributes, -but if you specify FRAME, the value describes the attributes -of FACE on FRAME." +Each element of the result has the form (ATTR-NAME . ATTR-VALUE). If +FRAME is omitted or nil the value describes the default attributes, but +if you specify FRAME, the value describes the attributes of FACE on +FRAME. INHERIT has the same meaning as the same argument to +`face-attribute', which see." (mapcar (lambda (pair) (let ((attr (car pair))) - (cons attr (face-attribute face attr (or frame t))))) + (cons attr (face-attribute face attr (or frame t) inherit)))) face-attribute-name-alist)) (defun face-attribute (face attribute &optional frame inherit) commit fc96cc1feb488dfeffd760d63872515f04033894 Author: Eli Zaretskii Date: Sat Jun 7 12:21:38 2025 +0300 Avoid whitespace-mode breaking standard-display-unicode-special-glyphs * lisp/whitespace.el (whitespace-display-char-on): Copy from 'standard-display-table' if 'buffer-display-table' is nil. This avoids overwriting display-table customizations by features that modify 'standard-display-table' for global effects. (Bug#78522) diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 10425759562..58ba0db8c90 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -2480,7 +2480,8 @@ purposes)." ;; Assure `buffer-display-table' is unique ;; when two or more windows are visible. (setq buffer-display-table - (copy-sequence buffer-display-table))) + (copy-sequence (or buffer-display-table + standard-display-table)))) (unless buffer-display-table (setq buffer-display-table (make-display-table))) (dolist (entry whitespace-display-mappings) commit 9629ade0b0366d62202419f37b467fe0e6caf227 Author: Eli Zaretskii Date: Sat Jun 7 12:15:33 2025 +0300 Teach checkdoc about (:this that) in cl-defun * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): Support more complex keyword args. (Bug#78543) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 355a0c5e98a..d32a9b6389d 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1761,24 +1761,31 @@ function,command,variable,option or symbol." ms1)))))) ;; Addendum: Make sure they appear in the doc in the same ;; order that they are found in the arg list. - (let ((args (nthcdr 4 fp)) - (last-pos 0) - (found 1) - (order (and (nth 3 fp) (car (nth 3 fp)))) - (nocheck (append '("&optional" "&rest" "&key" "&aux" - "&context" "&environment" "&whole" - "&body" "&allow-other-keys" "nil") - (nth 3 fp))) + (let* ((args (nthcdr 4 fp)) + (this-arg (car args)) + (this-arg (if (string-prefix-p ":" this-arg) + (substring this-arg 1) + this-arg)) + (last-pos 0) + (found 1) + (order (and (nth 3 fp) (car (nth 3 fp)))) + (nocheck (append '("&optional" "&rest" "&key" "&aux" + "&context" "&environment" "&whole" + "&body" "&allow-other-keys" "nil") + (nth 3 fp))) (inopts nil)) (while (and args found (> found last-pos)) (if (or (member (car args) nocheck) - (string-match "\\`_" (car args))) + (string-match "\\`_" this-arg)) (setq args (cdr args) + this-arg (if (string-prefix-p ":" (car args)) + (substring (car args) 1) + (car args)) inopts t) (setq last-pos found found (save-excursion (re-search-forward - (concat "\\<" (upcase (car args)) + (concat "\\<" (upcase this-arg) ;; Require whitespace OR ;; ITEMth OR ;; ITEMs @@ -1791,7 +1798,7 @@ function,command,variable,option or symbol." ms1)))))) ;; and see if the user wants to capitalize it. (if (save-excursion (re-search-forward - (concat "\\<\\(" (car args) + (concat "\\<\\(" this-arg ;; Require whitespace OR ;; ITEMth OR ;; ITEMs @@ -1801,10 +1808,15 @@ function,command,variable,option or symbol." ms1)))))) (match-beginning 1) (match-end 1) (format-message "If this is the argument `%s', it should appear as %s. Fix?" - (car args) (upcase (car args))) - (upcase (car args)) t) + this-arg (upcase this-arg)) + (upcase this-arg) t) (setq found (match-beginning 1)))))) - (if found (setq args (cdr args))))) + (if found (setq args + (cdr args) + this-arg (if (string-prefix-p ":" + (car args)) + (substring (car args) 1) + (car args)))))) (if (not found) ;; It wasn't found at all! Offer to attach this new symbol ;; to the end of the documentation string. @@ -1817,7 +1829,7 @@ function,command,variable,option or symbol." ms1)))))) (goto-char e) (forward-char -1) (insert "\n" (if inopts "Optional a" "A") - "rgument " (upcase (car args)) + "rgument " (upcase this-arg) " ") (insert (read-string "Describe: ")) (if (not (save-excursion (forward-char -1) @@ -1828,7 +1840,7 @@ function,command,variable,option or symbol." ms1)))))) (checkdoc-create-error (format-message "Argument `%s' should appear (as %s) in the doc string" - (car args) (upcase (car args))) + (car args) (upcase this-arg)) s (marker-position e)))) (if (or (and order (eq order 'yes)) (and (not order) checkdoc-arguments-in-order-flag)) commit e1fcb25fc3aa05d878d385302b62cd00760bc1a3 Author: Eli Zaretskii Date: Sat Jun 7 11:01:35 2025 +0300 Fix semantic-utest-ia tests * test/lisp/cedet/semantic-utest-ia.el (semantic-ia-utest): Clean up better, to avoid affecting the next test. diff --git a/test/lisp/cedet/semantic-utest-ia.el b/test/lisp/cedet/semantic-utest-ia.el index 7626cc06236..99380d72e09 100644 --- a/test/lisp/cedet/semantic-utest-ia.el +++ b/test/lisp/cedet/semantic-utest-ia.el @@ -141,7 +141,8 @@ (semantic-src-utest-buffer-refs)) (kill-buffer b) - )))) + ))) + (semantic-mode -1)) (defun semantic-ia-utest-buffer () "Run analyzer completion unit-test pass in the current buffer." commit d8993eff116a7dc350fb7ccc1ef3fa99f5c57b2e Author: Lin Sun Date: Fri Mar 7 06:50:17 2025 +0000 * lisp/cedet/semantic.el: Turn off semantic-mode in all buffers (bug#76815), diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index c0caa342865..542fea3df2a 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el @@ -1075,11 +1075,13 @@ Semantic mode. ;; re-activated. (setq semantic-new-buffer-fcn-was-run nil) ;; restore the original `imenu-create-index-function' - (unless (eq semantic--create-index-function-origin - imenu-create-index-function) - (setq imenu-create-index-function - (or semantic--create-index-function-origin - (default-value 'imenu-create-index-function)))))) + (dolist (b (buffer-list)) + (with-current-buffer b + (unless (eq semantic--create-index-function-origin + imenu-create-index-function) + (setq imenu-create-index-function + (or semantic--create-index-function-origin + (default-value 'imenu-create-index-function)))))))) ;;; Autoload some functions that are not in semantic/loaddefs commit e4ba279b014417c77cf494575434c0714b03eaa3 (refs/remotes/origin/emacs-30) Author: Robert Pluim Date: Thu Jun 5 16:09:11 2025 +0200 ; * doc/emacs/misc.texi (Network Security): Fix typo. diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index fbcb7294505..c35afcf802c 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -430,7 +430,7 @@ checks in @code{network-security-protocol-checks}). The protocols older than @acronym{TLS1.0} are believed to be vulnerable to a variety of attacks, and you may want to avoid using these if what you're doing requires higher security. (This is the -@code{ssl} check in @code{network-security-protocol-checks}). +@code{version} check in @code{network-security-protocol-checks}). @item Triple DES (or @acronym{3DES}) cipher The @acronym{3DES} stream cipher provides at most 112 bits of commit 8fdb2d19b495e392f47046513e05c8992fee2b4c Author: Eli Zaretskii Date: Fri Jun 6 10:00:20 2025 +0300 ; * lisp/treesit.el (treesit-beginning-of-defun): Doc fix (bug#78703). diff --git a/lisp/treesit.el b/lisp/treesit.el index 2b5989fcaee..512e82375f1 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2479,7 +2479,10 @@ This is a tree-sitter equivalent of `beginning-of-defun'. Behavior of this function depends on `treesit-defun-type-regexp' and `treesit-defun-skipper'. If `treesit-defun-type-regexp' is not set, Emacs also looks for definition of defun in -`treesit-thing-settings'." +`treesit-thing-settings'. + +Whether this goes to the innermost nested defun or a top-level +one is determined by the value of `treesit-defun-tactic'." (interactive "^p") (or (not (eq this-command 'treesit-beginning-of-defun)) (eq last-command 'treesit-beginning-of-defun) commit 41f8dc18dfdb003dbcd27f619960f2533a02fde2 Author: Xiyue Deng Date: Fri May 16 02:48:52 2025 -0700 Make xoauth2 auth fail when a smtp server replies 334 (Bug#78366) * lisp/mail/smtpmail.el (smtpmail-try-auth-method): Throw error 535 when receiving a "334 server challenge" reply. (cherry picked from commit 53371c959462a677a29ee869b3b6627facf3ed79) diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index dcec0b1d9e9..dc3293fb2f4 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -639,11 +639,21 @@ USER and PASSWORD should be non-nil." (cl-defmethod smtpmail-try-auth-method (process (_mech (eql 'xoauth2)) user password) - (smtpmail-command-or-throw - process - (concat "AUTH XOAUTH2 " - (base64-encode-string - (concat "user=" user "\1auth=Bearer " password "\1\1") t)))) + (let ((ret (smtpmail-command-or-throw + process + (concat "AUTH XOAUTH2 " + (base64-encode-string + (concat "user=" user "\1auth=Bearer " password "\1\1") + t))))) + (if (eq (car ret) 334) + ;; When a server returns 334 server challenge, it usually means + ;; the credentials it received were wrong (e.g. was an actual + ;; password instead of an access token). In such a case, we + ;; should return a string with 535 to indicate a failure so that + ;; smtpmail will try other authentication mechanisms. See also + ;; https://debbugs.gnu.org/78366. + (throw 'done "535 5.7.8 Authentication credentials invalid") + ret))) (defun smtpmail-response-code (string) (when string commit cd57a05542bd9cc5b9866d2b6b15d5125cf9e40e Author: Eli Zaretskii Date: Mon Jun 2 18:34:21 2025 +0300 ; * etc/PROBLEMS: Improve the item about 'C-S-u' in PGTK build. diff --git a/etc/PROBLEMS b/etc/PROBLEMS index b76c7789e54..e0d34090b1e 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -3660,6 +3660,12 @@ To disable the use of GTK input methods, evaluate: This will also cause system input methods and features such as the Compose key to stop working. +We are told that 'C-S-u' is misinterpreted due to the GTK "feature" +whereby 'C-S-u' is used to input characters by their Unicode codepoints, +and that this can be changed or turned off using the 'ibus-setup' +program under the Emoji tab, or by changing the setting of the dconf key +'org.freedesktop.ibus.panel.emoji'. + On X Windows, users should not use Emacs configured with PGTK, since this and many other problems do not exist on the regular X builds.