[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 59ecf25fc8 2/3: * window.el (display-buffer-assq-regexp): Use buf
From: |
Philip Kaludercic |
Subject: |
master 59ecf25fc8 2/3: * window.el (display-buffer-assq-regexp): Use buffer-match |
Date: |
Fri, 15 Apr 2022 04:07:27 -0400 (EDT) |
branch: master
commit 59ecf25fc86081c9df05b84194c36414c225c265
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
* window.el (display-buffer-assq-regexp): Use buffer-match
---
lisp/window.el | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/lisp/window.el b/lisp/window.el
index dd297a3169..2da2f8bb2c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -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)
"Retrieve ALIST entry corresponding to BUFFER-NAME.
This returns the cdr of the alist entry ALIST if either its key
-is a string that matches BUFFER-NAME, as reported by
-`string-match-p'; or if the key is a function that returns
-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'."
+satisfied a BUFFER-NAME per `buffer-match'. ACTION should have
+the form of the action argument passed to `display-buffer'."
(catch 'match
(dolist (entry alist)
- (let ((key (car entry)))
- (when (or (and (stringp key)
- (string-match-p key buffer-name))
- (and (functionp key)
- (funcall key buffer-name action)))
- (throw 'match (cdr entry)))))))
+ (when (buffer-match-p (car entry) buffer-name action)
+ (throw 'match (cdr entry))))))
(defvar display-buffer--same-window-action
'(display-buffer-same-window