From: Stefan Kangas Date: Mon, 27 Jun 2022 14:08:10 +0000 (+0200) Subject: Minor cleanup in dired-x-bind-find-file X-Git-Tag: emacs-29.0.90~1447^2~1389 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f9d35afea37eb3a22ac1301dda431a79b3a34a02;p=emacs.git Minor cleanup in dired-x-bind-find-file * lisp/dired-x.el (dired-x-bind-find-file): Use 'format-message' and 'keymap-set'. --- 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