summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2023-09-17 11:58:46 +0200
committerJonas Bernoulli <jonas@bernoul.li>2023-09-17 11:58:46 +0200
commitfcd186d1e684c2dca6497c89af77b27b2b036c11 (patch)
tree0c8e301e0771853f9319f4dddda004094e58004b
parentd5f3f06cb830311e60c58f656988ef37c05a99e0 (diff)
docs: Suggest keymap-global-set instead of define-key
-rw-r--r--docs/with-editor.org8
-rw-r--r--docs/with-editor.texi8
-rw-r--r--lisp/with-editor.el8
3 files changed, 12 insertions, 12 deletions
diff --git a/docs/with-editor.org b/docs/with-editor.org
index 963435e..77cf400 100644
--- a/docs/with-editor.org
+++ b/docs/with-editor.org
@@ -161,10 +161,10 @@ prompt for an alternative environment variable such as ~$GIT_EDITOR~.
To always use these variants add this to you init file:
#+begin_src emacs-lisp
- (define-key (current-global-map)
- [remap async-shell-command] 'with-editor-async-shell-command)
- (define-key (current-global-map)
- [remap shell-command] 'with-editor-shell-command)
+ (keymap-global-set "<remap> <async-shell-command>"
+ #'with-editor-async-shell-command)
+ (keymap-global-set "<remap> <shell-command>"
+ #'with-editor-shell-command)
#+end_src
Alternatively use the global ~shell-command-with-editor-mode~.
diff --git a/docs/with-editor.texi b/docs/with-editor.texi
index 447c397..831b2aa 100644
--- a/docs/with-editor.texi
+++ b/docs/with-editor.texi
@@ -221,10 +221,10 @@ instance is exported as @code{$EDITOR}.
To always use these variants add this to you init file:
@lisp
-(define-key (current-global-map)
- [remap async-shell-command] 'with-editor-async-shell-command)
-(define-key (current-global-map)
- [remap shell-command] 'with-editor-shell-command)
+(keymap-global-set "<remap> <async-shell-command>"
+ #'with-editor-async-shell-command)
+(keymap-global-set "<remap> <shell-command>"
+ #'with-editor-shell-command)
@end lisp
Alternatively use the global @code{shell-command-with-editor-mode}.
diff --git a/lisp/with-editor.el b/lisp/with-editor.el
index ab448d0..19910bb 100644
--- a/lisp/with-editor.el
+++ b/lisp/with-editor.el
@@ -41,10 +41,10 @@
;; `$GIT_EDITOR'. To always use these variants add this to your init
;; file:
;;
-;; (define-key (current-global-map)
-;; [remap async-shell-command] #'with-editor-async-shell-command)
-;; (define-key (current-global-map)
-;; [remap shell-command] #'with-editor-shell-command)
+;; (keymap-global-set "<remap> <async-shell-command>"
+;; #'with-editor-async-shell-command)
+;; (keymap-global-set "<remap> <shell-command>"
+;; #'with-editor-shell-command)
;; Alternatively use the global `shell-command-with-editor-mode',
;; which always sets `$EDITOR' for all Emacs commands which ultimately