branch: elpa/with-editor commit 59867aebe16454be4d8c0c858f3b00b8a34f3f61 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Use defvar-keymap --- lisp/with-editor.el | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lisp/with-editor.el b/lisp/with-editor.el index 9dc95b30f4..66d603a0af 100644 --- a/lisp/with-editor.el +++ b/lisp/with-editor.el @@ -400,18 +400,16 @@ And some tools that do not handle $EDITOR properly also break." ;;; Mode -(defvar with-editor-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "\C-c\C-c" #'with-editor-finish) - (define-key map [remap server-edit] #'with-editor-finish) - (define-key map [remap evil-save-and-close] #'with-editor-finish) - (define-key map [remap evil-save-modified-and-close] #'with-editor-finish) - (define-key map "\C-c\C-k" #'with-editor-cancel) - (define-key map [remap kill-buffer] #'with-editor-cancel) - (define-key map [remap ido-kill-buffer] #'with-editor-cancel) - (define-key map [remap iswitchb-kill-buffer] #'with-editor-cancel) - (define-key map [remap evil-quit] #'with-editor-cancel) - map)) +(defvar-keymap with-editor-mode-map + "C-c C-c" #'with-editor-finish + "<remap> <server-edit>" #'with-editor-finish + "<remap> <evil-save-and-close>" #'with-editor-finish + "<remap> <evil-save-modified-and-close>" #'with-editor-finish + "C-c C-k" #'with-editor-cancel + "<remap> <kill-buffer>" #'with-editor-cancel + "<remap> <ido-kill-buffer>" #'with-editor-cancel + "<remap> <iswitchb-kill-buffer>" #'with-editor-cancel + "<remap> <evil-quit>" #'with-editor-cancel) (define-minor-mode with-editor-mode "Edit a file as the $EDITOR of an external process."