diff options
author | Stefan Kangas <stefan@marxist.se> | 2022-06-27 16:08:10 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2022-06-29 13:54:51 +0200 |
commit | f9d35afea37eb3a22ac1301dda431a79b3a34a02 (patch) | |
tree | 1743bcd106c9130abcc662e07317b20ba8f4c47e /lisp/dired-x.el | |
parent | 4d41bb7847348009f8102625ce080a2ea94984a4 (diff) | |
download | emacs-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.el | 11 |
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 |