From f9d35afea37eb3a22ac1301dda431a79b3a34a02 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 27 Jun 2022 16:08:10 +0200 Subject: [PATCH] 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 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) " " + #'dired-x-find-file) + (keymap-set (current-global-map) " " + #'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 -- 2.39.5