aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2023-03-28 14:08:29 +0300
committerEli Zaretskii2023-03-28 14:08:29 +0300
commit4ec4f614c712b8283b669feb7a6f87a700cdf2e6 (patch)
treed7622397ac06bb6dc59d15284fa861e5a80f6e2d
parentba3ade58f3b7083b40e4f995388d6246cc81ba82 (diff)
downloademacs-4ec4f614c712b8283b669feb7a6f87a700cdf2e6.tar.gz
emacs-4ec4f614c712b8283b669feb7a6f87a700cdf2e6.zip
; 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)
-rw-r--r--lisp/window.el16
1 files 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
7556`display-buffer'.") 7556`display-buffer'.")
7557(put 'display-buffer-fallback-action 'risky-local-variable t) 7557(put 'display-buffer-fallback-action 'risky-local-variable t)
7558 7558
7559(defun display-buffer-assq-regexp (buffer-or-name alist action) 7559(defun display-buffer-assq-regexp (buffer-name alist action)
7560 "Retrieve ALIST entry corresponding to buffer specified by BUFFER-OR-NAME. 7560 "Retrieve ALIST entry corresponding to buffer whose name is BUFFER-NAME.
7561This returns the cdr of the alist entry ALIST if the entry's 7561This returns the cdr of the alist entry ALIST if the entry's
7562key (its car) and the name of the buffer designated by 7562key (its car) and the name of the buffer designated by
7563BUFFER-OR-NAME satisfy `buffer-match-p', using the key as 7563BUFFER-NAME satisfy `buffer-match-p', using the key as
7564CONDITION argument of `buffer-match-p'. ACTION should have the 7564CONDITION argument of `buffer-match-p'. ACTION should have the
7565form of the action argument passed to `display-buffer'." 7565form of the action argument passed to `display-buffer'."
7566 (catch 'match 7566 (catch 'match
7567 (dolist (entry alist) 7567 (dolist (entry alist)
7568 (when (buffer-match-p (car entry) (if (stringp buffer-or-name) 7568 (when (buffer-match-p (car entry) buffer-name action)
7569 buffer-or-name
7570 (buffer-name buffer-or-name))
7571 action)
7572 (throw 'match (cdr entry)))))) 7569 (throw 'match (cdr entry))))))
7573 7570
7574(defvar display-buffer--same-window-action 7571(defvar display-buffer--same-window-action
@@ -7727,6 +7724,9 @@ specified by the ACTION argument."
7727 (let ((buffer (if (bufferp buffer-or-name) 7724 (let ((buffer (if (bufferp buffer-or-name)
7728 buffer-or-name 7725 buffer-or-name
7729 (get-buffer buffer-or-name))) 7726 (get-buffer buffer-or-name)))
7727 (buf-name (if (bufferp buffer-or-name)
7728 (buffer-name buffer-or-name)
7729 buffer-or-name))
7730 ;; Make sure that when we split windows the old window keeps 7730 ;; Make sure that when we split windows the old window keeps
7731 ;; point, bug#14829. 7731 ;; point, bug#14829.
7732 (split-window-keep-point t) 7732 (split-window-keep-point t)
@@ -7735,7 +7735,7 @@ specified by the ACTION argument."
7735 (unless (listp action) (setq action nil)) 7735 (unless (listp action) (setq action nil))
7736 (let* ((user-action 7736 (let* ((user-action
7737 (display-buffer-assq-regexp 7737 (display-buffer-assq-regexp
7738 buffer display-buffer-alist action)) 7738 buf-name display-buffer-alist action))
7739 (special-action (display-buffer--special-action buffer)) 7739 (special-action (display-buffer--special-action buffer))
7740 ;; Extra actions from the arguments to this function: 7740 ;; Extra actions from the arguments to this function:
7741 (extra-action 7741 (extra-action