Subject: [PATCH 3/3] Remap read-only-mode for Grep Edit

From: Liam Hupfer <[email-masked]>
Date: Sun, 12 Jan 2025 19:00:36 -0600

Like Dired and Occur, writable Grep buffers can 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.
---
 lisp/progmodes/grep.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 72c0f871e0b..c1d626016b0 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -312,7 +312,8 @@ grep-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 @@ grep-edit--prepare-buffer
 (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