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

From: Juri Linkov <[email-masked]>
Date: Tue, 04 Feb 2025 09:44:42 +0200

>> 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’?

One particular use case where it's useful to disable the read-only
status with 'C-x C-q' is to use e.g. 'M-x flush-lines' to further
narrow down the results displayed in the Occur 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.

Indeed, unfortunately this use case was precluded after the change
that added the read-only property on line numbers was made recently
on 2022-01-23 in the commit 1bcbca3750d9e8c47bee7ac893b885ade584d783.
Maybe we need to revert this change and find another solution.