* window.el (display-buffer-assq-regexp): Use buffer-match
This commit is contained in:
parent
ea54062fdf
commit
59ecf25fc8
1 changed files with 4 additions and 11 deletions
|
@ -7498,19 +7498,12 @@ all fail. It should never be set by programs or users. See
|
||||||
(defun display-buffer-assq-regexp (buffer-name alist action)
|
(defun display-buffer-assq-regexp (buffer-name alist action)
|
||||||
"Retrieve ALIST entry corresponding to BUFFER-NAME.
|
"Retrieve ALIST entry corresponding to BUFFER-NAME.
|
||||||
This returns the cdr of the alist entry ALIST if either its key
|
This returns the cdr of the alist entry ALIST if either its key
|
||||||
is a string that matches BUFFER-NAME, as reported by
|
satisfied a BUFFER-NAME per `buffer-match'. ACTION should have
|
||||||
`string-match-p'; or if the key is a function that returns
|
the form of the action argument passed to `display-buffer'."
|
||||||
non-nil when called with three arguments: the ALIST key,
|
|
||||||
BUFFER-NAME and ACTION. ACTION should have the form of the
|
|
||||||
action argument passed to `display-buffer'."
|
|
||||||
(catch 'match
|
(catch 'match
|
||||||
(dolist (entry alist)
|
(dolist (entry alist)
|
||||||
(let ((key (car entry)))
|
(when (buffer-match-p (car entry) buffer-name action)
|
||||||
(when (or (and (stringp key)
|
(throw 'match (cdr entry))))))
|
||||||
(string-match-p key buffer-name))
|
|
||||||
(and (functionp key)
|
|
||||||
(funcall key buffer-name action)))
|
|
||||||
(throw 'match (cdr entry)))))))
|
|
||||||
|
|
||||||
(defvar display-buffer--same-window-action
|
(defvar display-buffer--same-window-action
|
||||||
'(display-buffer-same-window
|
'(display-buffer-same-window
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue