emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] 97/117: Move wdired-exit to ergoemacs-keyboard-quit


From: Matthew Fidler
Subject: [elpa] 97/117: Move wdired-exit to ergoemacs-keyboard-quit
Date: Fri, 25 Jul 2014 13:24:33 +0000

mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.

commit 2c8d7e6ab3926c7e416836062a05cbdfd7ffc394
Author: Matthew L. Fidler <address@hidden>
Date:   Wed Jul 23 12:35:40 2014 -0500

    Move wdired-exit to ergoemacs-keyboard-quit
---
 ergoemacs-shortcuts.el |   15 ++++++++++++++-
 ergoemacs-themes.el    |    3 ---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/ergoemacs-shortcuts.el b/ergoemacs-shortcuts.el
index c37f7e6..ecb5c65 100644
--- a/ergoemacs-shortcuts.el
+++ b/ergoemacs-shortcuts.el
@@ -534,6 +534,10 @@ It will replace anything defined by 
`ergoemacs-translation'"
 (declare-function ergoemacs-key-fn-lookup "ergoemacs-translate.el")
 (declare-function ergoemacs-modal-toggle "ergoemacs-modal.el")
 (declare-function cua-clear-rectangle-mark "cua-rect.el")
+
+(defvar ergoemacs-keyboard-quit-modes
+  '((wdired-mode wdired-exit))
+  "Escape key for various modes.")
 (defvar ergoemacs-mode)
 (defvar ergoemacs-no-shortcut-keys)
 (defvar ergoemacs-shortcut-keys)
@@ -548,7 +552,9 @@ It will replace anything defined by `ergoemacs-translation'"
 - If the 【q】 key is bound to a non self-insert function, exit
   by this function. (By convention, the 【q】 key is often quit)
 - If the 【Ctrl+G】 key is bound to something other than
-  `keyboard-quit' use that. 
+  `keyboard-quit' use that.
+- If the major mode has a function defined in
+  `ergoemacs-keyboard-quit', use that.
 - If `ergoemacs-mode' knows of the quit function, use that
 - If an `ergoemacs-mode' modal translation is active, deactivate it.
 - Otherwise issue `keyboard-quit'
@@ -573,6 +579,13 @@ It will replace anything defined by 
`ergoemacs-translation'"
                   (commandp tmp t))
                 (not (eq 'keyboard-quit tmp))))
       (call-interactively tmp))
+     ((and (not (region-active-p))
+           (and (progn
+                  (setq tmp (assoc major-mode ergoemacs-keyboard-quit-modes))
+                  (if (not tmp) nil
+                    (setq tmp (car (cdr tmp)))
+                    (commandp tmp t)))))
+      (call-interactively tmp))
      (t
       (let (defined-fn
              ergoemacs-shortcut-keys
diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el
index b572b1c..a5c02bd 100644
--- a/ergoemacs-themes.el
+++ b/ergoemacs-themes.el
@@ -986,9 +986,6 @@
 
 (ergoemacs-theme-component dired-to-wdired ()
   "C-c C-c enters wdired, <escape> exits."
-  (when wdired-mode-hook
-    :modify-map t
-    (define-key wdired-mode-map (kbd "<escape>") 'wdired-exit))
   (when dired-mode-hook
     :modify-map t
     (define-key dired-mode-map (kbd "C-c C-c") 'wdired-change-to-wdired-mode)))



reply via email to

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