[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#46268: 27.1.91; Error in occur-rename-buffer
From: |
Stefan Monnier |
Subject: |
bug#46268: 27.1.91; Error in occur-rename-buffer |
Date: |
Wed, 03 Feb 2021 10:05:43 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> Also Cc:ing Stefan with a question about occur--garbage-collect-revert-args:
[ Side note: Not sure why, I'm not familiar with this code. ]
> trying to revert the Occur buffer created from an active region
> removes the source buffer name from the Occur buffer name.
> For example, (after applying the attached patch) 'M-x occur'
> on the active region in *scratch* creates the buffer *Occur: *scratch**.
>
> But reverting the Occur buffer with 'g' removes the *scratch* buffer name,
> and renames the Occur buffer to *Occur: *.
>
> This is because of two lines in occur-1:
>
> (occur--garbage-collect-revert-args)
> (setq occur-revert-arguments (list regexp nlines bufs))
>
> where occur--garbage-collect-revert-args deletes the overlay
> with the buffer name *scratch*, and later occur-rename-buffer
> can't get the original buffer name from occur-revert-arguments.
> And I don't know how to fix this.
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 just took a look at the history of this code, and I see that it
claims I'm the one who added that function and that call 2 years
ago. I say this is fake news ;-) ]
Stefan "not sure it's a good idea to joke about the
re-birth of nazism"