summaryrefslogtreecommitdiff
path: root/lisp/calc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/calc')
-rw-r--r--lisp/calc/calc-ext.el1
-rw-r--r--lisp/calc/calc-forms.el12
-rw-r--r--lisp/calc/calc-graph.el6
-rw-r--r--lisp/calc/calc-math.el12
4 files changed, 21 insertions, 10 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 3cafd962127..cc0972e4775 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -1633,6 +1633,7 @@ calc-kill calc-kill-region calc-yank))))
(not (equal var '(calc-mode-save-mode)))
(calc-save-modes))))
(if calc-embedded-info (calc-embedded-modes-change var))
+ (calc-set-mode-line)
(symbol-value (car var)))))
(defun calc-toggle-banner ()
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el
index c94b89d6b10..153b90429ea 100644
--- a/lisp/calc/calc-forms.el
+++ b/lisp/calc/calc-forms.el
@@ -317,7 +317,9 @@
(list 'calcFunc-hms a))
((math-negp a)
(math-neg (math-to-hms (math-neg a) ang)))
- ((eq (or ang calc-angle-mode) 'rad)
+ ((eq (or ang
+ (and (not math-simplifying-units) calc-angle-mode))
+ 'rad)
(math-to-hms (math-div a (math-pi-over-180)) 'deg))
((memq (car-safe a) '(cplx polar)) a)
(t
@@ -354,12 +356,16 @@
(if (eq (car-safe a) 'sdev)
(math-make-sdev (math-from-hms (nth 1 a) ang)
(math-from-hms (nth 2 a) ang))
- (if (eq (or ang calc-angle-mode) 'rad)
+ (if (eq (or ang
+ (and (not math-simplifying-units) calc-angle-mode))
+ 'rad)
(list 'calcFunc-rad a)
(list 'calcFunc-deg a)))))
((math-negp a)
(math-neg (math-from-hms (math-neg a) ang)))
- ((eq (or ang calc-angle-mode) 'rad)
+ ((eq (or ang
+ (and (not math-simplifying-units) calc-angle-mode))
+ 'rad)
(math-mul (math-from-hms a 'deg) (math-pi-over-180)))
(t
(math-add (math-div (math-add (math-div (nth 3 a)
diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el
index 3dedbbc434a..6357c97a0b2 100644
--- a/lisp/calc/calc-graph.el
+++ b/lisp/calc/calc-graph.el
@@ -908,9 +908,9 @@
(defun calc-graph-show-tty (output)
"Default calc-gnuplot-plot-command for \"tty\" output mode.
This is useful for tek40xx and other graphics-terminal types."
- (call-process-region 1 1 shell-file-name
- nil calc-gnuplot-buffer nil
- "-c" (format "cat %s >/dev/tty; rm %s" output output)))
+ (call-process shell-file-name nil calc-gnuplot-buffer nil
+ shell-command-switch
+ (format "cat %s >/dev/tty; rm %s" output output)))
(defvar calc-dumb-map nil
"The keymap for the \"dumb\" terminal plot.")
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index 699ef6f49ae..567635eb65b 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -763,12 +763,14 @@ If this can't be done, return NIL."
(defun math-to-radians (a) ; [N N]
(cond ((eq (car-safe a) 'hms)
(math-from-hms a 'rad))
- ((memq calc-angle-mode '(deg hms))
+ ((and (not math-simplifying-units)
+ (memq calc-angle-mode '(deg hms)))
(math-mul a (math-pi-over-180)))
(t a)))
(defun math-from-radians (a) ; [N N]
- (cond ((eq calc-angle-mode 'deg)
+ (cond ((and (not math-simplifying-units)
+ (eq calc-angle-mode 'deg))
(if (math-constp a)
(math-div a (math-pi-over-180))
(list 'calcFunc-deg a)))
@@ -779,14 +781,16 @@ If this can't be done, return NIL."
(defun math-to-radians-2 (a &optional force-symbolic) ; [N N]
(cond ((eq (car-safe a) 'hms)
(math-from-hms a 'rad))
- ((memq calc-angle-mode '(deg hms))
+ ((and (not math-simplifying-units)
+ (memq calc-angle-mode '(deg hms)))
(if (or calc-symbolic-mode force-symbolic)
(math-div (math-mul a '(var pi var-pi)) 180)
(math-mul a (math-pi-over-180))))
(t a)))
(defun math-from-radians-2 (a &optional force-symbolic) ; [N N]
- (cond ((memq calc-angle-mode '(deg hms))
+ (cond ((and (not math-simplifying-units)
+ (memq calc-angle-mode '(deg hms)))
(if (or calc-symbolic-mode force-symbolic)
(math-div (math-mul 180 a) '(var pi var-pi))
(math-div a (math-pi-over-180))))