(declare-function math-parse-date "calc-forms" (math-pd-str))
(declare-function math-lessp "calc-ext" (a b))
(declare-function math-compare "calc-ext" (a b))
+(declare-function math-zerop "calc-misc" (a))
(declare-function calc-embedded-finish-command "calc-embed" ())
(declare-function calc-embedded-select-buffer "calc-embed" ())
(declare-function calc-embedded-mode-line-change "calc-embed" ())
(defcalcmodevar calc-algebraic-mode nil
"If non-nil, numeric entry accepts whole algebraic expressions.
-If nil, algebraic expressions must be preceded by \"'\".")
+If nil, algebraic expressions must be preceded by \"\\='\".")
(defcalcmodevar calc-incomplete-algebraic-mode nil
"Like calc-algebraic-mode except only affects ( and [ keys.")
(defvar calc-last-kill nil
"The last number killed in calc-mode.")
(defvar calc-dollar-values nil
- "Values to be used for '$'.")
+ "Values to be used for `$'.")
(defvar calc-dollar-used nil
- "The highest order of '$' that occurred.")
+ "The highest order of `$' that occurred.")
(defvar calc-hashes-used nil
- "The highest order of '#' that occurred.")
+ "The highest order of `#' that occurred.")
(defvar calc-quick-prev-results nil
"Previous results from Quick Calc.")
(defvar calc-said-hello nil
floating-point, complex, matrix, and symbolic arithmetic.
RPN calculation: 2 RET 3 + produces 5.
-Algebraic style: ' 2+3 RET produces 5.
+Algebraic style: \\=' 2+3 RET produces 5.
Basic operators are +, -, *, /, ^, & (reciprocal), % (modulo), n (change-sign).
[1 .. 4) semi-open interval, 1 <= x < 4
2 +/- 3 (p key) number with mean 2, standard deviation 3
2 mod 3 (M key) number 2 computed modulo 3
- <1 jan 91> Date form (enter using ' key)
+ <1 jan 91> Date form (enter using \\=' key)
\\{calc-mode-map}
;; (YEAR MONTH DAY math-date-from-gregorian-dt(YEAR MONTH DAY)) for speed.
(defcustom calc-gregorian-switch nil
"The first day the Gregorian calendar is used by Calc's date forms.
-This is `nil' (the default) if the Gregorian calendar is the only one used.
+This is nil (the default) if the Gregorian calendar is the only one used.
Otherwise, it should be a list `(YEAR MONTH DAY)' when Calc begins to use
the Gregorian calendar; Calc will use the Julian calendar for earlier dates.
The dates in which different regions of the world began to use the
(calc-delete-selection 1)
(calc-pop-stack nn))))))
(if calc-context-sensitive-enter (calc-cursor-stack-index (1- num)))))
-
+
;;;; 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)
(provide 'calc)
-;; Local variables:
-;; coding: utf-8
-;; End:
-
;;; calc.el ends here