]> git.eshelyaron.com Git - emacs.git/commitdiff
(calc-read-var-name): Remove initial "var-" from minibuffer.
authorJay Belanger <jay.p.belanger@gmail.com>
Mon, 27 Dec 2004 05:02:08 +0000 (05:02 +0000)
committerJay Belanger <jay.p.belanger@gmail.com>
Mon, 27 Dec 2004 05:02:08 +0000 (05:02 +0000)
lisp/calc/calc-store.el

index 2dca53b46bbe9b348d79436dc08724dfa104d009..a3c401e734eef9acd074d84172bfecd782b13201 100644 (file)
 (defun calc-read-var-name (prompt &optional calc-store-opers)
   (setq calc-given-value nil
        calc-aborted-prefix nil)
-  (let ((var (let ((minibuffer-completion-table obarray)
-                  (minibuffer-completion-predicate 'boundp)
-                  (minibuffer-completion-confirm t))
-              (read-from-minibuffer prompt "var-" calc-var-name-map nil))))
+  (let ((var (concat 
+              "var-"
+              (let ((minibuffer-completion-table
+                     (mapcar (lambda (x) (substring x 4)) 
+                             (all-completions "var-" obarray)))
+                    (minibuffer-completion-predicate 
+                     (lambda (x) (boundp (intern (concat "var-" x)))))
+                    (minibuffer-completion-confirm t))
+                (read-from-minibuffer prompt nil calc-var-name-map nil)))))
     (setq calc-aborted-prefix "")
-    (and (not (equal var ""))
-        (not (equal var "var-"))
+    (and (not (equal var "var-"))
         (if (string-match "\\`\\([-a-zA-Z0-9]+\\) *:?=" var)
             (if (null calc-given-value-flag)
                 (error "Assignment is not allowed in this command")