summaryrefslogtreecommitdiff
path: root/lisp/dired-x.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-06-27 16:08:10 +0200
committerStefan Kangas <stefan@marxist.se>2022-06-29 13:54:51 +0200
commitf9d35afea37eb3a22ac1301dda431a79b3a34a02 (patch)
tree1743bcd106c9130abcc662e07317b20ba8f4c47e /lisp/dired-x.el
parent4d41bb7847348009f8102625ce080a2ea94984a4 (diff)
downloademacs-f9d35afea37eb3a22ac1301dda431a79b3a34a02.tar.gz
Minor cleanup in dired-x-bind-find-file
* lisp/dired-x.el (dired-x-bind-find-file): Use 'format-message' and 'keymap-set'.
Diffstat (limited to 'lisp/dired-x.el')
-rw-r--r--lisp/dired-x.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index b4b647f1b0a..ed7f71e0069 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -1515,12 +1515,13 @@ Binding direction based on `dired-x-hands-off-my-keys'."
(interactive)
(if (called-interactively-p 'interactive)
(setq dired-x-hands-off-my-keys
- (not (y-or-n-p "Bind dired-x-find-file over find-file? "))))
+ (not (y-or-n-p (format-message
+ "Bind `dired-x-find-file' over `find-file'?")))))
(unless dired-x-hands-off-my-keys
- (define-key (current-global-map) [remap find-file]
- 'dired-x-find-file)
- (define-key (current-global-map) [remap find-file-other-window]
- 'dired-x-find-file-other-window)))
+ (keymap-set (current-global-map) "<remap> <find-file>"
+ #'dired-x-find-file)
+ (keymap-set (current-global-map) "<remap> <find-file-other-window>"
+ #'dired-x-find-file-other-window)))
;; Now call it so binding is correct. This could go in the :initialize
;; slot, but then dired-x-bind-find-file has to be defined before the