[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f9d35afea3 1/2: Minor cleanup in dired-x-bind-find-file
From: |
Stefan Kangas |
Subject: |
master f9d35afea3 1/2: Minor cleanup in dired-x-bind-find-file |
Date: |
Wed, 29 Jun 2022 07:55:07 -0400 (EDT) |
branch: master
commit f9d35afea37eb3a22ac1301dda431a79b3a34a02
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Minor cleanup in dired-x-bind-find-file
* lisp/dired-x.el (dired-x-bind-find-file): Use 'format-message'
and 'keymap-set'.
---
lisp/dired-x.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index b4b647f1b0..ed7f71e006 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