summaryrefslogtreecommitdiff
path: root/lisp/dired-x.el
diff options
context:
space:
mode:
authorAllen Li <vianchielfaura@gmail.com>2017-07-29 12:00:56 +0300
committerEli Zaretskii <eliz@gnu.org>2017-07-29 12:00:56 +0300
commitdfee60fe66f3d9fe4249c9662d802753f3e50929 (patch)
treee001e9f0a09f17fea1b5e3e254fcf173dd834df9 /lisp/dired-x.el
parentd3fcb9241339357869969547924e02bed6f661cd (diff)
downloademacs-dfee60fe66f3d9fe4249c9662d802753f3e50929.tar.gz
Do not unset user key remaps in dired-x
* 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
Diffstat (limited to 'lisp/dired-x.el')
-rw-r--r--lisp/dired-x.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 915550991d0..1425278bdc9 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