Subject: bug#75530: [PATCH v2 2/3] Remap read-only-mode for Occur modes (bug#75530)

From: Liam Hupfer <[email-masked]>
Date: Mon, 03 Feb 2025 22:52:12 -0600

Hi Howard,

Don’t forget to reply all! Not everyone subscribes to bug-gnu-emacs. I
just happened to check this thread on <https://yhetil.org>. Fortunately
[piem-inject-thread-into-maildir] makes it easy to correct this. Might
have to make that a habit on my end.

Howard Melman <[email-masked]> writes:

> I am all for consistency in these three mode, see Emacs bug#16214. But
> in that discussion people brought up that unlike for dired, for occur
> and grep, people sometimes use those commands to (1) search for and
> collect text, and then edit into something (say a list or paragraph)
> rather than wanting to (2) edit changes into the original sources
> (which they also want to do some other times). So the proposal was to
> leave C-x C-q to change read-only to cover the first case and to use
> “e” to enter the “writable” modes in all three cases and for the
> second case. C-x C-q in dired was fine to leave to enter wdired since
> (1) it already does that and (2) people don’t edit the output there
> much.

Looks like you’re referring to [Juri’s reply]:

> The difference is because it’s more useful to type `C-x C-q’ to change
> read-onlyness of an occur buffer and edit it textually than to do the
> same in a dired buffer where random edits (other than renaming file
> names) make less sense.

This is a little confusing to me. ‘read-only-mode’ on its own will make
the buffer editable, but won’t it leave Occur or Grep’s special bindings
in place? So you can’t even insert text! Seems to me that
‘fundamental-mode’ followed by ‘read-only-mode’ (which would then be
available on ‘C-x C-q’) would be needed? Or ‘switch-to-buffer’ plus
‘insert-buffer’? Not to mention Occur uses text properties to make the
line numbers read-only even when the buffer is writable. Maybe that
wasn’t the case in 2013.

I don’t mean to prescribe people their [workflows], of course. Maybe I’m
missing something?

Thanks!

[piem-inject-thread-into-maildir] <https://docs.kyleam.com/piem.html>

[Juri’s reply] <https://yhetil.org/emacs/[email-masked]/>

[workflows] <https://xkcd.com/1172/>