]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/replace.el (occur-rename-buffer): Check for overlay (bug#46268).
authorJuri Linkov <juri@linkov.net>
Thu, 4 Feb 2021 09:17:54 +0000 (11:17 +0200)
committerJuri Linkov <juri@linkov.net>
Thu, 4 Feb 2021 09:17:54 +0000 (11:17 +0200)
(occur-1): Don't use occur--garbage-collect-revert-args
when reverting the Occur buffer with same bufs.

lisp/replace.el

index f13d27aff895f8ac8efcbcff255702a5b3c59abc..d320542d6298707b77e81175d7f5fa5411989814 100644 (file)
@@ -1545,7 +1545,10 @@ You can add this to `occur-hook' if you always want a separate
   (with-current-buffer
       (if (eq major-mode 'occur-mode) (current-buffer) (get-buffer "*Occur*"))
     (rename-buffer (concat "*Occur: "
-                           (mapconcat #'buffer-name
+                           (mapconcat (lambda (boo)
+                                        (buffer-name (if (overlayp boo)
+                                                         (overlay-buffer boo)
+                                                       boo)))
                                       (car (cddr occur-revert-arguments)) "/")
                            "*")
                    (or unique-p (not interactive-p)))))
@@ -1779,7 +1782,8 @@ See also `multi-occur'."
                               42)
                            (window-width))
                         "" (occur-regexp-descr regexp))))
-          (occur--garbage-collect-revert-args)
+          (unless (eq bufs (nth 2 occur-revert-arguments))
+            (occur--garbage-collect-revert-args))
          (setq occur-revert-arguments (list regexp nlines bufs))
           (if (= count 0)
               (kill-buffer occur-buf)