(require 'calc-macs)
;; Declare functions which are defined elsewhere.
+(declare-function calc-digit-start-entry "calc" ())
(declare-function calc-refresh-evaltos "calc-ext" (&optional which-var))
(declare-function calc-execute-kbd-macro "calc-prog" (mac arg &rest prefix))
(declare-function math-is-true "calc-ext" (expr))
;;;###autoload
(defun calc-alg-digit-entry ()
(calc-alg-entry
- (cond ((eq last-command-event ?e)
- (if (> calc-number-radix 14) (format "%d.^" calc-number-radix) "1e"))
- ((eq last-command-event ?#) (format "%d#" calc-number-radix))
- ((eq last-command-event ?_) "-")
- ((eq last-command-event ?@) "0@ ")
- (t (char-to-string last-command-event)))))
+ (calc-digit-start-entry)))
;; The variable calc-digit-value is initially declared in calc.el,
;; but can be set by calcDigit-algebraic and calcDigit-edit.
;;;; Reading a number using the minibuffer.
+(defun calc-digit-start-entry ()
+ (cond ((eq last-command-event ?e)
+ (if (> calc-number-radix 14) (format "%d.^" calc-number-radix) "1e"))
+ ((eq last-command-event ?#) (format "%d#" calc-number-radix))
+ ((eq last-command-event ?_) "-")
+ ((eq last-command-event ?@) "0@ ")
+ (t (char-to-string last-command-event)))))
+
(defvar calc-buffer)
(defvar calc-prev-char)
(defvar calc-prev-prev-char)
(if (or calc-algebraic-mode
(and (> calc-number-radix 14) (eq last-command-event ?e)))
(calc-alg-digit-entry)
- (calc-unread-command)
(setq calc-aborted-prefix nil)
(let* ((calc-digit-value nil)
(calc-prev-char nil)
(unwind-protect
(progn
(define-key global-map "\e" nil)
- (read-from-minibuffer "Calc: " "" calc-digit-map))
+ (read-from-minibuffer
+ "Calc: " (calc-digit-start-entry) calc-digit-map))
(define-key global-map "\e" old-esc))))))
(or calc-digit-value (setq calc-digit-value (math-read-number buf)))
(if (stringp calc-digit-value)