aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2023-03-27 12:25:16 +0100
committerJoão Távora2023-03-27 12:59:14 +0100
commitedc460e3b6c38eee97dde847987b2c29dd134653 (patch)
tree89dce921cf45579d001f9896dd042e7600c43b57
parentcbef1422fe3ba5d3327835f3952a0f42f7881716 (diff)
downloademacs-edc460e3b6c38eee97dde847987b2c29dd134653.tar.gz
emacs-edc460e3b6c38eee97dde847987b2c29dd134653.zip
Fix accidental backward-incompatible change (bug#62417)
This code used to work, but with the change of 59ecf25fc860 it stopped working: (defun foop (buffer-name _alist) (string-match "foop" buffer-name)) (add-to-list 'display-buffer-alist '(foop . display-buffer-other-frame)) This change makes it work again, restoring compatibility. * lisp/subr.el (buffer-match-p): Fix and adjust docstring. * lisp/window.el (display-buffer-alist): Adjust docstring. (display-buffer-assq-regexp): Make good on promise of display-buffer-alist.
-rw-r--r--lisp/subr.el6
-rw-r--r--lisp/window.el16
2 files changed, 13 insertions, 9 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index c73643f6d2b..8d27c831c96 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -7069,7 +7069,7 @@ CONDITION is either:
7069- the symbol t, to always match, 7069- the symbol t, to always match,
7070- the symbol nil, which never matches, 7070- the symbol nil, which never matches,
7071- a regular expression, to match a buffer name, 7071- a regular expression, to match a buffer name,
7072- a predicate function that takes a buffer object and ARG as 7072- a predicate function that takes BUFFER-OR-NAME and ARG as
7073 arguments, and returns non-nil if the buffer matches, 7073 arguments, and returns non-nil if the buffer matches,
7074- a cons-cell, where the car describes how to interpret the cdr. 7074- a cons-cell, where the car describes how to interpret the cdr.
7075 The car can be one of the following: 7075 The car can be one of the following:
@@ -7095,8 +7095,8 @@ CONDITION is either:
7095 (string-match-p condition (buffer-name buffer))) 7095 (string-match-p condition (buffer-name buffer)))
7096 ((pred functionp) 7096 ((pred functionp)
7097 (if (eq 1 (cdr (func-arity condition))) 7097 (if (eq 1 (cdr (func-arity condition)))
7098 (funcall condition buffer) 7098 (funcall condition buffer-or-name)
7099 (funcall condition buffer arg))) 7099 (funcall condition buffer-or-name arg)))
7100 (`(major-mode . ,mode) 7100 (`(major-mode . ,mode)
7101 (eq 7101 (eq
7102 (buffer-local-value 'major-mode buffer) 7102 (buffer-local-value 'major-mode buffer)
diff --git a/lisp/window.el b/lisp/window.el
index f6ddae854ad..4bdc26571f5 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -7501,8 +7501,8 @@ Its value takes effect before processing the ACTION argument of
7501If non-nil, this is an alist of elements (CONDITION . ACTION), 7501If non-nil, this is an alist of elements (CONDITION . ACTION),
7502where: 7502where:
7503 7503
7504 CONDITION is passed to `buffer-match-p', along with the buffer 7504 CONDITION is passed to `buffer-match-p', along with the name of
7505 that is to be displayed and the ACTION argument of 7505 the buffer that is to be displayed and the ACTION argument of
7506 `display-buffer', to check if ACTION should be used. 7506 `display-buffer', to check if ACTION should be used.
7507 7507
7508 ACTION is a cons cell (FUNCTIONS . ALIST), where FUNCTIONS is an 7508 ACTION is a cons cell (FUNCTIONS . ALIST), where FUNCTIONS is an
@@ -7559,12 +7559,16 @@ all fail. It should never be set by programs or users. See
7559(defun display-buffer-assq-regexp (buffer-or-name alist action) 7559(defun display-buffer-assq-regexp (buffer-or-name alist action)
7560 "Retrieve ALIST entry corresponding to buffer specified by BUFFER-OR-NAME. 7560 "Retrieve ALIST entry corresponding to buffer specified by BUFFER-OR-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 BUFFER-OR-NAME satisfy `buffer-match-p', using 7562key (its car) and the name of the buffer designated by
7563the key as CONDITION argument of `buffer-match-p'. ACTION should 7563BUFFER-OR-NAME satisfy `buffer-match-p', using the key as
7564have the form of the action argument passed to `display-buffer'." 7564CONDITION argument of `buffer-match-p'. ACTION should have the
7565form of the action argument passed to `display-buffer'."
7565 (catch 'match 7566 (catch 'match
7566 (dolist (entry alist) 7567 (dolist (entry alist)
7567 (when (buffer-match-p (car entry) buffer-or-name action) 7568 (when (buffer-match-p (car entry) (if (stringp buffer-or-name)
7569 buffer-or-name
7570 (buffer-name buffer-or-name))
7571 action)
7568 (throw 'match (cdr entry)))))) 7572 (throw 'match (cdr entry))))))
7569 7573
7570(defvar display-buffer--same-window-action 7574(defvar display-buffer--same-window-action