diff --git a/lisp/replace.el b/lisp/replace.el index 4bb91fbd6a0..e7407869ca2 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1982,12 +1982,12 @@ See also `multi-occur'." (source-buffer-default-directory default-directory)) ;; Handle the case where one of the buffers we're searching is the ;; output buffer. Just rename it. - (when (member buf-name - ;; FIXME: Use cl-exists. - (mapcar - (lambda (boo) - (buffer-name (if (overlayp boo) (overlay-buffer boo) boo))) - active-bufs)) + (when (seq-some (lambda (boo) + (equal buf-name + (buffer-name (if (overlayp boo) + (overlay-buffer boo) + boo)))) + active-bufs) (with-current-buffer buf-name (rename-uniquely)))