all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 46268@debbugs.gnu.org
Subject: bug#46268: 27.1.91; Error in occur-rename-buffer
Date: Wed, 03 Feb 2021 19:34:34 +0200	[thread overview]
Message-ID: <8735ydt5qt.fsf@mail.linkov.net> (raw)
In-Reply-To: <jwvmtwli2ov.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 03 Feb 2021 10:38:45 -0500")

>> 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	other threads:[~2021-02-03 17:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  8:54 bug#46268: 27.1.91; Error in occur-rename-buffer Juri Linkov
2021-02-03 15:05 ` Stefan Monnier
2021-02-03 15:38   ` Stefan Monnier
2021-02-03 17:34     ` Juri Linkov [this message]
2021-02-03 15:22 ` Stefan Monnier
2021-02-03 17:36   ` Juri Linkov
2021-02-03 19:41     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735ydt5qt.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=46268@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.