GNU bug report logs - #20971
24.4; occur-1 makes my buffer read-only

Previous Next

Package: emacs;

Reported by: Alex Schröder <kensanata <at> gmail.com>

Date: Fri, 3 Jul 2015 09:23:02 UTC

Severity: wishlist

Found in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: Alex Schröder <kensanata <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 20971 <at> debbugs.gnu.org
Subject: bug#20971: 24.4; occur-1 makes my buffer read-only
Date: Mon, 30 Sep 2019 01:16:55 +0200
Alex Schröder <kensanata <at> gmail.com> writes:

> Indeed, the problem goes away with emacs -Q. I investigated further and found that the culprit is display-buffer-function
> being set to popwin:display-buffer. Thus, I can load my current config and evaluate (setq display-buffer-function nil). The
> problem will disappear.
>
> I still think that my patch is the right solution. The current code expects display-buffer to behave in a certain way and
> Emacs gives us a ton of ways to change that. Thus, we either need to explicitly set the current buffer, or we can do away
> with trying to make *Occur* read-only. And really, who needs that? Even if we don't set buffer-read-only, the buffer has no
> self-insert-command bindings, and if you try to C-k the header, it will still say "Text is read-only: #<buffer *Occur*>"
> because there is a read-only text-property. And why shouldn't you delete matches?
>
> Thus, as far as I can tell, my change makes the code more robust (no longer depending on display-buffer to work in a
> particular way) and it has practically no drawbacks.

I think *Occur* should definitely be read-only, so your first patch is
the wrong solution in my opinion.

On the other hand, I see no drawbacks with wrapping the relevant calls
in:

  (with-current-buffer occur-buf
       ...)

At the very least, that would make the intention of that code a bit more
clear.

But that entire part of the code is already wrapped in
(with-current-buffer occur-buf ...).  So why are we not in occur-buf
already?

Best regards,
Stefan Kangas




This bug report was last modified 4 years and 242 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.