all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Allen Li <vianchielfaura@gmail.com>
To: 27828@debbugs.gnu.org
Subject: bug#27828: [PATCH] Do not unset user key remaps in dired-x
Date: Wed, 26 Jul 2017 12:07:34 -0700	[thread overview]
Message-ID: <CAJr1M6cJQajDm3RBsSHcsaaTgp=K_f1ECC4ukQ1DYzKUFVjWWg@mail.gmail.com> (raw)
In-Reply-To: <CAJr1M6cOPRvtap47EQH1ZZiRrthvdhcwzRSRiQXJs46E6ksx_Q@mail.gmail.com>

* 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	other threads:[~2017-07-26 19:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 18:52 bug#27828: 25.2; dired-x-hands-off-my-keys unsets remap find-file Allen Li
2017-07-26 19:07 ` Allen Li [this message]
2017-07-29  9:02   ` bug#27828: [PATCH] Do not unset user key remaps in dired-x Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJr1M6cJQajDm3RBsSHcsaaTgp=K_f1ECC4ukQ1DYzKUFVjWWg@mail.gmail.com' \
    --to=vianchielfaura@gmail.com \
    --cc=27828@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.