diff options
Diffstat (limited to 'lisp/calc')
| -rw-r--r-- | lisp/calc/calc-aent.el | 2 | ||||
| -rw-r--r-- | lisp/calc/calc-menu.el | 4 | ||||
| -rw-r--r-- | lisp/calc/calc-units.el | 12 | ||||
| -rw-r--r-- | lisp/calc/calc.el | 10 |
4 files changed, 10 insertions, 18 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index ae0230633af..6b0cfbb55d9 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -42,7 +42,7 @@ (declare-function math-simplify "calc-alg" (top-expr)) (declare-function math-known-matrixp "calc-arith" (a)) (declare-function math-parse-fortran-subscr "calc-lang" (sym args)) -(declare-function math-to-radians-2 "calc-math" (a)) +(declare-function math-to-radians-2 "calc-math" (a &optional force-symbolic)) (declare-function math-read-string "calc-ext" ()) (declare-function math-read-brackets "calc-vec" (space-sep math-rb-close)) (declare-function math-read-angle-brackets "calc-forms" ()) diff --git a/lisp/calc/calc-menu.el b/lisp/calc/calc-menu.el index ee98cc98c8f..5120528eaf4 100644 --- a/lisp/calc/calc-menu.el +++ b/lisp/calc/calc-menu.el @@ -1634,7 +1634,9 @@ (Info-goto-node "Help Commands"))]) "Menu for Calc's help functions.") -(defvar calc-mode-map) +;; Needed to make this file loadable in isolation. +;; Another option would be to use calc-load-hook. +(require 'calc) (easy-menu-define calc-menu diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 335980af4dd..595d875eb6e 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -437,7 +437,7 @@ If COMP or STD is non-nil, put that in the units table instead." (list new-units (car default-units)) math-default-units-table)))))) -(defvar calc-allow-units-as-numbers) +(defvar calc-allow-units-as-numbers t) (defun calc-convert-units (&optional old-units new-units) (interactive) @@ -451,7 +451,9 @@ If COMP or STD is non-nil, put that in the units table instead." defunits) (if (or (not (math-units-in-expr-p expr t)) (setq unitscancel (and - calc-allow-units-as-numbers + (if (get 'calc-allow-units-as-numbers 'saved-value) + (car (get 'calc-allow-units-as-numbers 'saved-value)) + calc-allow-units-as-numbers) (eq (math-get-standard-units expr) 1)))) (let ((uold (or old-units (progn @@ -1495,10 +1497,8 @@ If COMP or STD is non-nil, put that in the units table instead." ((memq (car-safe expr) '(* /)) (cons (car expr) (mapcar 'math-extract-units (cdr expr)))) - ((and - (eq (car-safe expr) '^) - (math-check-unit-name (nth 1 expr))) - expr) + ((eq (car-safe expr) '^) + (list '^ (math-extract-units (nth 1 expr)) (nth 2 expr))) ((math-check-unit-name expr) expr) (t 1))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index db30d53d537..bd5c9089bcc 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -426,14 +426,6 @@ when converting units." :version "24.3" :type 'boolean) -(defcustom calc-allow-units-as-numbers - t - "If non-nil, allow unit expressions to be treated like numbers -when converting units, if the expression can be simplified to be unitless." - :group 'calc - :version "24.4" - :type 'boolean) - (defcustom calc-undo-length 100 "The number of undo steps that will be preserved when Calc is quit." @@ -2709,7 +2701,6 @@ largest Emacs integer.") (cons (car math-normalize-a) args)) nil) (wrong-type-argument - (setq math-normalize-error t) (or calc-next-why (calc-record-why "Wrong type of argument" (cons (car math-normalize-a) args))) @@ -2720,7 +2711,6 @@ largest Emacs integer.") (cons (car math-normalize-a) args)) nil) (inexact-result - (setq math-normalize-error t) (calc-record-why "No exact representation for result" (cons (car math-normalize-a) args)) nil) |
