[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 184/287: Now use ergoemacs-pretty-key to describe fn keys
From: |
Matthew Fidler |
Subject: |
[elpa] 184/287: Now use ergoemacs-pretty-key to describe fn keys |
Date: |
Wed, 02 Jul 2014 14:45:49 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit ea8b799b0715318a071ad40f4e63b27ffb2e9788
Author: Matthew L. Fidler <address@hidden>
Date: Sat Jun 21 16:39:57 2014 -0500
Now use ergoemacs-pretty-key to describe fn keys
---
ergoemacs-advices.el | 23 ++++++++++++++++++++---
1 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/ergoemacs-advices.el b/ergoemacs-advices.el
index aa20178..2d5db7f 100644
--- a/ergoemacs-advices.el
+++ b/ergoemacs-advices.el
@@ -198,7 +198,24 @@ This assumes any key defined while running a hook is a
user-defined hook."
(let ((ergoemacs-run-mode-hooks t))
ad-do-it))
-;;; Unfortunately, the advice route doesn't seem to work :(
+
+;;; Unfortunately, the advice route doesn't seem to work for these
+;;; functions :(
+
+;;; key-description
+(declare-function ergoemacs-real-key-description
+ "ergoemacs-advices.el" (keys &optional prefix) t)
+(fset 'ergoemacs-real-key-description (symbol-function 'key-description))
+(defvar ergoemacs-key-description-commands '(describe-function))
+(defun ergoemacs-key-description (keys &optional prefix)
+ "Allows `describe-function' to show the `ergoemacs-pretty-key' bindings.
+Uses `ergoemacs-real-key-description'."
+ (let ((ret (ergoemacs-real-key-description keys prefix)))
+ (when (and ergoemacs-mode
+ (memq this-command ergoemacs-key-description-commands))
+ (setq ret (ergoemacs-pretty-key ret)))
+ ret))
+
(declare-function ergoemacs-real-substitute-command-keys
"ergoemacs-advices.el" (string) t)
(fset 'ergoemacs-real-substitute-command-keys (symbol-function
'substitute-command-keys))
@@ -220,7 +237,7 @@ will add MAP to substitution."
(test-hash (gethash test-vect
ergoemacs-original-keys-to-shortcut-keys)))
(if test-hash
(progn
- (setq test (key-description (nth 0 test-hash)))
+ (setq test (ergoemacs-real-key-description (nth 0 test-hash)))
(ergoemacs-pretty-key test))
(let (ergoemacs-modal ergoemacs-repeat-keys ergoemacs-read-input-keys
ergoemacs-shortcut-keys)
@@ -370,7 +387,7 @@ Uses `ergoemacs-real-key-binding' to get the key-binding."
"Enabling advices for C code and complex changes to functions.
DISABLE when non-nil.
Assumes ergoemacs-real-FUNCTION and ergoemacs-FUNCTION as the two functions to
toggle"
- (dolist (ad '(completing-read substitute-command-keys key-binding))
+ (dolist (ad '(completing-read substitute-command-keys key-binding
key-description))
(cond
(disable
(fset ad (symbol-function (intern (concat "ergoemacs-real-" (symbol-name
ad))))))
- [elpa] 175/287: Change the `describe-mode` to `ergoemacs-describe-major-mode`. That way R will display the correct key to view information (C-h m), (continued)
- [elpa] 175/287: Change the `describe-mode` to `ergoemacs-describe-major-mode`. That way R will display the correct key to view information (C-h m), Matthew Fidler, 2014/07/02
- [elpa] 178/287: Add ergoemacs-read-key-default to ergoemacs-smart-functions, Matthew Fidler, 2014/07/02
- [elpa] 174/287: Remove adjoin issues in 24.1 and 24.2, Matthew Fidler, 2014/07/02
- [elpa] 179/287: Fix ergoemacs-repeat-movement-commands, Matthew Fidler, 2014/07/02
- [elpa] 181/287: Added `ergoemacs-hook-functions`, Matthew Fidler, 2014/07/02
- [elpa] 177/287: Remove cua-mode treatment in startup, Matthew Fidler, 2014/07/02
- [elpa] 180/287: Remap universal-argument to ergoemacs-universal-argument, Matthew Fidler, 2014/07/02
- [elpa] 182/287: Add package-requires for emacs 24.1, Matthew Fidler, 2014/07/02
- [elpa] 183/287: Split out ert, Matthew Fidler, 2014/07/02
- [elpa] 185/287: Bug fix for ergoemacs-substitute-command., Matthew Fidler, 2014/07/02
- [elpa] 184/287: Now use ergoemacs-pretty-key to describe fn keys,
Matthew Fidler <=
- [elpa] 186/287: Fix ergoemacs-read-key-lookup-get-ret---universal, Matthew Fidler, 2014/07/02
- [elpa] 189/287: Do all tests, Matthew Fidler, 2014/07/02
- [elpa] 188/287: Fix some byte-compile issues, Matthew Fidler, 2014/07/02
- [elpa] 190/287: Fix Issue #233, Matthew Fidler, 2014/07/02
- [elpa] 193/287: Fix Issue #241, Matthew Fidler, 2014/07/02
- [elpa] 205/287: Only push new keys to ergoemacs-global-override-rm-keys, and don't push [remap]s (Issue #243), Matthew Fidler, 2014/07/02
- [elpa] 191/287: change downcase and UPCASE for being more clear., Matthew Fidler, 2014/07/02
- [elpa] 208/287: Fix helm-M-x keys again., Matthew Fidler, 2014/07/02
- [elpa] 206/287: Remove debugging comment for ergoemacs-rm-key, Matthew Fidler, 2014/07/02
- [elpa] 207/287: Fix ergoemacs-pushnew Issue #244., Matthew Fidler, 2014/07/02