From: Jay Belanger Date: Sun, 29 Jul 2012 23:19:09 +0000 (-0500) Subject: calc/calc.el (calc-simplify-mode): Make 'alg the default value. X-Git-Tag: emacs-24.2.90~1010 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1823ac5abe03117aab926ff0d51a189d513251ce;p=emacs.git calc/calc.el (calc-simplify-mode): Make 'alg the default value. (calc-set-mode-line): Don't display "AlgSimp ". calc/calc-mode.el (calc-alg-simplify-mode): Remove function. (calc-lim-simplify-mode): New function. (calc-set-simplify-mode): Default to 'alg. (calc-default-simplify-mode): Make algebraic simplifications the default. calc/calc-ext.el (calc-init-extensions): Remove binding for `calc-alg-simplify-mode'. Add binding for `calc-lim-simplify-mode'. calc/README: Mention new default simplification mode. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 18772064d7d..5434f9ed8ba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,19 @@ 2012-07-29 Jay Belanger + * calc/calc.el (calc-simplify-mode): Make 'alg the default value. + (calc-set-mode-line): Don't display "AlgSimp ". + + * calc/calc-mode.el (calc-alg-simplify-mode): Remove function. + (calc-lim-simplify-mode): New function. + (calc-set-simplify-mode): Default to 'alg. + (calc-default-simplify-mode): Make algebraic simplifications + the default. + + * calc/calc-ext.el (calc-init-extensions): Remove binding for + `calc-alg-simplify-mode'. Add binding for `calc-lim-simplify-mode'. + + * calc/README: Mention new default simplification mode. + * calc/calc.el (math-normalize-error): New variable. (math-normalize): Set `math-normalize-error' to t when there's an error. diff --git a/lisp/calc/README b/lisp/calc/README index e4b681d5625..b09ac6f79eb 100644 --- a/lisp/calc/README +++ b/lisp/calc/README @@ -70,6 +70,12 @@ opinions. Summary of changes to "Calc" ------- -- ------- -- ---- +Emacs 24.2 + +Algebraic simplification mode is now the default. +To restrict to the limited simplifications given by the former +default simplification mode, use `m L'. + Emacs 24.1 * Support for musical notes added. diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 818b19757be..883cc3dd939 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -454,12 +454,12 @@ (define-key calc-mode-map "mv" 'calc-matrix-mode) (define-key calc-mode-map "mw" 'calc-working) (define-key calc-mode-map "mx" 'calc-always-load-extensions) - (define-key calc-mode-map "mA" 'calc-alg-simplify-mode) (define-key calc-mode-map "mB" 'calc-bin-simplify-mode) (define-key calc-mode-map "mC" 'calc-auto-recompute) (define-key calc-mode-map "mD" 'calc-default-simplify-mode) (define-key calc-mode-map "mE" 'calc-ext-simplify-mode) (define-key calc-mode-map "mF" 'calc-settings-file-name) + (define-key calc-mode-map "mL" 'calc-lim-simplify-mode) (define-key calc-mode-map "mM" 'calc-more-recursion-depth) (define-key calc-mode-map "mN" 'calc-num-simplify-mode) (define-key calc-mode-map "mO" 'calc-no-simplify-mode) @@ -1093,7 +1093,7 @@ calc-pi calc-radians-mode calc-sec calc-sech calc-sin calc-sincos calc-sinh calc-sqrt calc-tan calc-tanh calc-to-degrees calc-to-radians) - ("calc-mode" calc-alg-simplify-mode calc-algebraic-mode + ("calc-mode" calc-lim-simplify-mode calc-algebraic-mode calc-always-load-extensions calc-auto-recompute calc-auto-why calc-bin-simplify-mode calc-break-vectors calc-center-justify calc-default-simplify-mode calc-display-raw calc-eng-notation diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index 3f583192bcf..28cb58656c0 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -504,7 +504,7 @@ mode))) (message "%s" (if (eq calc-simplify-mode mode) msg - "Default simplifications enabled"))) + "Default algebraic simplifications enabled"))) (defun calc-no-simplify-mode (arg) (interactive "P") @@ -519,15 +519,18 @@ "Default simplifications apply only if arguments are numeric"))) (defun calc-default-simplify-mode (arg) - (interactive "p") - (cond ((= arg 1) + (interactive "P") + (cond ((or (not arg) (= arg 3)) + (calc-wrapper + (calc-set-simplify-mode + 'alg nil "Default algebraic simplifications enabled"))) + ((= arg 1) (calc-wrapper (calc-set-simplify-mode - nil nil "Usual default simplifications are enabled"))) + nil nil "Limited simplifications occur by default"))) ((= arg 0) (calc-num-simplify-mode 1)) ((< arg 0) (calc-no-simplify-mode 1)) ((= arg 2) (calc-bin-simplify-mode 1)) - ((= arg 3) (calc-alg-simplify-mode 1)) ((= arg 4) (calc-ext-simplify-mode 1)) ((= arg 5) (calc-units-simplify-mode 1)) (t (error "Prefix argument out of range")))) @@ -539,11 +542,11 @@ (format "Binary simplification occurs by default (word size=%d)" calc-word-size)))) -(defun calc-alg-simplify-mode (arg) +(defun calc-lim-simplify-mode (arg) (interactive "P") (calc-wrapper - (calc-set-simplify-mode 'alg arg - "Algebraic simplification occurs by default"))) + (calc-set-simplify-mode nil arg + "Limited simplifications occur by default"))) (defun calc-ext-simplify-mode (arg) (interactive "P") diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index a149cfe7966..dd1efd014fb 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -698,11 +698,11 @@ If `C' is present, display outer brackets for matrices (centered).") (defcalcmodevar calc-previous-modulo nil "Most recently used value of M in a modulo form.") -(defcalcmodevar calc-simplify-mode nil +(defcalcmodevar calc-simplify-mode 'alg "Type of simplification applied to results. If `none', results are not simplified when pushed on the stack. If `num', functions are simplified only when args are constant. -If nil, only fast simplifications are applied. +If nil, only limited simplifications are applied. If `binary', `math-clip' is applied if appropriate. If `alg', `math-simplify' is applied. If `ext', `math-simplify-extended' is applied. @@ -1757,10 +1757,10 @@ See calc-keypad for details." ((eq calc-simplify-mode 'num) "NumSimp ") ((eq calc-simplify-mode 'binary) (format "BinSimp%d " calc-word-size)) - ((eq calc-simplify-mode 'alg) "AlgSimp ") + ((eq calc-simplify-mode 'alg) "") ((eq calc-simplify-mode 'ext) "ExtSimp ") ((eq calc-simplify-mode 'units) "UnitSimp ") - (t "")) + (t "LimSimp ")) ;; Display modes (cond ((= calc-number-radix 10) "")