[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 31/35: ergoemacs-keyboard-quit calls 【q】 when applicable
From: |
Matthew Fidler |
Subject: |
[elpa] 31/35: ergoemacs-keyboard-quit calls 【q】 when applicable |
Date: |
Fri, 11 Jul 2014 22:33:32 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit e7c0a54bb259aa4bef34cb54eb00d1e4a2d73954
Author: Matthew L. Fidler <address@hidden>
Date: Fri Jul 11 07:31:14 2014 -0500
ergoemacs-keyboard-quit calls 【q】 when applicable
---
ergoemacs-shortcuts.el | 73 +++++++++++++++++++++++++++++-------------------
1 files changed, 44 insertions(+), 29 deletions(-)
diff --git a/ergoemacs-shortcuts.el b/ergoemacs-shortcuts.el
index 46efa81..4a4be25 100644
--- a/ergoemacs-shortcuts.el
+++ b/ergoemacs-shortcuts.el
@@ -511,35 +511,50 @@ It will replace anything defined by
`ergoemacs-translation'"
(declare-function ergoemacs-modal-toggle "ergoemacs-modal.el")
(declare-function cua-clear-rectangle-mark "cua-rect.el")
(defun ergoemacs-keyboard-quit ()
- "Replacement for `keyboard-quit' and `minibuffer-keyboard-quit'."
- (cond
- ((minibufferp)
- (minibuffer-keyboard-quit))
- ((and (boundp 'cua--rectangle) cua--rectangle
- (boundp 'cua-mode) cua-mode
- (fboundp 'cua-clear-rectangle-mark))
- (cua-clear-rectangle-mark))
- (t
- (let (defined-fn
- ergoemacs-shortcut-keys
- ergoemacs-no-shortcut-keys
- ergoemacs-read-input-keys
- ergoemacs-mode)
- (setq defined-fn (ergoemacs-key-fn-lookup 'keyboard-quit))
- (setq defined-fn
- (condition-case err
- (ergoemacs-real-key-binding defined-fn)
- (error nil)))
- (cond
- (defined-fn
- (ergoemacs-read-key-call defined-fn))
- ((and ergoemacs-modal
- (let ((hash (gethash (nth 0 ergoemacs-modal-list)
ergoemacs-translations)))
- (and hash
- (not (plist-get hash ':modal-always))))) ;; Exit modal
- (ergoemacs-modal-toggle (nth 0 ergoemacs-modal-list)))
- (t
- (keyboard-quit))))))
+ "Replacement for `keyboard-quit' and `minibuffer-keyboard-quit'.
+
+- In a minibuffer, do `minibuffer-keyboard-quit'. When a
+- `cua-mode' rectangle is active, clear the selected rectangle.
+- 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 `ergoemacs-mode' knows of the quit function, use that
+- If an `ergoemacs-mode' modal translation is active, deactivate it.
+- Otherwise issue `keyboard-quit'
+"
+ (let (tmp)
+ (cond
+ ((minibufferp)
+ (minibuffer-keyboard-quit))
+ ((and (boundp 'cua--rectangle) cua--rectangle
+ (boundp 'cua-mode) cua-mode
+ (fboundp 'cua-clear-rectangle-mark))
+ (cua-clear-rectangle-mark))
+ ((or (progn
+ (setq tmp (key-binding "q"))
+ (and (not (symbolp tmp)) (commandp tmp t)))
+ (not (string-match "self-insert" (symbol-name tmp))))
+ (call-interactively (key-binding "q")))
+ (t
+ (let (defined-fn
+ ergoemacs-shortcut-keys
+ ergoemacs-no-shortcut-keys
+ ergoemacs-read-input-keys
+ ergoemacs-mode)
+ (setq defined-fn (ergoemacs-key-fn-lookup 'keyboard-quit))
+ (setq defined-fn
+ (condition-case err
+ (ergoemacs-real-key-binding defined-fn)
+ (error nil)))
+ (cond
+ (defined-fn
+ (ergoemacs-read-key-call defined-fn))
+ ((and ergoemacs-modal
+ (let ((hash (gethash (nth 0 ergoemacs-modal-list)
ergoemacs-translations)))
+ (and hash
+ (not (plist-get hash ':modal-always))))) ;; Exit modal
+ (ergoemacs-modal-toggle (nth 0 ergoemacs-modal-list)))
+ (t
+ (keyboard-quit)))))))
(setq ergoemacs-describe-key nil))
- [elpa] 24/35: Fix keys on web-page, (continued)
- [elpa] 24/35: Fix keys on web-page, Matthew Fidler, 2014/07/11
- [elpa] 18/35: Fix Issue #270, Matthew Fidler, 2014/07/11
- [elpa] 15/35: Misc Code Cleanup, Matthew Fidler, 2014/07/11
- [elpa] 27/35: Use pr-interface when available, Matthew Fidler, 2014/07/11
- [elpa] 25/35: Fix Issue #271, Matthew Fidler, 2014/07/11
- [elpa] 26/35: Should display the correct key now., Matthew Fidler, 2014/07/11
- [elpa] 28/35: Another attempt to fix the webpage, Matthew Fidler, 2014/07/11
- [elpa] 30/35: Delete Frame/Close Emacs for Alt+f4, Matthew Fidler, 2014/07/11
- [elpa] 29/35: Fix webpage (tested works), Matthew Fidler, 2014/07/11
- [elpa] 32/35: browse-kill-ring-mode no longer needs work-around, Matthew Fidler, 2014/07/11
- [elpa] 31/35: ergoemacs-keyboard-quit calls 【q】 when applicable,
Matthew Fidler <=
- [elpa] 35/35: v5.14.7.2 - Removed ergoemacs-pushnew, and use add-to-list for variables that are defined with defvar (Allows work-around of calling adjoin at runtime for emacs 24.1; Thaks to Stefan Monnier for pointing this out). - Expanded ã€ESC】 to exit modes that use ã€q】 for quitting the current operation. This includes many packages like magit and browse-kill-ring. - Expanded ã€Alt+f4】 to close the current frame when it is the only frame present. - Added Recent files menu that includes Open Last Closed ã€Ctl+⇧Shift+T】. - Changed ergoemacs-mode printing to use printing package when available. The file-menu has been replaced - The default theme is now selected automatically (Issue #269) - Show goto-line as ã€Ctl+L】, although the test doesn't work (Issue #265) - Added an option to move lines up and down with ã€Alt+up】, ã€Alt+down】 like Gedit (See #266) - Changed the emacs startup messages to reflect emacs keys (#267) - Other miscellaneous cleanups and fixes, Matthew Fidler, 2014/07/11
- [elpa] 34/35: The translations will fail :(, Matthew Fidler, 2014/07/11
- [elpa] 33/35: Defined variables use add-to-list otherwise pushnew, Matthew Fidler, 2014/07/11