[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 45/287: Fix ergoemacs-describe-key
From: |
Matthew Fidler |
Subject: |
[elpa] 45/287: Fix ergoemacs-describe-key |
Date: |
Wed, 02 Jul 2014 14:44:29 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit def72c96a8243d72d83b0ecbe047a9bee4af47fc
Author: Matthew L. Fidler <address@hidden>
Date: Wed Jun 4 14:58:06 2014 -0500
Fix ergoemacs-describe-key
---
ergoemacs-shortcuts.el | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/ergoemacs-shortcuts.el b/ergoemacs-shortcuts.el
index 3602f26..fc03163 100644
--- a/ergoemacs-shortcuts.el
+++ b/ergoemacs-shortcuts.el
@@ -162,7 +162,7 @@ equivalent is <apps> f M-k. When enabled, pressing this
should also perfomr `ou
(defvar ergoemacs-describe-key nil)
(defun ergoemacs-describe-key ()
"Ergoemacs replacement for `describe-key'
-Uses `ergoemacs-read'"
+Uses `ergoemacs-read-key'"
(interactive)
(setq ergoemacs-describe-key t)
(ergoemacs-read-key nil 'normal))
@@ -651,8 +651,44 @@ In addition, when the function is called:
((and (boundp 'ergoemacs-test-fn) ergoemacs-test-fn)
(setq ergoemacs-test-fn function))
(ergoemacs-describe-key
- (describe-key key)
- (setq ergoemacs-describe-key nil))
+ (let ((pt (point))
+ (buf (current-buffer))
+ (keys '())
+ test)
+ (unwind-protect
+ (save-excursion
+ (describe-function function)
+ (set-buffer (help-buffer))
+ (let ((inhibit-read-only t))
+ (goto-char (point-min))
+ (insert (format "%s runs the command "
+ (ergoemacs-pretty-key (key-description key))))
+ (when (search-forward " is" nil t)
+ (replace-match ", which is"))
+ (fill-paragraph)
+ (when (search-forward "bound to" nil t)
+ (delete-region
+ (point)
+ (if (re-search-forward "\\.\n\n") (point) (point)))
+ (save-excursion
+ (set-buffer buf)
+ (goto-char pt)
+ (ergoemacs-with-global
+ (dolist (global-key (where-is-internal function))
+ (setq test (gethash global-key
ergoemacs-original-keys-to-shortcut-keys))
+ (when test
+ (unless (eq (elt test 0) 'menu-bar)
+ (push (ergoemacs-pretty-key (key-description test))
+ keys)))))
+ (let (ergoemacs-modal ergoemacs-repeat-keys
ergoemacs-read-input-keys
+ ergoemacs-shortcut-keys)
+ (dolist (global-key (where-is-internal function))
+ (unless (eq (elt global-key 0) 'menu-bar)
+ (push (ergoemacs-pretty-key (key-description
global-key))
+ keys)))))
+ (insert (mapconcat (lambda(x) x) keys ", "))
+ (insert ".\n\n"))))
+ (setq ergoemacs-describe-key nil))))
((condition-case err
(string-match "self-insert" (symbol-name function))
(error nil))
- [elpa] 41/287: Take out hook to change bindings., (continued)
- [elpa] 41/287: Take out hook to change bindings., Matthew Fidler, 2014/07/02
- [elpa] 38/287: Remove global-override, Matthew Fidler, 2014/07/02
- [elpa] 23/287: Basic classes written, Matthew Fidler, 2014/07/02
- [elpa] 29/287: Started parsing., Matthew Fidler, 2014/07/02
- [elpa] 34/287: Now can get the fixed maps for a list of components., Matthew Fidler, 2014/07/02
- [elpa] 36/287: Use pushnew for get-hooks., Matthew Fidler, 2014/07/02
- [elpa] 37/287: Added ergoemacs-keymap-collapse and ergoemacs-keymap-empty-p, Matthew Fidler, 2014/07/02
- [elpa] 40/287: Remove shortcut override mode., Matthew Fidler, 2014/07/02
- [elpa] 44/287: Suppress shortcuts, Matthew Fidler, 2014/07/02
- [elpa] 39/287: Starting applying keymaps to ergoemacs-emulation-mode-map-alist, Matthew Fidler, 2014/07/02
- [elpa] 45/287: Fix ergoemacs-describe-key,
Matthew Fidler <=
- [elpa] 31/287: Created composite map list, Matthew Fidler, 2014/07/02
- [elpa] 42/287: Push shortcuts to the bottom. Should allow overrides., Matthew Fidler, 2014/07/02
- [elpa] 49/287: Bug fix for substitute-command-keys, Matthew Fidler, 2014/07/02
- [elpa] 43/287: Be more conservative with substituting key commands., Matthew Fidler, 2014/07/02
- [elpa] 46/287: Fix Issue #7, Matthew Fidler, 2014/07/02
- [elpa] 50/287: Another bug-fix for substitute-command-keys, Matthew Fidler, 2014/07/02
- [elpa] 52/287: Debugging ergoemacs-theme obect, Matthew Fidler, 2014/07/02
- [elpa] 51/287: more substitute-command-keys fixes, Matthew Fidler, 2014/07/02
- [elpa] 58/287: Fix misplaced paren, Matthew Fidler, 2014/07/02
- [elpa] 57/287: Added basic variable/mode initialization routines., Matthew Fidler, 2014/07/02