branch: master commit e92d28237ccd55659dc643cfd4c9cef107ce8e41 Author: Constantin Kulikov <zxnotd...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
Make ivy-ignore-buffers similar to ido-ignore-buffers. Fixes #382 --- ivy.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ivy.el b/ivy.el index a9738dc..76a4f58 100644 --- a/ivy.el +++ b/ivy.el @@ -2485,9 +2485,9 @@ CANDS is a list of strings." (setq ivy--virtual-buffers (nreverse virtual-buffers)) (mapcar #'car ivy--virtual-buffers)))) -(defcustom ivy-ignore-buffers nil - "List of regexps matching buffer names to ignore." - :type '(repeat regexp)) +(defcustom ivy-ignore-buffers '("\\` ") + "List of regexps or functions matching buffer names to ignore." + :type '(repeat (choice regexp function))) (defun ivy--buffer-list (str &optional virtual) "Return the buffers that match STR. @@ -2562,8 +2562,10 @@ Skip buffers that match `ivy-ignore-buffers'." (or (cl-remove-if (lambda (buf) (cl-find-if - (lambda (regexp) - (string-match regexp buf)) + (lambda (f-or-r) + (if (functionp f-or-r) + (funcall ff buf) + (string-match-p f-or-r buf))) ivy-ignore-buffers)) res) res))))