]> git.eshelyaron.com Git - emacs.git/commitdiff
Do not unset user key remaps in dired-x
authorAllen Li <vianchielfaura@gmail.com>
Sat, 29 Jul 2017 09:00:56 +0000 (12:00 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 29 Jul 2017 09:00:56 +0000 (12:00 +0300)
* lisp/dired-x.el (dired-x-bind-find-file): Don't map any keys if user
sets dired-x-hands-off-my-keys.  (Bug#27828)

Copyright-paperwork-exempt: yes

lisp/dired-x.el

index 915550991d03bc127d97293d70374a05fb8e1ab3..1425278bdc9923980ec46118f939105bf9aa39cb 100644 (file)
@@ -1629,10 +1629,11 @@ Binding direction based on `dired-x-hands-off-my-keys'."
   (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? "))))
-  (define-key (current-global-map) [remap find-file]
-    (if (not dired-x-hands-off-my-keys) 'dired-x-find-file))
-  (define-key (current-global-map) [remap find-file-other-window]
-    (if (not dired-x-hands-off-my-keys) 'dired-x-find-file-other-window)))
+  (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)))
 
 ;; 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