diff options
author | Jay Belanger <jay.p.belanger@gmail.com> | 2015-09-17 22:22:18 -0500 |
---|---|---|
committer | Jay Belanger <jay.p.belanger@gmail.com> | 2015-09-17 22:22:18 -0500 |
commit | fb875ee6ff20034944df04b83a147493db7ddeb3 (patch) | |
tree | 0fb6c6387779697c0e98a82a53f7bf0002fb6add /lisp/calc/calc-ext.el | |
parent | 644c6b414f39222890246d7fe155a369b1983246 (diff) | |
download | emacs-fb875ee6ff20034944df04b83a147493db7ddeb3.tar.gz emacs-fb875ee6ff20034944df04b83a147493db7ddeb3.tar.bz2 emacs-fb875ee6ff20034944df04b83a147493db7ddeb3.zip |
Fix the routine for help on Calc's prefixes.
* lisp/calc/calc-ext.el (calc-prefix-help-retry): New variable.
(calc-do-prefix-help): Use `read-char' to determine the next Calc
command.
Diffstat (limited to 'lisp/calc/calc-ext.el')
-rw-r--r-- | lisp/calc/calc-ext.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 27898fd9c97..adbb20c82f8 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1293,6 +1293,7 @@ calc-kill calc-kill-region calc-yank)))) (define-key calc-help-map "?" 'calc-help-for-help) (define-key calc-help-map "\C-h" 'calc-help-for-help)) +(defvar calc-prefix-help-retry nil) (defvar calc-prefix-help-phase 0) (defun calc-do-prefix-help (msgs group key) (if calc-full-help-flag @@ -1300,7 +1301,7 @@ calc-kill calc-kill-region calc-yank)))) (if (cdr msgs) (progn (setq calc-prefix-help-phase - (if (eq this-command last-command) + (if calc-prefix-help-retry (% (1+ calc-prefix-help-phase) (1+ (length msgs))) 0)) (let ((msg (nth calc-prefix-help-phase msgs))) @@ -1321,7 +1322,13 @@ calc-kill calc-kill-region calc-yank)))) (message "%s: %s: %c-" group (car msgs) key) (message "%s: (none) %c-" group key)) (message "%s: %s" group (car msgs)))) - (and key (calc-unread-command key)))) + (let* ((chr (read-char)) + (keys (if key (string key chr) (string chr))) + (bnd (local-key-binding keys))) + (setq calc-prefix-help-retry (= chr ??)) + (if bnd + (call-interactively bnd) + (message (concat keys " is undefined")))))) ;;;; Commands. |