bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46268: 27.1.91; Error in occur-rename-buffer


From: Juri Linkov
Subject: bug#46268: 27.1.91; Error in occur-rename-buffer
Date: Wed, 03 Feb 2021 19:34:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> AFAICT, `occur--garbage-collect-revert-args` aims to throw away the
>> overlays when they're not needed, but we will need them again if we want
>> to `revert-buffer`, so we shouldn't call this function until we're sure
>> `revert-buffer` won't be called.  IOW, I think we should just remove
>> the above call.
>
> I now see what's going on: this call is supposed to throw away the
> overlay used by the previous invocation of `occur`.  So when we revert,
> we don't want to throw them away but when it's a fresh new invocation,
> we do.
>
> Maybe we should add a (unless (eq bufs (nth 2 occur-revert-arguments)))?

Yep, this fixed the problem:

diff --git a/lisp/replace.el b/lisp/replace.el
index f13d27aff8..babae7fed9 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1779,7 +1783,8 @@ occur-1
                               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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]