branch: externals/embark commit 5cbacb33d31c7ef9f28b4db62e0f94c1eabe0b6d Author: Omar Antolín <omar.anto...@gmail.com> Commit: Omar Antolín <omar.anto...@gmail.com>
Have wgrep correctly restore binding for revert-buffer Thanks to @minad for catching this over in #171. Also, remove the embarrasing embark-general-map bindings in grep export buffers. --- embark-consult.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/embark-consult.el b/embark-consult.el index c62a645d8d..5a92032cf9 100644 --- a/embark-consult.el +++ b/embark-consult.el @@ -173,6 +173,7 @@ This function is meant to be added to `embark-collect-mode-hook'." (embark-define-keymap embark-consult-export-grep-map "A keymap for Embark Export grep-mode buffers." + :parent nil ("g" revert-buffer)) (defun embark-consult-export-grep (lines) @@ -183,11 +184,13 @@ This function is meant to be added to `embark-collect-mode-hook'." (dolist (line lines) (insert line "\n")) (goto-char (point-min)) (grep-mode) - (setq-local wgrep-header/footer-parser #'ignore) - (when (fboundp 'wgrep-setup) (wgrep-setup)) + ;; Set up keymap before possible wgrep-setup, so that wgrep + ;; restores our binding too when the user finishes editing. (use-local-map (make-composed-keymap embark-consult-export-grep-map - (current-local-map)))) + (current-local-map))) + (setq-local wgrep-header/footer-parser #'ignore) + (when (fboundp 'wgrep-setup) (wgrep-setup))) (pop-to-buffer buf))) (defun embark-consult-goto-grep (location)