From 1da7d6fb880834772ad17aed46872d49641e1f6b Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Thu, 8 Jan 2015 17:40:59 +0100 Subject: [PATCH] lisp/replace.el (occur-1): Use `cl-seq'. * lisp/replace.el (occur-1): Use `cl-remove-if-not' and `cl-find-if' in favor of more complex operations. --- lisp/replace.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/replace.el b/lisp/replace.el index e0636e0..b92e3cd 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1416,14 +1416,15 @@ See also `multi-occur'." (unless buf-name (setq buf-name "*Occur*")) (let (occur-buf - (active-bufs (delq nil (mapcar #'(lambda (buf) - (when (buffer-live-p buf) buf)) - bufs)))) + (active-bufs + (cl-remove-if-not #'buffer-live-p bufs))) ;; Handle the case where one of the buffers we're searching is the ;; output buffer. Just rename it. - (when (member buf-name (mapcar 'buffer-name active-bufs)) + (when (cl-find-if + `(lambda (buf) (equal (buffer-name buf) ,buf-name)) + active-bufs) (with-current-buffer (get-buffer buf-name) - (rename-uniquely))) + (rename-uniquely))) ;; Now find or create the output buffer. ;; If we just renamed that buffer, we will make a new one here. -- 1.8.4