diff options
| author | Constantine Vetoshev <gepardcv@gmail.com> | 2020-04-14 15:48:24 -0700 |
|---|---|---|
| committer | Constantine Vetoshev <gepardcv@gmail.com> | 2020-04-14 15:49:55 -0700 |
| commit | 5184563007c73d0dc236c408219c18ff5dd6044e (patch) | |
| tree | 26ca53eb6bb508aba93893358da613169a2222c8 | |
| parent | 446121b16de38bc56e5b9f65f23767909ed2b22e (diff) | |
Simplify regex handling.
| -rw-r--r-- | perspective.el | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/perspective.el b/perspective.el index 7c510d3..d368246 100644 --- a/perspective.el +++ b/perspective.el @@ -151,11 +151,13 @@ After BODY is evaluated, frame parameters are reset to their original values." (defun persp--make-ignore-buffer-rx () (defvar ido-ignore-buffers) - (when ido-ignore-buffers - ;; convert a list of regexps to one - (rx-to-string (append (list 'or) - (mapcar (lambda (rx) `(regexp ,rx)) - ido-ignore-buffers))))) + (if ido-ignore-buffers + ;; convert a list of regexps to one + (rx-to-string (append (list 'or) + (mapcar (lambda (rx) `(regexp ,rx)) + ido-ignore-buffers))) + ;; return a regex which matches nothing, and therefore should ignore nothing + "$^")) (defmacro persp-current-buffers () "Return a list of all buffers in the current perspective." @@ -166,9 +168,7 @@ After BODY is evaluated, frame parameters are reset to their original values." (let ((ignore-rx (persp--make-ignore-buffer-rx))) (cl-loop for buf in (persp-current-buffers) if (and (buffer-live-p buf) - (if ignore-rx - (not (string-match-p ignore-rx (buffer-name buf))) - t)) + (not (string-match-p ignore-rx (buffer-name buf)))) collect (buffer-name buf)))) (defun persp-is-current-buffer (buf) |
