bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27828: [PATCH] Do not unset user key remaps in dired-x


From: Allen Li
Subject: bug#27828: [PATCH] Do not unset user key remaps in dired-x
Date: Wed, 26 Jul 2017 12:07:34 -0700

* lisp/dired-x.el (dired-x-bind-find-file): Don't map any keys if user
sets dired-x-hands-off-my-keys.
---
 lisp/dired-x.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 915550991d..1425278bdc 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -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
-- 
2.14.0.rc0.400.g1c36432dff-goog





reply via email to

[Prev in Thread] Current Thread [Next in Thread]