GNU bug report logs - #75530
[PATCH 0/3] Consistently remap read-only-mode for special edit modes

Previous Next

Package: emacs;

Reported by: Liam Hupfer <liam <at> hpfr.net>

Date: Mon, 13 Jan 2025 00:58:02 UTC

Severity: normal

Tags: patch

Full log


Message #53 received at 75530 <at> debbugs.gnu.org (full text, mbox):

From: Liam Hupfer <liam <at> hpfr.net>
To: 75530 <at> debbugs.gnu.org,
	Eli Zaretskii <eliz <at> gnu.org>
Cc: Liam Hupfer <liam <at> hpfr.net>
Subject: [PATCH v2 3/3] Remap read-only-mode for Grep Edit (bug#75530)
Date: Sun,  2 Feb 2025 18:12:47 -0600
Like Dired and Occur, Grep buffers now remap read-only-mode to a useful
editing mode.

* lisp/progmodes/grep.el (grep-mode-map): Remap read-only-mode to
grep-change-to-grep-edit-mode.
(grep-edit-mode-map): Remap read-only-mode to grep-edit-save-changes.
* etc/NEWS (Grep): Document remaps.
---
 etc/NEWS               | 9 +++++----
 lisp/progmodes/grep.el | 6 ++++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index f25e8b2fe87..2e3c60799de 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -902,10 +902,11 @@ regardless of 'read-only-mode' bindings.
 
 +++
 *** Grep results can be edited to reflect changes in the originating file.
-Like Occur Edit mode, typing 'e' in the "*grep*" buffer will now make
-the 'grep' results editable.  The edits will be reflected in the buffer
-visiting the originating file.  Typing 'C-c C-c' will leave the Grep
-Edit mode.
+Like Occur Edit mode, typing 'e' or 'C-x C-q' (or your own
+'read-only-mode' binding) in the "*grep*" buffer will now make the
+'grep' results editable.  The edits will be reflected in the buffer
+visiting the originating file.  Typing 'C-c C-c' or 'C-x C-q' (or your
+own 'read-only-mode' binding) will leave the Grep Edit mode.
 
 ** TeX modes
 
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index d04e9945b0d..b29f56c9ed4 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -312,7 +312,8 @@ This keymap inherits from `compilation-minor-mode-map'."
   "TAB"       #'compilation-next-error
   "<backtab>" #'compilation-previous-error
 
-  "e"         #'grep-change-to-grep-edit-mode)
+  "e"         #'grep-change-to-grep-edit-mode
+  "<remap> <read-only-mode>" #'grep-change-to-grep-edit-mode)
 
 (easy-menu-define grep-menu-map grep-mode-map
   "Menu for grep buffers."
@@ -1083,7 +1084,8 @@ list is empty)."
 (defvar-keymap grep-edit-mode-map
   :doc "Keymap for `grep-edit-mode'."
   :parent text-mode-map
-  "C-c C-c" #'grep-edit-save-changes)
+  "C-c C-c" #'grep-edit-save-changes
+  "<remap> <read-only-mode>" #'grep-edit-save-changes)
 
 (defvar grep-edit-mode-hook nil
   "Hooks run when changing to Grep-Edit mode.")
-- 
2.47.1





This bug report was last modified 135 days ago.

Previous Next


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