summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-graph.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/calc/calc-graph.el')
-rw-r--r--lisp/calc/calc-graph.el45
1 files changed, 23 insertions, 22 deletions
diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el
index 4cdfdbd4b92..829fa44ca4f 100644
--- a/lisp/calc/calc-graph.el
+++ b/lisp/calc/calc-graph.el
@@ -1,4 +1,4 @@
-;;; calc-graph.el --- graph output functions for Calc
+;;; calc-graph.el --- graph output functions for Calc -*- lexical-binding:t -*-
;; Copyright (C) 1990-1993, 2001-2020 Free Software Foundation, Inc.
@@ -216,7 +216,7 @@
(or (and (Math-num-integerp pstyle) (math-trunc pstyle))
(if (eq (car-safe (calc-var-value (nth 2 ydata))) 'vec)
0 -1))
- (math-contains-sdev-p (eval (nth 2 ydata))))))
+ (math-contains-sdev-p (eval (nth 2 ydata) t)))))
(defun calc-graph-lookup (thing)
(if (and (eq (car-safe thing) 'var)
@@ -313,13 +313,13 @@
(defvar calc-graph-blank)
(defvar calc-graph-non-blank)
(defvar calc-graph-curve-num)
+(defvar math-arglist)
(defun calc-graph-plot (flag &optional printing)
(interactive "P")
(calc-slow-wrapper
(let ((calcbuf (current-buffer))
(tempbuf (get-buffer-create "*Gnuplot Temp-2*"))
- (tempbuftop 1)
(tempoutfile nil)
(calc-graph-curve-num 0)
(calc-graph-refine (and flag (> (prefix-numeric-value flag) 0)))
@@ -403,7 +403,7 @@
(and (equal output "tty") (setq tty-output t)))
(setq tempoutfile (calc-temp-file-name -1)
output tempoutfile))
- (setq output (eval output)))
+ (setq output (eval output t)))
(or (equal device calc-graph-last-device)
(progn
(setq calc-graph-last-device device)
@@ -480,9 +480,11 @@
(calc-graph-xp calc-graph-xvalue)
(calc-graph-yp calc-graph-yvalue)
(calc-graph-zp nil)
- (calc-graph-xlow nil) (calc-graph-xhigh nil) (y3low nil) (y3high nil)
+ (calc-graph-xlow nil) (calc-graph-xhigh nil)
+ ;; (y3low nil) (y3high nil)
calc-graph-xvec calc-graph-xval calc-graph-xstep var-DUMMY
- y3val calc-graph-y3step var-DUMMY2 (calc-graph-zval nil)
+ ;; y3val
+ calc-graph-y3step var-DUMMY2 (calc-graph-zval nil)
calc-graph-yvec calc-graph-yval calc-graph-ycache calc-graph-ycacheptr calc-graph-yvector
calc-graph-numsteps calc-graph-numsteps3
(calc-graph-keep-file (and (not calc-graph-is-splot) (file-exists-p filename)))
@@ -562,7 +564,7 @@
calc-gnuplot-print-output)))
(if (symbolp command)
(funcall command output)
- (eval command))))))))))
+ (eval command t))))))))))
(defun calc-graph-compute-2d ()
(if (setq calc-graph-yvec (eq (car-safe calc-graph-yvalue) 'vec))
@@ -905,16 +907,15 @@
(while calc-graph-file-cache
(and (car calc-graph-file-cache)
(file-exists-p (car (car calc-graph-file-cache)))
- (condition-case err
- (delete-file (car (car calc-graph-file-cache)))
- (error nil)))
+ (ignore-errors
+ (delete-file (car (car calc-graph-file-cache)))))
(setq calc-graph-file-cache (cdr calc-graph-file-cache))))
(defun calc-graph-kill-hook ()
(calc-graph-delete-temps))
(defun calc-graph-show-tty (output)
- "Default calc-gnuplot-plot-command for \"tty\" output mode.
+ "Default `calc-gnuplot-plot-command' for \"tty\" output mode.
This is useful for tek40xx and other graphics-terminal types."
(call-process shell-file-name nil calc-gnuplot-buffer nil
shell-command-switch
@@ -923,7 +924,7 @@ This is useful for tek40xx and other graphics-terminal types."
(defvar calc-dumb-map nil
"The keymap for the \"dumb\" terminal plot.")
-(defun calc-graph-show-dumb (&optional output)
+(defun calc-graph-show-dumb (&optional _output)
"Default calc-gnuplot-plot-command for Pinard's \"dumb\" terminal type.
This \"dumb\" driver will be present in Gnuplot 3.0."
(interactive)
@@ -1116,14 +1117,14 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
(delete-region start end)
(goto-char start)
(setq errform
- (condition-case nil
- (math-contains-sdev-p
- (eval (intern
- (concat "var-"
- (save-excursion
- (re-search-backward ":\\(.*\\)}")
- (match-string 1))))))
- (error nil)))
+ (ignore-errors
+ (math-contains-sdev-p
+ (symbol-value
+ (intern
+ (concat "var-"
+ (save-excursion
+ (re-search-backward ":\\(.*\\)}")
+ (match-string 1))))))))
(if yerr
(insert " with yerrorbars")
(insert " with "
@@ -1165,7 +1166,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
(or (calc-graph-find-plot nil nil)
(error "No data points have been set!"))
(let ((base (point))
- start
+ ;; start
end)
(re-search-forward "[,\n]\\|[ \t]+with")
(setq end (match-beginning 0))
@@ -1462,7 +1463,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
(match-beginning 1)
(match-end 1))))
(setq calc-gnuplot-version 1))))
- (condition-case err
+ (condition-case nil
(let ((args (append (and calc-gnuplot-display
(not (equal calc-gnuplot-display
(getenv "DISPLAY")))