emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 4ec4f614c71: ; Fix incompatibility in 'display-buffer-assq-rege


From: Eli Zaretskii
Subject: emacs-29 4ec4f614c71: ; Fix incompatibility in 'display-buffer-assq-regexp'
Date: Tue, 28 Mar 2023 07:09:42 -0400 (EDT)

branch: emacs-29
commit 4ec4f614c712b8283b669feb7a6f87a700cdf2e6
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    ; Fix incompatibility in 'display-buffer-assq-regexp'
    
    * lisp/window.el (display-buffer-assq-regexp): Make it accept a
    buffer's name again, as it did in Emacs 28.  This makes computing
    the buffer's name inside the function unnecessary.
    (display-buffer): Always pass the buffer's name to
    'display-buffer-assq-regexp'.  (Bug#62417)
---
 lisp/window.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/window.el b/lisp/window.el
index 4bdc26571f5..016d53ffbdd 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -7556,19 +7556,16 @@ all fail.  It should never be set by programs or users. 
 See
 `display-buffer'.")
 (put 'display-buffer-fallback-action 'risky-local-variable t)
 
-(defun display-buffer-assq-regexp (buffer-or-name alist action)
-  "Retrieve ALIST entry corresponding to buffer specified by BUFFER-OR-NAME.
+(defun display-buffer-assq-regexp (buffer-name alist action)
+  "Retrieve ALIST entry corresponding to buffer whose name is BUFFER-NAME.
 This returns the cdr of the alist entry ALIST if the entry's
 key (its car) and the name of the buffer designated by
-BUFFER-OR-NAME satisfy `buffer-match-p', using the key as
+BUFFER-NAME satisfy `buffer-match-p', using the key as
 CONDITION argument of `buffer-match-p'.  ACTION should have the
 form of the action argument passed to `display-buffer'."
   (catch 'match
     (dolist (entry alist)
-      (when (buffer-match-p (car entry) (if (stringp buffer-or-name)
-                                            buffer-or-name
-                                          (buffer-name buffer-or-name))
-                                          action)
+      (when (buffer-match-p (car entry) buffer-name action)
         (throw 'match (cdr entry))))))
 
 (defvar display-buffer--same-window-action
@@ -7727,6 +7724,9 @@ specified by the ACTION argument."
   (let ((buffer (if (bufferp buffer-or-name)
                    buffer-or-name
                  (get-buffer buffer-or-name)))
+        (buf-name (if (bufferp buffer-or-name)
+                      (buffer-name buffer-or-name)
+                    buffer-or-name))
        ;; Make sure that when we split windows the old window keeps
        ;; point, bug#14829.
        (split-window-keep-point t)
@@ -7735,7 +7735,7 @@ specified by the ACTION argument."
     (unless (listp action) (setq action nil))
     (let* ((user-action
             (display-buffer-assq-regexp
-             buffer display-buffer-alist action))
+             buf-name display-buffer-alist action))
            (special-action (display-buffer--special-action buffer))
            ;; Extra actions from the arguments to this function:
            (extra-action



reply via email to

[Prev in Thread] Current Thread [Next in Thread]