]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix the routine for help on Calc's prefixes.
authorJay Belanger <jay.p.belanger@gmail.com>
Fri, 18 Sep 2015 03:22:18 +0000 (22:22 -0500)
committerJay Belanger <jay.p.belanger@gmail.com>
Fri, 18 Sep 2015 03:22:18 +0000 (22:22 -0500)
* lisp/calc/calc-ext.el (calc-prefix-help-retry): New variable.
(calc-do-prefix-help): Use `read-char' to determine the next Calc
command.

lisp/calc/calc-ext.el

index 27898fd9c971ff7c6a2751700f63edded95e491a..adbb20c82f8d2157b8fa10d0092c77e07afa0a6f 100644 (file)
@@ -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.