2020-10-10 16:00:51 -04:00
|
|
|
;;; calc-graph.el --- graph output functions for Calc -*- lexical-binding:t -*-
|
2001-11-19 07:44:56 +00:00
|
|
|
|
2024-01-02 09:47:10 +08:00
|
|
|
;; Copyright (C) 1990-1993, 2001-2024 Free Software Foundation, Inc.
|
2001-11-19 07:44:56 +00:00
|
|
|
|
|
|
|
;; Author: David Gillespie <daveg@synaptics.com>
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2008-05-06 03:16:00 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2007-03-19 20:59:53 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 03:16:00 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
2007-03-19 20:59:53 +00:00
|
|
|
|
2001-11-06 18:59:06 +00:00
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
2007-03-19 20:59:53 +00:00
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 15:52:52 -07:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2001-11-19 07:44:56 +00:00
|
|
|
;;; Commentary:
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2001-11-19 07:44:56 +00:00
|
|
|
;;; Code:
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
;; This file is autoloaded from calc-ext.el.
|
|
|
|
|
2004-11-30 17:10:43 +00:00
|
|
|
(require 'calc-ext)
|
2001-11-06 18:59:06 +00:00
|
|
|
(require 'calc-macs)
|
|
|
|
|
2004-11-30 17:10:43 +00:00
|
|
|
;;; Graphics
|
|
|
|
|
2005-04-01 21:44:53 +00:00
|
|
|
;; The following three variables are customizable and defined in calc.el.
|
|
|
|
(defvar calc-gnuplot-name)
|
|
|
|
(defvar calc-gnuplot-plot-command)
|
|
|
|
(defvar calc-gnuplot-print-command)
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2002-03-01 01:18:37 +00:00
|
|
|
(defvar calc-gnuplot-tempfile "calc")
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2004-11-24 21:44:23 +00:00
|
|
|
(defvar calc-gnuplot-default-device)
|
|
|
|
(defvar calc-gnuplot-default-output)
|
|
|
|
(defvar calc-gnuplot-print-device)
|
|
|
|
(defvar calc-gnuplot-print-output)
|
2001-11-06 18:59:06 +00:00
|
|
|
(defvar calc-gnuplot-keep-outfile nil)
|
|
|
|
(defvar calc-gnuplot-version nil)
|
|
|
|
|
|
|
|
(defvar calc-gnuplot-display (getenv "DISPLAY"))
|
2004-11-24 21:44:23 +00:00
|
|
|
(defvar calc-gnuplot-geometry)
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2004-11-24 21:44:23 +00:00
|
|
|
(defvar calc-graph-default-resolution)
|
|
|
|
(defvar calc-graph-default-resolution-3d)
|
2001-11-06 18:59:06 +00:00
|
|
|
(defvar calc-graph-default-precision 5)
|
|
|
|
|
|
|
|
(defvar calc-gnuplot-buffer nil)
|
|
|
|
(defvar calc-gnuplot-input nil)
|
|
|
|
|
|
|
|
(defvar calc-gnuplot-last-error-pos 1)
|
|
|
|
(defvar calc-graph-last-device nil)
|
|
|
|
(defvar calc-graph-last-output nil)
|
|
|
|
(defvar calc-graph-file-cache nil)
|
|
|
|
(defvar calc-graph-var-cache nil)
|
|
|
|
(defvar calc-graph-data-cache nil)
|
|
|
|
(defvar calc-graph-data-cache-limit 10)
|
2001-11-19 07:44:56 +00:00
|
|
|
(defvar calc-graph-no-auto-view nil)
|
|
|
|
(defvar calc-graph-no-wait nil)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(defvar calc-gnuplot-trail-mark)
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2019-01-13 17:50:16 +02:00
|
|
|
(defsubst calc-graph-w32-p ()
|
|
|
|
(eq system-type 'windows-nt))
|
|
|
|
|
2001-11-06 18:59:06 +00:00
|
|
|
(defun calc-graph-fast (many)
|
|
|
|
(interactive "P")
|
|
|
|
(let ((calc-graph-no-auto-view t))
|
|
|
|
(calc-graph-delete t)
|
|
|
|
(calc-graph-add many)
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-plot nil)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-fast-3d (many)
|
|
|
|
(interactive "P")
|
|
|
|
(let ((calc-graph-no-auto-view t))
|
|
|
|
(calc-graph-delete t)
|
|
|
|
(calc-graph-add-3d many)
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-plot nil)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-delete (all)
|
|
|
|
(interactive "P")
|
|
|
|
(calc-wrapper
|
|
|
|
(calc-graph-init)
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-input
|
2001-11-06 18:59:06 +00:00
|
|
|
(and (calc-graph-find-plot t all)
|
|
|
|
(progn
|
|
|
|
(if (looking-at "s?plot")
|
|
|
|
(progn
|
|
|
|
(setq calc-graph-var-cache nil)
|
|
|
|
(delete-region (point) (point-max)))
|
|
|
|
(delete-region (point) (1- (point-max)))))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-view-commands)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-find-plot (&optional before all)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(and (re-search-forward "^s?plot[ \t]+" nil t)
|
|
|
|
(let ((beg (point)))
|
|
|
|
(goto-char (point-max))
|
|
|
|
(if (or all
|
|
|
|
(not (search-backward "," nil t))
|
|
|
|
(< (point) beg))
|
|
|
|
(progn
|
|
|
|
(goto-char beg)
|
|
|
|
(if before
|
|
|
|
(beginning-of-line)))
|
|
|
|
(or before
|
|
|
|
(re-search-forward ",[ \t]+")))
|
2001-11-14 09:09:09 +00:00
|
|
|
t)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-add (many)
|
|
|
|
(interactive "P")
|
|
|
|
(calc-wrapper
|
|
|
|
(calc-graph-init)
|
|
|
|
(cond ((null many)
|
|
|
|
(calc-graph-add-curve (calc-graph-lookup (calc-top-n 2))
|
|
|
|
(calc-graph-lookup (calc-top-n 1))))
|
|
|
|
((or (consp many) (eq many 0))
|
|
|
|
(let ((xdata (calc-graph-lookup (calc-top-n 2)))
|
|
|
|
(ylist (calc-top-n 1)))
|
|
|
|
(or (eq (car-safe ylist) 'vec)
|
|
|
|
(error "Y argument must be a vector"))
|
|
|
|
(while (setq ylist (cdr ylist))
|
|
|
|
(calc-graph-add-curve xdata (calc-graph-lookup (car ylist))))))
|
|
|
|
((> (setq many (prefix-numeric-value many)) 0)
|
|
|
|
(let ((xdata (calc-graph-lookup (calc-top-n (1+ many)))))
|
|
|
|
(while (> many 0)
|
|
|
|
(calc-graph-add-curve xdata
|
|
|
|
(calc-graph-lookup (calc-top-n many)))
|
|
|
|
(setq many (1- many)))))
|
|
|
|
(t
|
|
|
|
(let (pair)
|
|
|
|
(setq many (- many))
|
|
|
|
(while (> many 0)
|
|
|
|
(setq pair (calc-top-n many))
|
|
|
|
(or (and (eq (car-safe pair) 'vec)
|
|
|
|
(= (length pair) 3))
|
|
|
|
(error "Argument must be an [x,y] vector"))
|
|
|
|
(calc-graph-add-curve (calc-graph-lookup (nth 1 pair))
|
|
|
|
(calc-graph-lookup (nth 2 pair)))
|
|
|
|
(setq many (1- many))))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-view-commands)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-add-3d (many)
|
|
|
|
(interactive "P")
|
|
|
|
(calc-wrapper
|
|
|
|
(calc-graph-init)
|
|
|
|
(cond ((null many)
|
|
|
|
(calc-graph-add-curve (calc-graph-lookup (calc-top-n 3))
|
|
|
|
(calc-graph-lookup (calc-top-n 2))
|
|
|
|
(calc-graph-lookup (calc-top-n 1))))
|
|
|
|
((or (consp many) (eq many 0))
|
|
|
|
(let ((xdata (calc-graph-lookup (calc-top-n 3)))
|
|
|
|
(ydata (calc-graph-lookup (calc-top-n 2)))
|
|
|
|
(zlist (calc-top-n 1)))
|
|
|
|
(or (eq (car-safe zlist) 'vec)
|
|
|
|
(error "Z argument must be a vector"))
|
|
|
|
(while (setq zlist (cdr zlist))
|
|
|
|
(calc-graph-add-curve xdata ydata
|
|
|
|
(calc-graph-lookup (car zlist))))))
|
|
|
|
((> (setq many (prefix-numeric-value many)) 0)
|
|
|
|
(let ((xdata (calc-graph-lookup (calc-top-n (+ many 2))))
|
|
|
|
(ydata (calc-graph-lookup (calc-top-n (+ many 1)))))
|
|
|
|
(while (> many 0)
|
|
|
|
(calc-graph-add-curve xdata ydata
|
|
|
|
(calc-graph-lookup (calc-top-n many)))
|
|
|
|
(setq many (1- many)))))
|
|
|
|
(t
|
|
|
|
(let (curve)
|
|
|
|
(setq many (- many))
|
|
|
|
(while (> many 0)
|
|
|
|
(setq curve (calc-top-n many))
|
|
|
|
(or (and (eq (car-safe curve) 'vec)
|
|
|
|
(= (length curve) 4))
|
|
|
|
(error "Argument must be an [x,y,z] vector"))
|
|
|
|
(calc-graph-add-curve (calc-graph-lookup (nth 1 curve))
|
|
|
|
(calc-graph-lookup (nth 2 curve))
|
|
|
|
(calc-graph-lookup (nth 3 curve)))
|
|
|
|
(setq many (1- many))))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-view-commands)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-add-curve (xdata ydata &optional zdata)
|
|
|
|
(let ((num (calc-graph-count-curves))
|
|
|
|
(pstyle (calc-var-value 'var-PointStyles))
|
|
|
|
(lstyle (calc-var-value 'var-LineStyles)))
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-input
|
2001-11-06 18:59:06 +00:00
|
|
|
(goto-char (point-min))
|
|
|
|
(if (re-search-forward (if zdata "^plot[ \t]" "^splot[ \t]")
|
|
|
|
nil t)
|
|
|
|
(error "Can't mix 2d and 3d curves on one graph"))
|
|
|
|
(if (re-search-forward "^s?plot[ \t]" nil t)
|
|
|
|
(progn
|
|
|
|
(end-of-line)
|
|
|
|
(insert ", "))
|
|
|
|
(goto-char (point-max))
|
|
|
|
(or (eq (preceding-char) ?\n)
|
|
|
|
(insert "\n"))
|
|
|
|
(insert (if zdata "splot" "plot") " \n")
|
|
|
|
(forward-char -1))
|
|
|
|
(insert "{" (symbol-name (nth 1 xdata))
|
|
|
|
":" (symbol-name (nth 1 ydata)))
|
|
|
|
(if zdata
|
|
|
|
(insert ":" (symbol-name (nth 1 zdata))))
|
|
|
|
(insert "} "
|
|
|
|
"title \"" (symbol-name (nth 1 ydata)) "\" "
|
|
|
|
"with dots")
|
|
|
|
(setq pstyle (and (eq (car-safe pstyle) 'vec) (nth (1+ num) pstyle)))
|
2004-09-21 18:52:00 +00:00
|
|
|
(setq lstyle (and (eq (car-safe lstyle) 'vec) (nth (1+ num) lstyle))))
|
|
|
|
(calc-graph-set-styles
|
|
|
|
(or (and (Math-num-integerp lstyle) (math-trunc lstyle))
|
|
|
|
0)
|
|
|
|
(or (and (Math-num-integerp pstyle) (math-trunc pstyle))
|
|
|
|
(if (eq (car-safe (calc-var-value (nth 2 ydata))) 'vec)
|
2007-08-03 05:25:03 +00:00
|
|
|
0 -1))
|
2020-10-10 16:00:51 -04:00
|
|
|
(math-contains-sdev-p (eval (nth 2 ydata) t)))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-lookup (thing)
|
|
|
|
(if (and (eq (car-safe thing) 'var)
|
|
|
|
(calc-var-value (nth 2 thing)))
|
|
|
|
thing
|
|
|
|
(let ((found (assoc thing calc-graph-var-cache)))
|
|
|
|
(or found
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(let ((varname (concat "PlotData"
|
|
|
|
(int-to-string
|
2009-09-19 21:22:45 +00:00
|
|
|
(1+ (length calc-graph-var-cache)))))
|
|
|
|
var)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq var (list 'var (intern varname)
|
2001-11-06 18:59:06 +00:00
|
|
|
(intern (concat "var-" varname)))
|
|
|
|
found (cons thing var)
|
|
|
|
calc-graph-var-cache (cons found calc-graph-var-cache))
|
|
|
|
(set (nth 2 var) thing)))
|
2001-11-14 09:09:09 +00:00
|
|
|
(cdr found))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-juggle (arg)
|
|
|
|
(interactive "p")
|
|
|
|
(calc-graph-init)
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-input
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (< arg 0)
|
|
|
|
(let ((num (calc-graph-count-curves)))
|
|
|
|
(if (> num 0)
|
|
|
|
(while (< arg 0)
|
|
|
|
(setq arg (+ arg num))))))
|
|
|
|
(while (>= (setq arg (1- arg)) 0)
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-do-juggle))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-count-curves ()
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-input
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (re-search-forward "^s?plot[ \t]" nil t)
|
|
|
|
(let ((num 1))
|
|
|
|
(goto-char (point-min))
|
|
|
|
(while (search-forward "," nil t)
|
|
|
|
(setq num (1+ num)))
|
|
|
|
num)
|
2001-11-14 09:09:09 +00:00
|
|
|
0)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-do-juggle ()
|
|
|
|
(let (base)
|
|
|
|
(and (calc-graph-find-plot t t)
|
|
|
|
(progn
|
|
|
|
(setq base (point))
|
|
|
|
(calc-graph-find-plot t nil)
|
|
|
|
(or (eq base (point))
|
|
|
|
(let ((str (buffer-substring (+ (point) 2) (1- (point-max)))))
|
|
|
|
(delete-region (point) (1- (point-max)))
|
|
|
|
(goto-char (+ base 5))
|
2001-11-14 09:09:09 +00:00
|
|
|
(insert str ", ")))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-print (flag)
|
|
|
|
(interactive "P")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-plot flag t))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(defvar var-DUMMY)
|
|
|
|
(defvar var-DUMMY2)
|
|
|
|
(defvar var-PlotRejects)
|
|
|
|
|
2009-09-19 21:22:45 +00:00
|
|
|
;; The following variables are local to calc-graph-plot, but are
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
;; used in the functions calc-graph-compute-2d, calc-graph-refine-2d,
|
2009-09-19 21:22:45 +00:00
|
|
|
;; calc-graph-recompute-2d, calc-graph-compute-3d and
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
;; calc-graph-format-data, which are called by calc-graph-plot.
|
|
|
|
(defvar calc-graph-yvalue)
|
|
|
|
(defvar calc-graph-yvec)
|
|
|
|
(defvar calc-graph-numsteps)
|
|
|
|
(defvar calc-graph-numsteps3)
|
|
|
|
(defvar calc-graph-xvalue)
|
|
|
|
(defvar calc-graph-xvec)
|
|
|
|
(defvar calc-graph-xname)
|
|
|
|
(defvar calc-graph-yname)
|
|
|
|
(defvar calc-graph-xstep)
|
|
|
|
(defvar calc-graph-ycache)
|
|
|
|
(defvar calc-graph-ycacheptr)
|
|
|
|
(defvar calc-graph-refine)
|
|
|
|
(defvar calc-graph-keep-file)
|
|
|
|
(defvar calc-graph-xval)
|
|
|
|
(defvar calc-graph-xlow)
|
|
|
|
(defvar calc-graph-xhigh)
|
|
|
|
(defvar calc-graph-yval)
|
|
|
|
(defvar calc-graph-yp)
|
|
|
|
(defvar calc-graph-xp)
|
|
|
|
(defvar calc-graph-zp)
|
|
|
|
(defvar calc-graph-yvector)
|
|
|
|
(defvar calc-graph-resolution)
|
|
|
|
(defvar calc-graph-y3value)
|
|
|
|
(defvar calc-graph-y3name)
|
|
|
|
(defvar calc-graph-y3step)
|
|
|
|
(defvar calc-graph-zval)
|
|
|
|
(defvar calc-graph-stepcount)
|
|
|
|
(defvar calc-graph-is-splot)
|
|
|
|
(defvar calc-graph-surprise-splot)
|
|
|
|
(defvar calc-graph-blank)
|
|
|
|
(defvar calc-graph-non-blank)
|
|
|
|
(defvar calc-graph-curve-num)
|
2020-10-14 18:03:52 -04:00
|
|
|
(defvar math-arglist)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
|
2001-11-06 18:59:06 +00:00
|
|
|
(defun calc-graph-plot (flag &optional printing)
|
|
|
|
(interactive "P")
|
|
|
|
(calc-slow-wrapper
|
|
|
|
(let ((calcbuf (current-buffer))
|
|
|
|
(tempbuf (get-buffer-create "*Gnuplot Temp-2*"))
|
|
|
|
(tempoutfile nil)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(calc-graph-curve-num 0)
|
|
|
|
(calc-graph-refine (and flag (> (prefix-numeric-value flag) 0)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(recompute (and flag (< (prefix-numeric-value flag) 0)))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(calc-graph-surprise-splot nil)
|
2001-11-06 18:59:06 +00:00
|
|
|
(tty-output nil)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
cache-env calc-graph-is-splot device output calc-graph-resolution precision samples-pos)
|
|
|
|
(add-hook 'kill-emacs-hook 'calc-graph-kill-hook)
|
2001-11-06 18:59:06 +00:00
|
|
|
(save-excursion
|
|
|
|
(calc-graph-init)
|
|
|
|
(set-buffer tempbuf)
|
|
|
|
(erase-buffer)
|
|
|
|
(set-buffer calc-gnuplot-input)
|
|
|
|
(goto-char (point-min))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-is-splot (re-search-forward "^splot[ \t]" nil t))
|
2001-11-06 18:59:06 +00:00
|
|
|
(let ((str (buffer-string))
|
|
|
|
(ver calc-gnuplot-version))
|
|
|
|
(set-buffer (get-buffer-create "*Gnuplot Temp*"))
|
|
|
|
(erase-buffer)
|
|
|
|
(insert "# (Note: This is a temporary copy---do not edit!)\n")
|
|
|
|
(if (>= ver 2)
|
|
|
|
(insert "set noarrow\nset nolabel\n"
|
|
|
|
"set autoscale xy\nset nologscale xy\n"
|
|
|
|
"set xlabel\nset ylabel\nset title\n"
|
|
|
|
"set noclip points\nset clip one\nset clip two\n"
|
|
|
|
"set format \"%g\"\nset tics\nset xtics\nset ytics\n"
|
2010-04-28 21:38:12 -05:00
|
|
|
"set style data linespoints\n"
|
2001-11-06 18:59:06 +00:00
|
|
|
"set nogrid\nset nokey\nset nopolar\n"))
|
|
|
|
(if (>= ver 3)
|
|
|
|
(insert "set surface\nset nocontour\n"
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
"set " (if calc-graph-is-splot "" "no") "parametric\n"
|
2020-12-07 13:36:34 +01:00
|
|
|
"set notimestamp\nset border\nset ztics\nset zeroaxis\n"
|
2001-11-06 18:59:06 +00:00
|
|
|
"set view 60,30,1,1\nset offsets 0,0,0,0\n"))
|
|
|
|
(setq samples-pos (point))
|
|
|
|
(insert "\n\n" str))
|
|
|
|
(goto-char (point-min))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if calc-graph-is-splot
|
|
|
|
(if calc-graph-refine
|
2001-11-06 18:59:06 +00:00
|
|
|
(error "This option works only for 2d plots")
|
|
|
|
(setq recompute t)))
|
|
|
|
(let ((calc-gnuplot-input (current-buffer))
|
|
|
|
(calc-graph-no-auto-view t))
|
|
|
|
(if printing
|
|
|
|
(setq device calc-gnuplot-print-device
|
|
|
|
output calc-gnuplot-print-output)
|
|
|
|
(setq device (calc-graph-find-command "terminal")
|
|
|
|
output (calc-graph-find-command "output"))
|
|
|
|
(or device
|
|
|
|
(setq device calc-gnuplot-default-device))
|
|
|
|
(if output
|
|
|
|
(setq output (car (read-from-string output)))
|
|
|
|
(setq output calc-gnuplot-default-output)))
|
|
|
|
(if (or (equal device "") (equal device "default"))
|
2009-08-07 14:54:10 +00:00
|
|
|
(setq device
|
|
|
|
(cond
|
|
|
|
(printing "postscript")
|
|
|
|
;; Check MS-Windows before X, in case they have
|
|
|
|
;; $DISPLAY set for some reason (e.g., Cygwin or
|
|
|
|
;; whatever)
|
2019-01-13 17:50:16 +02:00
|
|
|
((string= calc-gnuplot-name "pgnuplot")
|
|
|
|
"windows")
|
|
|
|
;; Versions of gnuplot that come without pgnuplot
|
|
|
|
;; only work on MS-Windows with "qt" as the
|
|
|
|
;; terminal, for some reason.
|
|
|
|
((calc-graph-w32-p)
|
|
|
|
"qt")
|
2009-08-07 14:54:10 +00:00
|
|
|
((or (eq window-system 'x) (getenv "DISPLAY"))
|
|
|
|
"x11")
|
|
|
|
((>= calc-gnuplot-version 3)
|
|
|
|
"dumb")
|
|
|
|
(t "postscript"))))
|
2021-08-31 03:47:45 +02:00
|
|
|
(unless (equal device calc-graph-last-device)
|
|
|
|
(setq calc-graph-last-device device)
|
|
|
|
(unless (calc-gnuplot-command "set terminal" device)
|
|
|
|
;; If gnuplot doesn't support the terminal, then set it
|
|
|
|
;; to "dumb".
|
|
|
|
(calc-gnuplot-command "set terminal dumb")
|
|
|
|
(setq device "dumb")))
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (equal device "dumb")
|
|
|
|
(setq device (format "dumb %d %d"
|
2001-11-13 07:30:58 +00:00
|
|
|
(1- (frame-width)) (1- (frame-height)))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (equal device "big")
|
|
|
|
(setq device (format "dumb %d %d"
|
2001-11-13 07:30:58 +00:00
|
|
|
(* 4 (- (frame-width) 3))
|
|
|
|
(* 4 (- (frame-height) 3)))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (stringp output)
|
|
|
|
(if (or (equal output "auto")
|
|
|
|
(and (equal output "tty") (setq tty-output t)))
|
|
|
|
(setq tempoutfile (calc-temp-file-name -1)
|
|
|
|
output tempoutfile))
|
2020-10-10 16:00:51 -04:00
|
|
|
(setq output (eval output t)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(or (equal output calc-graph-last-output)
|
|
|
|
(progn
|
|
|
|
(setq calc-graph-last-output output)
|
|
|
|
(calc-gnuplot-command "set output"
|
|
|
|
(if (equal output "STDOUT")
|
|
|
|
""
|
|
|
|
(prin1-to-string output)))))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-resolution (calc-graph-find-command "samples"))
|
|
|
|
(if calc-graph-resolution
|
2005-05-02 19:44:07 +00:00
|
|
|
(setq calc-graph-resolution (string-to-number calc-graph-resolution))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-resolution (if calc-graph-is-splot
|
2001-11-06 18:59:06 +00:00
|
|
|
calc-graph-default-resolution-3d
|
|
|
|
calc-graph-default-resolution)))
|
|
|
|
(setq precision (calc-graph-find-command "precision"))
|
|
|
|
(if precision
|
2005-05-02 19:44:07 +00:00
|
|
|
(setq precision (string-to-number precision))
|
2001-11-06 18:59:06 +00:00
|
|
|
(setq precision calc-graph-default-precision))
|
|
|
|
(calc-graph-set-command "terminal")
|
|
|
|
(calc-graph-set-command "output")
|
|
|
|
(calc-graph-set-command "samples")
|
|
|
|
(calc-graph-set-command "precision"))
|
|
|
|
(goto-char samples-pos)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(insert "set samples " (int-to-string (max (if calc-graph-is-splot 20 200)
|
|
|
|
(+ 5 calc-graph-resolution))) "\n")
|
2001-11-06 18:59:06 +00:00
|
|
|
(while (re-search-forward "{\\*[^}]+}[^,\n]*" nil t)
|
|
|
|
(delete-region (match-beginning 0) (match-end 0))
|
|
|
|
(if (looking-at ",")
|
|
|
|
(delete-char 1)
|
2003-02-18 10:58:50 +00:00
|
|
|
(while (memq (preceding-char) '(?\s ?\t))
|
2001-11-06 18:59:06 +00:00
|
|
|
(forward-char -1))
|
|
|
|
(if (eq (preceding-char) ?\,)
|
Replace Lisp calls to delete-backward-char by delete-char.
* bs.el, expand.el, ido.el, image-dired.el, lpr.el, pcomplete.el,
skeleton.el, term.el, time.el, wid-edit.el, woman.el,
calc/calc-graph.el, calc/calc-help.el, calc/calc-incom.el,
calc/calc.el, emacs-cl-extra.el, emacs-cl-loaddefs.el,
emulation/cua-rect.el, emulation/viper-ex.el, eshell/esh-test.el,
eshell/eshell.el, gnus/gnus-uu.el, gnus/nndoc.el, gnus/nnrss.el,
gnus/rfc2047.el, gnus/utf7.el, international/utf-7.el,
language/ethio-util.el, mh-e/mh-alias.el, mh-e/mh-search.el,
net/imap.el, net/rcirc.el, obsolete/complete.el, play/decipher.el,
progmodes/ada-mode.el, progmodes/cc-awk.el, progmodes/dcl-mode.el,
progmodes/ps-mode.el, progmodes/verilog-mode.el,
progmodes/vhdl-mode.el, textmodes/bibtex.el, textmodes/fill.el,
textmodes/reftex-auc.el, textmodes/rst.el, textmodes/sgml-mode.el,
textmodes/table.el, textmodes/texinfmt.el: Replace Lisp calls to
delete-backward-char by calls to delete-char.
2010-05-24 22:11:08 -04:00
|
|
|
(delete-char -1))))
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calcbuf
|
2001-11-06 18:59:06 +00:00
|
|
|
(setq cache-env (list calc-angle-mode
|
|
|
|
calc-complex-mode
|
|
|
|
calc-simplify-mode
|
|
|
|
calc-infinite-mode
|
|
|
|
calc-word-size
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
precision calc-graph-is-splot))
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (and (not recompute)
|
|
|
|
(equal (cdr (car calc-graph-data-cache)) cache-env))
|
|
|
|
(while (> (length calc-graph-data-cache)
|
|
|
|
calc-graph-data-cache-limit)
|
|
|
|
(setcdr calc-graph-data-cache
|
|
|
|
(cdr (cdr calc-graph-data-cache))))
|
|
|
|
(setq calc-graph-data-cache (list (cons nil cache-env)))))
|
|
|
|
(calc-graph-find-plot t t)
|
|
|
|
(while (re-search-forward
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if calc-graph-is-splot
|
2001-11-06 18:59:06 +00:00
|
|
|
"{\\([^{}:\n]+\\):\\([^{}:\n]+\\):\\([^{}:\n]+\\)}"
|
|
|
|
"{\\([^{}:\n]+\\)\\(:\\)\\([^{}:\n]+\\)}")
|
|
|
|
nil t)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-curve-num (1+ calc-graph-curve-num))
|
|
|
|
(let* ((calc-graph-xname (buffer-substring (match-beginning 1) (match-end 1)))
|
|
|
|
(xvar (intern (concat "var-" calc-graph-xname)))
|
|
|
|
(calc-graph-xvalue (math-evaluate-expr (calc-var-value xvar)))
|
|
|
|
(calc-graph-y3name (and calc-graph-is-splot
|
2001-11-06 18:59:06 +00:00
|
|
|
(buffer-substring (match-beginning 2)
|
|
|
|
(match-end 2))))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(y3var (and calc-graph-is-splot (intern (concat "var-" calc-graph-y3name))))
|
|
|
|
(calc-graph-y3value (and calc-graph-is-splot (calc-var-value y3var)))
|
|
|
|
(calc-graph-yname (buffer-substring (match-beginning 3) (match-end 3)))
|
|
|
|
(yvar (intern (concat "var-" calc-graph-yname)))
|
|
|
|
(calc-graph-yvalue (calc-var-value yvar))
|
2001-11-06 18:59:06 +00:00
|
|
|
filename)
|
|
|
|
(delete-region (match-beginning 0) (match-end 0))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq filename (calc-temp-file-name calc-graph-curve-num))
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calcbuf
|
2001-11-06 18:59:06 +00:00
|
|
|
(let (tempbuftop
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(calc-graph-xp calc-graph-xvalue)
|
|
|
|
(calc-graph-yp calc-graph-yvalue)
|
|
|
|
(calc-graph-zp nil)
|
2020-10-10 16:00:51 -04:00
|
|
|
(calc-graph-xlow nil) (calc-graph-xhigh nil)
|
|
|
|
;; (y3low nil) (y3high nil)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
calc-graph-xvec calc-graph-xval calc-graph-xstep var-DUMMY
|
2020-10-10 16:00:51 -04:00
|
|
|
;; y3val
|
|
|
|
calc-graph-y3step var-DUMMY2 (calc-graph-zval nil)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
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)))
|
|
|
|
(calc-graph-stepcount 0)
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-symbolic-mode nil)
|
|
|
|
(calc-prefer-frac nil)
|
|
|
|
(calc-internal-prec (max 3 precision))
|
|
|
|
(calc-simplify-mode (and (not (memq calc-simplify-mode
|
|
|
|
'(none num)))
|
|
|
|
calc-simplify-mode))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(calc-graph-blank t)
|
|
|
|
(calc-graph-non-blank nil)
|
2001-11-06 18:59:06 +00:00
|
|
|
(math-working-step 0)
|
|
|
|
(math-working-step-2 nil))
|
|
|
|
(save-excursion
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if calc-graph-is-splot
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-graph-compute-3d)
|
|
|
|
(calc-graph-compute-2d))
|
|
|
|
(set-buffer tempbuf)
|
|
|
|
(goto-char (point-max))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(insert "\n" calc-graph-xname)
|
|
|
|
(if calc-graph-is-splot
|
|
|
|
(insert ":" calc-graph-y3name))
|
|
|
|
(insert ":" calc-graph-yname "\n\n")
|
2001-11-06 18:59:06 +00:00
|
|
|
(setq tempbuftop (point))
|
|
|
|
(let ((calc-group-digits nil)
|
|
|
|
(calc-leading-zeros nil)
|
|
|
|
(calc-number-radix 10)
|
2009-11-20 00:58:28 +00:00
|
|
|
(calc-twos-complement-mode nil)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(entry (and (not calc-graph-is-splot)
|
|
|
|
(list calc-graph-xp calc-graph-yp calc-graph-xhigh calc-graph-numsteps))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(or (equal entry
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(nth 1 (nth (1+ calc-graph-curve-num)
|
2001-11-06 18:59:06 +00:00
|
|
|
calc-graph-file-cache)))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-keep-file nil))
|
|
|
|
(setcar (cdr (nth (1+ calc-graph-curve-num) calc-graph-file-cache))
|
2001-11-06 18:59:06 +00:00
|
|
|
entry)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(or calc-graph-keep-file
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-graph-format-data)))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(or calc-graph-keep-file
|
2001-11-06 18:59:06 +00:00
|
|
|
(progn
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(or calc-graph-non-blank
|
2001-11-06 18:59:06 +00:00
|
|
|
(error "No valid data points for %s:%s"
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
calc-graph-xname calc-graph-yname))
|
2001-11-06 18:59:06 +00:00
|
|
|
(write-region tempbuftop (point-max) filename
|
|
|
|
nil 'quiet))))))
|
|
|
|
(insert (prin1-to-string filename))))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if calc-graph-surprise-splot
|
2001-11-06 18:59:06 +00:00
|
|
|
(setcdr cache-env nil))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if (= calc-graph-curve-num 0)
|
2001-11-06 18:59:06 +00:00
|
|
|
(progn
|
|
|
|
(calc-gnuplot-command "clear")
|
|
|
|
(calc-clear-command-flag 'clear-message)
|
|
|
|
(message "No data to plot!"))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-data-cache-limit (max calc-graph-curve-num
|
2009-06-23 07:28:19 +00:00
|
|
|
calc-graph-data-cache-limit))
|
|
|
|
(let ((filename (calc-temp-file-name 0)))
|
|
|
|
(write-region (point-min) (point-max) filename nil 'quiet)
|
|
|
|
(calc-gnuplot-command "load" (prin1-to-string filename)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(or (equal output "STDOUT")
|
|
|
|
calc-gnuplot-keep-outfile
|
|
|
|
(progn ; need to close the output file before printing/plotting
|
|
|
|
(setq calc-graph-last-output "STDOUT")
|
|
|
|
(calc-gnuplot-command "set output")))
|
|
|
|
(let ((command (if printing
|
|
|
|
calc-gnuplot-print-command
|
|
|
|
(or calc-gnuplot-plot-command
|
|
|
|
(and (string-match "^dumb" device)
|
|
|
|
'calc-graph-show-dumb)
|
|
|
|
(and tty-output
|
|
|
|
'calc-graph-show-tty)))))
|
|
|
|
(if command
|
|
|
|
(if (stringp command)
|
|
|
|
(calc-gnuplot-command
|
|
|
|
"!" (format command
|
|
|
|
(or tempoutfile
|
|
|
|
calc-gnuplot-print-output)))
|
|
|
|
(if (symbolp command)
|
|
|
|
(funcall command output)
|
2020-10-10 16:00:51 -04:00
|
|
|
(eval command t))))))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-compute-2d ()
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if (setq calc-graph-yvec (eq (car-safe calc-graph-yvalue) 'vec))
|
|
|
|
(if (= (setq calc-graph-numsteps (1- (length calc-graph-yvalue))) 0)
|
2001-11-06 18:59:06 +00:00
|
|
|
(error "Can't plot an empty vector")
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if (setq calc-graph-xvec (eq (car-safe calc-graph-xvalue) 'vec))
|
|
|
|
(or (= (1- (length calc-graph-xvalue)) calc-graph-numsteps)
|
|
|
|
(error "%s and %s have different lengths" calc-graph-xname calc-graph-yname))
|
|
|
|
(if (and (eq (car-safe calc-graph-xvalue) 'intv)
|
|
|
|
(math-constp calc-graph-xvalue))
|
|
|
|
(setq calc-graph-xstep (math-div (math-sub (nth 3 calc-graph-xvalue)
|
|
|
|
(nth 2 calc-graph-xvalue))
|
|
|
|
(1- calc-graph-numsteps))
|
|
|
|
calc-graph-xvalue (nth 2 calc-graph-xvalue))
|
|
|
|
(if (math-realp calc-graph-xvalue)
|
|
|
|
(setq calc-graph-xstep 1)
|
|
|
|
(error "%s is not a suitable basis for %s" calc-graph-xname calc-graph-yname)))))
|
|
|
|
(or (math-realp calc-graph-yvalue)
|
2011-01-20 21:48:26 -06:00
|
|
|
(let ((math-arglist nil))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-yvalue (math-evaluate-expr calc-graph-yvalue))
|
|
|
|
(calc-default-formula-arglist calc-graph-yvalue)
|
2011-01-20 21:48:26 -06:00
|
|
|
(or math-arglist
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(error "%s does not contain any unassigned variables" calc-graph-yname))
|
2011-01-20 21:48:26 -06:00
|
|
|
(and (cdr math-arglist)
|
2001-11-06 18:59:06 +00:00
|
|
|
(error "%s contains more than one variable: %s"
|
2011-01-20 21:48:26 -06:00
|
|
|
calc-graph-yname math-arglist))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-yvalue (math-expr-subst calc-graph-yvalue
|
2011-01-20 21:48:26 -06:00
|
|
|
(math-build-var-name (car math-arglist))
|
2001-11-06 18:59:06 +00:00
|
|
|
'(var DUMMY var-DUMMY)))))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-ycache (assoc calc-graph-yvalue calc-graph-data-cache))
|
2023-05-18 17:33:15 +02:00
|
|
|
(setq calc-graph-data-cache
|
|
|
|
(nconc (delq calc-graph-ycache calc-graph-data-cache)
|
|
|
|
(list (or calc-graph-ycache
|
|
|
|
(setq calc-graph-ycache (list calc-graph-yvalue))))))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if (and (not (setq calc-graph-xvec (eq (car-safe calc-graph-xvalue) 'vec)))
|
|
|
|
calc-graph-refine (cdr (cdr calc-graph-ycache)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-graph-refine-2d)
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-recompute-2d))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-refine-2d ()
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-keep-file nil
|
|
|
|
calc-graph-ycacheptr (cdr calc-graph-ycache))
|
|
|
|
(if (and (setq calc-graph-xval (calc-graph-find-command "xrange"))
|
2001-11-06 18:59:06 +00:00
|
|
|
(string-match "\\`\\[\\([0-9.eE+-]*\\):\\([0-9.eE+-]*\\)\\]\\'"
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
calc-graph-xval))
|
2001-11-06 18:59:06 +00:00
|
|
|
(let ((b2 (match-beginning 2))
|
|
|
|
(e2 (match-end 2)))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-xlow (math-read-number (substring calc-graph-xval
|
2001-11-06 18:59:06 +00:00
|
|
|
(match-beginning 1)
|
|
|
|
(match-end 1)))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
calc-graph-xhigh (math-read-number (substring calc-graph-xval b2 e2))))
|
|
|
|
(if calc-graph-xlow
|
|
|
|
(while (and (cdr calc-graph-ycacheptr)
|
|
|
|
(Math-lessp (car (nth 1 calc-graph-ycacheptr)) calc-graph-xlow))
|
|
|
|
(setq calc-graph-ycacheptr (cdr calc-graph-ycacheptr)))))
|
|
|
|
(setq math-working-step-2 (1- (length calc-graph-ycacheptr)))
|
|
|
|
(while (and (cdr calc-graph-ycacheptr)
|
|
|
|
(or (not calc-graph-xhigh)
|
|
|
|
(Math-lessp (car (car calc-graph-ycacheptr)) calc-graph-xhigh)))
|
|
|
|
(setq var-DUMMY (math-div (math-add (car (car calc-graph-ycacheptr))
|
|
|
|
(car (nth 1 calc-graph-ycacheptr)))
|
2001-11-06 18:59:06 +00:00
|
|
|
2)
|
|
|
|
math-working-step (1+ math-working-step)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
calc-graph-yval (math-evaluate-expr calc-graph-yvalue))
|
|
|
|
(setcdr calc-graph-ycacheptr (cons (cons var-DUMMY calc-graph-yval)
|
|
|
|
(cdr calc-graph-ycacheptr)))
|
|
|
|
(setq calc-graph-ycacheptr (cdr (cdr calc-graph-ycacheptr))))
|
|
|
|
(setq calc-graph-yp calc-graph-ycache
|
|
|
|
calc-graph-numsteps 1000000))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-recompute-2d ()
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-ycacheptr calc-graph-ycache)
|
|
|
|
(if calc-graph-xvec
|
|
|
|
(setq calc-graph-numsteps (1- (length calc-graph-xvalue))
|
|
|
|
calc-graph-yvector nil)
|
|
|
|
(if (and (eq (car-safe calc-graph-xvalue) 'intv)
|
|
|
|
(math-constp calc-graph-xvalue))
|
|
|
|
(setq calc-graph-numsteps calc-graph-resolution
|
|
|
|
calc-graph-yp nil
|
|
|
|
calc-graph-xlow (nth 2 calc-graph-xvalue)
|
|
|
|
calc-graph-xhigh (nth 3 calc-graph-xvalue)
|
|
|
|
calc-graph-xstep (math-div (math-sub calc-graph-xhigh calc-graph-xlow)
|
|
|
|
(1- calc-graph-numsteps))
|
|
|
|
calc-graph-xvalue (nth 2 calc-graph-xvalue))
|
2001-11-06 18:59:06 +00:00
|
|
|
(error "%s is not a suitable basis for %s"
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
calc-graph-xname calc-graph-yname)))
|
|
|
|
(setq math-working-step-2 calc-graph-numsteps)
|
|
|
|
(while (>= (setq calc-graph-numsteps (1- calc-graph-numsteps)) 0)
|
2001-11-06 18:59:06 +00:00
|
|
|
(setq math-working-step (1+ math-working-step))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if calc-graph-xvec
|
2001-11-06 18:59:06 +00:00
|
|
|
(progn
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-xp (cdr calc-graph-xp)
|
|
|
|
calc-graph-xval (car calc-graph-xp))
|
|
|
|
(and (not (eq calc-graph-ycacheptr calc-graph-ycache))
|
|
|
|
(consp (car calc-graph-ycacheptr))
|
|
|
|
(not (Math-lessp (car (car calc-graph-ycacheptr)) calc-graph-xval))
|
|
|
|
(setq calc-graph-ycacheptr calc-graph-ycache)))
|
|
|
|
(if (= calc-graph-numsteps 0)
|
|
|
|
(setq calc-graph-xval calc-graph-xhigh) ; avoid cumulative roundoff
|
|
|
|
(setq calc-graph-xval calc-graph-xvalue
|
|
|
|
calc-graph-xvalue (math-add calc-graph-xvalue calc-graph-xstep))))
|
|
|
|
(while (and (cdr calc-graph-ycacheptr)
|
|
|
|
(Math-lessp (car (nth 1 calc-graph-ycacheptr)) calc-graph-xval))
|
|
|
|
(setq calc-graph-ycacheptr (cdr calc-graph-ycacheptr)))
|
|
|
|
(or (and (cdr calc-graph-ycacheptr)
|
|
|
|
(Math-equal (car (nth 1 calc-graph-ycacheptr)) calc-graph-xval))
|
2001-11-06 18:59:06 +00:00
|
|
|
(progn
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-keep-file nil
|
|
|
|
var-DUMMY calc-graph-xval)
|
|
|
|
(setcdr calc-graph-ycacheptr (cons (cons calc-graph-xval (math-evaluate-expr calc-graph-yvalue))
|
|
|
|
(cdr calc-graph-ycacheptr)))))
|
|
|
|
(setq calc-graph-ycacheptr (cdr calc-graph-ycacheptr))
|
|
|
|
(if calc-graph-xvec
|
|
|
|
(setq calc-graph-yvector (cons (cdr (car calc-graph-ycacheptr)) calc-graph-yvector))
|
|
|
|
(or calc-graph-yp (setq calc-graph-yp calc-graph-ycacheptr))))
|
|
|
|
(if calc-graph-xvec
|
|
|
|
(setq calc-graph-xp calc-graph-xvalue
|
|
|
|
calc-graph-yvec t
|
|
|
|
calc-graph-yp (cons 'vec (nreverse calc-graph-yvector))
|
|
|
|
calc-graph-numsteps (1- (length calc-graph-xp)))
|
|
|
|
(setq calc-graph-numsteps 1000000)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-compute-3d ()
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if (setq calc-graph-yvec (eq (car-safe calc-graph-yvalue) 'vec))
|
|
|
|
(if (math-matrixp calc-graph-yvalue)
|
2001-11-06 18:59:06 +00:00
|
|
|
(progn
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-numsteps (1- (length calc-graph-yvalue))
|
|
|
|
calc-graph-numsteps3 (1- (length (nth 1 calc-graph-yvalue))))
|
|
|
|
(if (eq (car-safe calc-graph-xvalue) 'vec)
|
|
|
|
(or (= (1- (length calc-graph-xvalue)) calc-graph-numsteps)
|
|
|
|
(error "%s has wrong length" calc-graph-xname))
|
|
|
|
(if (and (eq (car-safe calc-graph-xvalue) 'intv)
|
|
|
|
(math-constp calc-graph-xvalue))
|
|
|
|
(setq calc-graph-xvalue (calcFunc-index calc-graph-numsteps
|
|
|
|
(nth 2 calc-graph-xvalue)
|
2001-11-06 18:59:06 +00:00
|
|
|
(math-div
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(math-sub (nth 3 calc-graph-xvalue)
|
|
|
|
(nth 2 calc-graph-xvalue))
|
|
|
|
(1- calc-graph-numsteps))))
|
|
|
|
(if (math-realp calc-graph-xvalue)
|
|
|
|
(setq calc-graph-xvalue (calcFunc-index calc-graph-numsteps calc-graph-xvalue 1))
|
|
|
|
(error "%s is not a suitable basis for %s" calc-graph-xname calc-graph-yname))))
|
|
|
|
(if (eq (car-safe calc-graph-y3value) 'vec)
|
|
|
|
(or (= (1- (length calc-graph-y3value)) calc-graph-numsteps3)
|
|
|
|
(error "%s has wrong length" calc-graph-y3name))
|
|
|
|
(if (and (eq (car-safe calc-graph-y3value) 'intv)
|
|
|
|
(math-constp calc-graph-y3value))
|
|
|
|
(setq calc-graph-y3value (calcFunc-index calc-graph-numsteps3
|
|
|
|
(nth 2 calc-graph-y3value)
|
2001-11-06 18:59:06 +00:00
|
|
|
(math-div
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(math-sub (nth 3 calc-graph-y3value)
|
|
|
|
(nth 2 calc-graph-y3value))
|
|
|
|
(1- calc-graph-numsteps3))))
|
|
|
|
(if (math-realp calc-graph-y3value)
|
|
|
|
(setq calc-graph-y3value (calcFunc-index calc-graph-numsteps3 calc-graph-y3value 1))
|
|
|
|
(error "%s is not a suitable basis for %s" calc-graph-y3name calc-graph-yname))))
|
|
|
|
(setq calc-graph-xp nil
|
|
|
|
calc-graph-yp nil
|
|
|
|
calc-graph-zp nil
|
|
|
|
calc-graph-xvec t)
|
|
|
|
(while (setq calc-graph-xvalue (cdr calc-graph-xvalue) calc-graph-yvalue (cdr calc-graph-yvalue))
|
|
|
|
(setq calc-graph-xp (nconc calc-graph-xp (make-list (1+ calc-graph-numsteps3) (car calc-graph-xvalue)))
|
|
|
|
calc-graph-yp (nconc calc-graph-yp (cons 0 (copy-sequence (cdr calc-graph-y3value))))
|
|
|
|
calc-graph-zp (nconc calc-graph-zp (cons '(skip)
|
|
|
|
(copy-sequence (cdr (car calc-graph-yvalue)))))))
|
2009-09-19 21:22:45 +00:00
|
|
|
(setq calc-graph-numsteps (1- (* calc-graph-numsteps
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(1+ calc-graph-numsteps3)))))
|
|
|
|
(if (= (setq calc-graph-numsteps (1- (length calc-graph-yvalue))) 0)
|
2001-11-06 18:59:06 +00:00
|
|
|
(error "Can't plot an empty vector"))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(or (and (eq (car-safe calc-graph-xvalue) 'vec)
|
|
|
|
(= (1- (length calc-graph-xvalue)) calc-graph-numsteps))
|
|
|
|
(error "%s is not a suitable basis for %s" calc-graph-xname calc-graph-yname))
|
|
|
|
(or (and (eq (car-safe calc-graph-y3value) 'vec)
|
|
|
|
(= (1- (length calc-graph-y3value)) calc-graph-numsteps))
|
|
|
|
(error "%s is not a suitable basis for %s" calc-graph-y3name calc-graph-yname))
|
|
|
|
(setq calc-graph-xp calc-graph-xvalue
|
|
|
|
calc-graph-yp calc-graph-y3value
|
|
|
|
calc-graph-zp calc-graph-yvalue
|
|
|
|
calc-graph-xvec t))
|
|
|
|
(or (math-realp calc-graph-yvalue)
|
2011-01-20 21:48:26 -06:00
|
|
|
(let ((math-arglist nil))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-yvalue (math-evaluate-expr calc-graph-yvalue))
|
|
|
|
(calc-default-formula-arglist calc-graph-yvalue)
|
2011-01-20 21:48:26 -06:00
|
|
|
(setq math-arglist (sort math-arglist 'string-lessp))
|
|
|
|
(or (cdr math-arglist)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(error "%s does not contain enough unassigned variables" calc-graph-yname))
|
2011-01-20 21:48:26 -06:00
|
|
|
(and (cdr (cdr math-arglist))
|
|
|
|
(error "%s contains too many variables: %s" calc-graph-yname math-arglist))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-yvalue (math-multi-subst calc-graph-yvalue
|
2001-11-06 18:59:06 +00:00
|
|
|
(mapcar 'math-build-var-name
|
2011-01-20 21:48:26 -06:00
|
|
|
math-arglist)
|
2001-11-06 18:59:06 +00:00
|
|
|
'((var DUMMY var-DUMMY)
|
|
|
|
(var DUMMY2 var-DUMMY2))))))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if (setq calc-graph-xvec (eq (car-safe calc-graph-xvalue) 'vec))
|
|
|
|
(setq calc-graph-numsteps (1- (length calc-graph-xvalue)))
|
|
|
|
(if (and (eq (car-safe calc-graph-xvalue) 'intv)
|
|
|
|
(math-constp calc-graph-xvalue))
|
|
|
|
(setq calc-graph-numsteps calc-graph-resolution
|
|
|
|
calc-graph-xvalue (calcFunc-index calc-graph-numsteps
|
|
|
|
(nth 2 calc-graph-xvalue)
|
|
|
|
(math-div (math-sub (nth 3 calc-graph-xvalue)
|
|
|
|
(nth 2 calc-graph-xvalue))
|
|
|
|
(1- calc-graph-numsteps))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(error "%s is not a suitable basis for %s"
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
calc-graph-xname calc-graph-yname)))
|
|
|
|
(if (eq (car-safe calc-graph-y3value) 'vec)
|
|
|
|
(setq calc-graph-numsteps3 (1- (length calc-graph-y3value)))
|
|
|
|
(if (and (eq (car-safe calc-graph-y3value) 'intv)
|
|
|
|
(math-constp calc-graph-y3value))
|
|
|
|
(setq calc-graph-numsteps3 calc-graph-resolution
|
|
|
|
calc-graph-y3value (calcFunc-index calc-graph-numsteps3
|
|
|
|
(nth 2 calc-graph-y3value)
|
|
|
|
(math-div (math-sub (nth 3 calc-graph-y3value)
|
|
|
|
(nth 2 calc-graph-y3value))
|
|
|
|
(1- calc-graph-numsteps3))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(error "%s is not a suitable basis for %s"
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
calc-graph-y3name calc-graph-yname)))
|
|
|
|
(setq calc-graph-xp nil
|
|
|
|
calc-graph-yp nil
|
|
|
|
calc-graph-zp nil
|
|
|
|
calc-graph-xvec t)
|
2001-11-06 18:59:06 +00:00
|
|
|
(setq math-working-step 0)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(while (setq calc-graph-xvalue (cdr calc-graph-xvalue))
|
|
|
|
(setq calc-graph-xp (nconc calc-graph-xp (make-list (1+ calc-graph-numsteps3) (car calc-graph-xvalue)))
|
|
|
|
calc-graph-yp (nconc calc-graph-yp (cons 0 (copy-sequence (cdr calc-graph-y3value))))
|
|
|
|
calc-graph-zp (cons '(skip) calc-graph-zp)
|
|
|
|
calc-graph-y3step calc-graph-y3value
|
|
|
|
var-DUMMY (car calc-graph-xvalue)
|
2001-11-06 18:59:06 +00:00
|
|
|
math-working-step-2 0
|
|
|
|
math-working-step (1+ math-working-step))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(while (setq calc-graph-y3step (cdr calc-graph-y3step))
|
2001-11-06 18:59:06 +00:00
|
|
|
(setq math-working-step-2 (1+ math-working-step-2)
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
var-DUMMY2 (car calc-graph-y3step)
|
|
|
|
calc-graph-zp (cons (math-evaluate-expr calc-graph-yvalue) calc-graph-zp))))
|
|
|
|
(setq calc-graph-zp (nreverse calc-graph-zp)
|
|
|
|
calc-graph-numsteps (1- (* calc-graph-numsteps (1+ calc-graph-numsteps3))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-format-data ()
|
2007-08-03 05:25:03 +00:00
|
|
|
(if (math-contains-sdev-p calc-graph-yp)
|
|
|
|
(let ((yp calc-graph-yp))
|
|
|
|
(setq calc-graph-yp (cons 'vec (mapcar 'math-get-value (cdr yp))))
|
|
|
|
(setq calc-graph-zp (cons 'vec (mapcar 'math-get-sdev (cdr yp))))))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(while (<= (setq calc-graph-stepcount (1+ calc-graph-stepcount)) calc-graph-numsteps)
|
|
|
|
(if calc-graph-xvec
|
|
|
|
(setq calc-graph-xp (cdr calc-graph-xp)
|
|
|
|
calc-graph-xval (car calc-graph-xp)
|
|
|
|
calc-graph-yp (cdr calc-graph-yp)
|
|
|
|
calc-graph-yval (car calc-graph-yp)
|
|
|
|
calc-graph-zp (cdr calc-graph-zp)
|
|
|
|
calc-graph-zval (car calc-graph-zp))
|
|
|
|
(if calc-graph-yvec
|
|
|
|
(setq calc-graph-xval calc-graph-xvalue
|
|
|
|
calc-graph-xvalue (math-add calc-graph-xvalue calc-graph-xstep)
|
|
|
|
calc-graph-yp (cdr calc-graph-yp)
|
|
|
|
calc-graph-yval (car calc-graph-yp))
|
|
|
|
(setq calc-graph-xval (car (car calc-graph-yp))
|
|
|
|
calc-graph-yval (cdr (car calc-graph-yp))
|
|
|
|
calc-graph-yp (cdr calc-graph-yp))
|
|
|
|
(if (or (not calc-graph-yp)
|
|
|
|
(and calc-graph-xhigh (equal calc-graph-xval calc-graph-xhigh)))
|
|
|
|
(setq calc-graph-numsteps 0))))
|
|
|
|
(if calc-graph-is-splot
|
|
|
|
(if (and (eq (car-safe calc-graph-zval) 'calcFunc-xyz)
|
|
|
|
(= (length calc-graph-zval) 4))
|
|
|
|
(setq calc-graph-xval (nth 1 calc-graph-zval)
|
|
|
|
calc-graph-yval (nth 2 calc-graph-zval)
|
|
|
|
calc-graph-zval (nth 3 calc-graph-zval)))
|
|
|
|
(if (and (eq (car-safe calc-graph-yval) 'calcFunc-xyz)
|
|
|
|
(= (length calc-graph-yval) 4))
|
2001-11-06 18:59:06 +00:00
|
|
|
(progn
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(or calc-graph-surprise-splot
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer (get-buffer-create "*Gnuplot Temp*")
|
2001-11-06 18:59:06 +00:00
|
|
|
(save-excursion
|
|
|
|
(goto-char (point-max))
|
|
|
|
(re-search-backward "^plot[ \t]")
|
|
|
|
(insert "set parametric\ns")
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-surprise-splot t))))
|
|
|
|
(setq calc-graph-xval (nth 1 calc-graph-yval)
|
|
|
|
calc-graph-zval (nth 3 calc-graph-yval)
|
|
|
|
calc-graph-yval (nth 2 calc-graph-yval)))
|
|
|
|
(if (and (eq (car-safe calc-graph-yval) 'calcFunc-xy)
|
|
|
|
(= (length calc-graph-yval) 3))
|
|
|
|
(setq calc-graph-xval (nth 1 calc-graph-yval)
|
|
|
|
calc-graph-yval (nth 2 calc-graph-yval)))))
|
|
|
|
(if (and (Math-realp calc-graph-xval)
|
|
|
|
(Math-realp calc-graph-yval)
|
|
|
|
(or (not calc-graph-zval) (Math-realp calc-graph-zval)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(progn
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-blank nil
|
|
|
|
calc-graph-non-blank t)
|
|
|
|
(if (Math-integerp calc-graph-xval)
|
|
|
|
(insert (math-format-number calc-graph-xval))
|
|
|
|
(if (eq (car calc-graph-xval) 'frac)
|
|
|
|
(setq calc-graph-xval (math-float calc-graph-xval)))
|
|
|
|
(insert (math-format-number (nth 1 calc-graph-xval))
|
|
|
|
"e" (int-to-string (nth 2 calc-graph-xval))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(insert " ")
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if (Math-integerp calc-graph-yval)
|
|
|
|
(insert (math-format-number calc-graph-yval))
|
|
|
|
(if (eq (car calc-graph-yval) 'frac)
|
|
|
|
(setq calc-graph-yval (math-float calc-graph-yval)))
|
|
|
|
(insert (math-format-number (nth 1 calc-graph-yval))
|
|
|
|
"e" (int-to-string (nth 2 calc-graph-yval))))
|
|
|
|
(if calc-graph-zval
|
2001-11-06 18:59:06 +00:00
|
|
|
(progn
|
|
|
|
(insert " ")
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(if (Math-integerp calc-graph-zval)
|
|
|
|
(insert (math-format-number calc-graph-zval))
|
|
|
|
(if (eq (car calc-graph-zval) 'frac)
|
|
|
|
(setq calc-graph-zval (math-float calc-graph-zval)))
|
|
|
|
(insert (math-format-number (nth 1 calc-graph-zval))
|
|
|
|
"e" (int-to-string (nth 2 calc-graph-zval))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(insert "\n"))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(and (not (equal calc-graph-zval '(skip)))
|
2005-05-19 12:50:15 +00:00
|
|
|
(boundp 'var-PlotRejects)
|
2001-11-06 18:59:06 +00:00
|
|
|
(eq (car-safe var-PlotRejects) 'vec)
|
|
|
|
(nconc var-PlotRejects
|
|
|
|
(list (list 'vec
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
calc-graph-curve-num
|
|
|
|
calc-graph-stepcount
|
|
|
|
calc-graph-xval calc-graph-yval)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-refresh-evaltos 'var-PlotRejects))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(or calc-graph-blank
|
2001-11-06 18:59:06 +00:00
|
|
|
(progn
|
|
|
|
(insert "\n")
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(setq calc-graph-blank t))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-temp-file-name (num)
|
|
|
|
(while (<= (length calc-graph-file-cache) (1+ num))
|
|
|
|
(setq calc-graph-file-cache (nconc calc-graph-file-cache (list nil))))
|
|
|
|
(car (or (nth (1+ num) calc-graph-file-cache)
|
|
|
|
(setcar (nthcdr (1+ num) calc-graph-file-cache)
|
2002-03-01 01:18:37 +00:00
|
|
|
(list (make-temp-file
|
2001-11-06 18:59:06 +00:00
|
|
|
(concat calc-gnuplot-tempfile
|
|
|
|
(if (<= num 0)
|
|
|
|
(char-to-string (- ?A num))
|
|
|
|
(int-to-string num))))
|
2001-11-14 09:09:09 +00:00
|
|
|
nil)))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-delete-temps ()
|
|
|
|
(while calc-graph-file-cache
|
|
|
|
(and (car calc-graph-file-cache)
|
|
|
|
(file-exists-p (car (car calc-graph-file-cache)))
|
2020-10-10 16:00:51 -04:00
|
|
|
(ignore-errors
|
|
|
|
(delete-file (car (car calc-graph-file-cache)))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(setq calc-graph-file-cache (cdr calc-graph-file-cache))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-kill-hook ()
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(calc-graph-delete-temps))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-show-tty (output)
|
2020-10-10 16:00:51 -04:00
|
|
|
"Default `calc-gnuplot-plot-command' for \"tty\" output mode.
|
2001-11-06 18:59:06 +00:00
|
|
|
This is useful for tek40xx and other graphics-terminal types."
|
2016-08-23 22:38:48 +09:00
|
|
|
(call-process shell-file-name nil calc-gnuplot-buffer nil
|
|
|
|
shell-command-switch
|
|
|
|
(format "cat %s >/dev/tty; rm %s" output output)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(defvar calc-dumb-map nil
|
|
|
|
"The keymap for the \"dumb\" terminal plot.")
|
|
|
|
|
2020-10-10 16:00:51 -04:00
|
|
|
(defun calc-graph-show-dumb (&optional _output)
|
2001-11-06 18:59:06 +00:00
|
|
|
"Default calc-gnuplot-plot-command for Pinard's \"dumb\" terminal type.
|
|
|
|
This \"dumb\" driver will be present in Gnuplot 3.0."
|
|
|
|
(interactive)
|
|
|
|
(save-window-excursion
|
|
|
|
(switch-to-buffer calc-gnuplot-buffer)
|
|
|
|
(delete-other-windows)
|
|
|
|
(goto-char calc-gnuplot-trail-mark)
|
|
|
|
(or (search-forward "\f" nil t)
|
|
|
|
(sleep-for 1))
|
|
|
|
(goto-char (point-max))
|
|
|
|
(re-search-backward "\f\\|^[ \t]+\\^$\\|G N U P L O T")
|
|
|
|
(if (looking-at "\f")
|
|
|
|
(progn
|
|
|
|
(forward-char 1)
|
|
|
|
(if (eolp) (forward-line 1))
|
|
|
|
(or (calc-graph-find-command "time")
|
|
|
|
(calc-graph-find-command "title")
|
|
|
|
(calc-graph-find-command "ylabel")
|
|
|
|
(let ((pt (point)))
|
|
|
|
(insert-before-markers (format "(%s)" (current-time-string)))
|
|
|
|
(goto-char pt)))
|
|
|
|
(set-window-start (selected-window) (point))
|
|
|
|
(goto-char (point-max)))
|
|
|
|
(end-of-line)
|
|
|
|
(backward-char 1)
|
|
|
|
(recenter '(4)))
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
(or calc-dumb-map
|
2001-11-06 18:59:06 +00:00
|
|
|
(progn
|
|
|
|
(setq calc-dumb-map (make-sparse-keymap))
|
2011-10-01 16:32:01 -04:00
|
|
|
(define-key calc-dumb-map "\n" 'scroll-up-command)
|
|
|
|
(define-key calc-dumb-map " " 'scroll-up-command)
|
2013-02-21 05:27:05 +01:00
|
|
|
(define-key calc-dumb-map [?\S-\ ] 'scroll-down-command)
|
2011-10-01 16:32:01 -04:00
|
|
|
(define-key calc-dumb-map "\177" 'scroll-down-command)
|
2001-11-06 18:59:06 +00:00
|
|
|
(define-key calc-dumb-map "<" 'scroll-left)
|
|
|
|
(define-key calc-dumb-map ">" 'scroll-right)
|
2011-10-01 16:32:01 -04:00
|
|
|
(define-key calc-dumb-map "{" 'scroll-down-command)
|
|
|
|
(define-key calc-dumb-map "}" 'scroll-up-command)
|
2001-11-06 18:59:06 +00:00
|
|
|
(define-key calc-dumb-map "q" 'exit-recursive-edit)
|
|
|
|
(define-key calc-dumb-map "\C-c\C-c" 'exit-recursive-edit)))
|
|
|
|
(use-local-map calc-dumb-map)
|
|
|
|
(setq truncate-lines t)
|
2021-11-22 11:45:44 +01:00
|
|
|
(message (substitute-command-keys
|
|
|
|
"Type \\`q' or \\`C-c C-c' to return to Calc"))
|
2001-11-06 18:59:06 +00:00
|
|
|
(recursive-edit)
|
2001-11-14 09:09:09 +00:00
|
|
|
(bury-buffer "*Gnuplot Trail*")))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-clear ()
|
|
|
|
(interactive)
|
|
|
|
(if calc-graph-last-device
|
|
|
|
(if (or (equal calc-graph-last-device "x11")
|
|
|
|
(equal calc-graph-last-device "X11"))
|
|
|
|
(calc-gnuplot-command "set output"
|
|
|
|
(if (equal calc-graph-last-output "STDOUT")
|
|
|
|
""
|
|
|
|
(prin1-to-string calc-graph-last-output)))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-gnuplot-command "clear"))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-title-x (title)
|
|
|
|
(interactive "sX axis title: ")
|
|
|
|
(calc-graph-set-command "xlabel" (if (not (equal title ""))
|
2001-11-14 09:09:09 +00:00
|
|
|
(prin1-to-string title))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-title-y (title)
|
|
|
|
(interactive "sY axis title: ")
|
|
|
|
(calc-graph-set-command "ylabel" (if (not (equal title ""))
|
2001-11-14 09:09:09 +00:00
|
|
|
(prin1-to-string title))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-title-z (title)
|
|
|
|
(interactive "sZ axis title: ")
|
|
|
|
(calc-graph-set-command "zlabel" (if (not (equal title ""))
|
2001-11-14 09:09:09 +00:00
|
|
|
(prin1-to-string title))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-range-x (range)
|
|
|
|
(interactive "sX axis range: ")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-set-range "xrange" range))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-range-y (range)
|
|
|
|
(interactive "sY axis range: ")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-set-range "yrange" range))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-range-z (range)
|
|
|
|
(interactive "sZ axis range: ")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-set-range "zrange" range))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-set-range (cmd range)
|
|
|
|
(if (equal range "$")
|
|
|
|
(calc-wrapper
|
|
|
|
(let ((val (calc-top-n 1)))
|
|
|
|
(if (and (eq (car-safe val) 'intv) (math-constp val))
|
|
|
|
(setq range (concat
|
|
|
|
(math-format-number (math-float (nth 2 val))) ":"
|
|
|
|
(math-format-number (math-float (nth 3 val)))))
|
|
|
|
(if (and (eq (car-safe val) 'vec)
|
|
|
|
(= (length val) 3))
|
|
|
|
(setq range (concat
|
|
|
|
(math-format-number (math-float (nth 1 val))) ":"
|
|
|
|
(math-format-number (math-float (nth 2 val)))))
|
|
|
|
(error "Range specification must be an interval or 2-vector")))
|
|
|
|
(calc-pop-stack 1))))
|
|
|
|
(if (string-match "\\[.+\\]" range)
|
|
|
|
(setq range (substring range 1 -1)))
|
Use string-search instead of string-match[-p]
`string-search` is easier to understand, less error-prone, much
faster, does not pollute the regexp cache, and does not mutate global
state. Use it where applicable and obviously safe (erring on the
conservative side).
* admin/authors.el (authors-canonical-file-name)
(authors-scan-change-log):
* lisp/apropos.el (apropos-command)
(apropos-documentation-property, apropos-symbols-internal):
* lisp/arc-mode.el (archive-arc-summarize)
(archive-zoo-summarize):
* lisp/calc/calc-aent.el (math-read-factor):
* lisp/calc/calc-ext.el (math-read-big-expr)
(math-format-nice-expr, math-format-number-fancy):
* lisp/calc/calc-forms.el (math-read-angle-brackets):
* lisp/calc/calc-graph.el (calc-graph-set-range):
* lisp/calc/calc-keypd.el (calc-keypad-press):
* lisp/calc/calc-lang.el (tex, latex, math-read-big-rec):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-user-define-permanent, math-define-exp):
* lisp/calc/calc.el (calc-record, calcDigit-key)
(calc-count-lines):
* lisp/calc/calcalg2.el (calc-solve-for, calc-poly-roots)
(math-do-integral):
* lisp/calc/calcalg3.el (calc-find-root, calc-find-minimum)
(calc-get-fit-variables):
* lisp/cedet/ede/speedbar.el (ede-tag-expand):
* lisp/cedet/semantic/java.el (semantic-java-expand-tag):
* lisp/cedet/semantic/sb.el (semantic-sb-show-extra)
(semantic-sb-expand-group):
* lisp/cedet/semantic/wisent/python.el
(semantic-python-instance-variable-p):
* lisp/cus-edit.el (get):
* lisp/descr-text.el (describe-text-sexp):
* lisp/dired-aux.el (dired-compress-file):
* lisp/dired-x.el (dired-make-relative-symlink):
* lisp/dired.el (dired-glob-regexp):
* lisp/dos-fns.el (dos-convert-standard-filename, dos-8+3-filename):
* lisp/edmacro.el (edmacro-format-keys):
* lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand):
* lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand):
* lisp/emacs-lisp/lisp-mnt.el (lm-keywords-list):
* lisp/emacs-lisp/warnings.el (display-warning):
* lisp/emulation/viper-ex.el (viper-ex-read-file-name)
(ex-print-display-lines):
* lisp/env.el (read-envvar-name, setenv):
* lisp/epa-mail.el (epa-mail-encrypt):
* lisp/epg.el (epg--start):
* lisp/erc/erc-backend.el (erc-parse-server-response):
* lisp/erc/erc-dcc.el (erc-dcc-member):
* lisp/erc/erc-speedbar.el (erc-speedbar-expand-server)
(erc-speedbar-expand-channel, erc-speedbar-expand-user):
* lisp/erc/erc.el (erc-send-input):
* lisp/eshell/em-glob.el (eshell-glob-entries):
* lisp/eshell/esh-proc.el (eshell-needs-pipe-p):
* lisp/eshell/esh-util.el (eshell-convert):
* lisp/eshell/esh-var.el (eshell-envvar-names):
* lisp/faces.el (x-resolve-font-name):
* lisp/ffap.el (ffap-file-at-point):
* lisp/files.el (wildcard-to-regexp, shell-quote-wildcard-pattern):
* lisp/forms.el (forms--update):
* lisp/frameset.el (frameset-filter-unshelve-param):
* lisp/gnus/gnus-art.el (article-decode-charset):
* lisp/gnus/gnus-kill.el (gnus-kill-parse-rn-kill-file):
* lisp/gnus/gnus-mlspl.el (gnus-group-split-fancy):
* lisp/gnus/gnus-msg.el (gnus-summary-resend-message-insert-gcc)
(gnus-inews-insert-gcc):
* lisp/gnus/gnus-rfc1843.el (rfc1843-decode-article-body):
* lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output)
(gnus-search--complete-key-data):
* lisp/gnus/gnus-spec.el (gnus-parse-simple-format):
* lisp/gnus/gnus-sum.el (gnus-summary-refer-article):
* lisp/gnus/gnus-util.el (gnus-extract-address-components)
(gnus-newsgroup-directory-form):
* lisp/gnus/gnus-uu.el (gnus-uu-grab-view):
* lisp/gnus/gnus.el (gnus-group-native-p, gnus-short-group-name):
* lisp/gnus/message.el (message-check-news-header-syntax)
(message-make-message-id, message-user-mail-address)
(message-make-fqdn, message-get-reply-headers, message-followup):
* lisp/gnus/mm-decode.el (mm-dissect-buffer):
* lisp/gnus/nnheader.el (nnheader-insert):
* lisp/gnus/nnimap.el (nnimap-process-quirk)
(nnimap-imap-ranges-to-gnus-ranges):
* lisp/gnus/nnmaildir.el (nnmaildir--ensure-suffix):
* lisp/gnus/nnmairix.el (nnmairix-determine-original-group-from-path):
* lisp/gnus/nnrss.el (nnrss-match-macro):
* lisp/gnus/nntp.el (nntp-find-group-and-number):
* lisp/help-fns.el (help--symbol-completion-table-affixation):
* lisp/help.el (help-function-arglist):
* lisp/hippie-exp.el (he-concat-directory-file-name):
* lisp/htmlfontify.el (hfy-relstub):
* lisp/ido.el (ido-make-prompt, ido-complete, ido-copy-current-word)
(ido-exhibit):
* lisp/image/image-converter.el (image-convert-p):
* lisp/info-xref.el (info-xref-docstrings):
* lisp/info.el (Info-toc-build, Info-follow-reference)
(Info-backward-node, Info-finder-find-node)
(Info-speedbar-expand-node):
* lisp/international/mule-diag.el (print-fontset-element):
* lisp/language/korea-util.el (default-korean-keyboard):
* lisp/linum.el (linum-after-change):
* lisp/mail/ietf-drums.el (ietf-drums-parse-address):
* lisp/mail/mail-utils.el (mail-dont-reply-to):
* lisp/mail/rfc2047.el (rfc2047-encode-1, rfc2047-decode-string):
* lisp/mail/rfc2231.el (rfc2231-parse-string):
* lisp/mail/rmailkwd.el (rmail-set-label):
* lisp/mail/rmailsum.el (rmail-header-summary):
* lisp/mail/smtpmail.el (smtpmail-maybe-append-domain)
(smtpmail-user-mail-address):
* lisp/mail/uce.el (uce-reply-to-uce):
* lisp/man.el (Man-default-man-entry):
* lisp/mh-e/mh-alias.el (mh-alias-gecos-name)
(mh-alias-minibuffer-confirm-address):
* lisp/mh-e/mh-comp.el (mh-forwarded-letter-subject):
* lisp/mh-e/mh-speed.el (mh-speed-parse-flists-output):
* lisp/mh-e/mh-utils.el (mh-collect-folder-names-filter)
(mh-folder-completion-function):
* lisp/minibuffer.el (completion--make-envvar-table)
(completion-file-name-table, completion-flex-try-completion)
(completion-flex-all-completions):
* lisp/mpc.el (mpc--proc-quote-string, mpc-cmd-special-tag-p)
(mpc-constraints-tag-lookup):
* lisp/net/ange-ftp.el (ange-ftp-send-cmd)
(ange-ftp-allow-child-lookup):
* lisp/net/mailcap.el (mailcap-mime-types):
* lisp/net/mairix.el (mairix-search-thread-this-article):
* lisp/net/pop3.el (pop3-open-server):
* lisp/net/soap-client.el (soap-decode-xs-complex-type):
* lisp/net/socks.el (socks-filter):
* lisp/nxml/nxml-outln.el (nxml-highlighted-qname):
* lisp/nxml/rng-cmpct.el (rng-c-expand-name, rng-c-expand-datatype):
* lisp/nxml/rng-uri.el (rng-uri-file-name-1):
* lisp/obsolete/complete.el (partial-completion-mode)
(PC-do-completion):
* lisp/obsolete/longlines.el (longlines-encode-string):
* lisp/obsolete/nnir.el (nnir-compose-result):
* lisp/obsolete/terminal.el (te-quote-arg-for-sh):
* lisp/obsolete/tpu-edt.el (tpu-check-search-case):
* lisp/obsolete/url-ns.el (isPlainHostName):
* lisp/pcmpl-unix.el (pcomplete/scp):
* lisp/play/dunnet.el (dun-listify-string2, dun-get-path)
(dun-unix-parse, dun-doassign, dun-cat, dun-batch-unix-interface):
* lisp/progmodes/ebnf2ps.el: (ebnf-eps-header-footer-comment):
* lisp/progmodes/gdb-mi.el (gdb-var-delete)
(gdb-speedbar-expand-node, gdbmi-bnf-incomplete-record-result):
* lisp/progmodes/gud.el (gud-find-expr):
* lisp/progmodes/idlw-help.el (idlwave-do-context-help1):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode)
(idlwave-shell-filter-hidden-output, idlwave-shell-filter):
* lisp/progmodes/idlwave.el (idlwave-skip-label-or-case)
(idlwave-routine-info):
* lisp/progmodes/octave.el (inferior-octave-completion-at-point):
* lisp/progmodes/sh-script.el (sh-add-completer):
* lisp/progmodes/sql.el (defun):
* lisp/progmodes/xscheme.el (xscheme-process-filter):
* lisp/replace.el (query-replace-compile-replacement)
(map-query-replace-regexp):
* lisp/shell.el (shell--command-completion-data)
(shell-environment-variable-completion):
* lisp/simple.el (display-message-or-buffer):
* lisp/speedbar.el (speedbar-dired, speedbar-tag-file)
(speedbar-tag-expand):
* lisp/subr.el (split-string-and-unquote):
* lisp/tar-mode.el (tar-extract):
* lisp/term.el (term-command-hook, serial-read-name):
* lisp/textmodes/bibtex.el (bibtex-print-help-message):
* lisp/textmodes/ispell.el (ispell-lookup-words, ispell-filter)
(ispell-parse-output, ispell-buffer-local-parsing):
* lisp/textmodes/reftex-cite.el (reftex-do-citation):
* lisp/textmodes/reftex-parse.el (reftex-notice-new):
* lisp/textmodes/reftex-ref.el (reftex-show-entry):
* lisp/textmodes/reftex.el (reftex-compile-variables):
* lisp/textmodes/tex-mode.el (tex-send-command)
(tex-start-tex, tex-append):
* lisp/thingatpt.el (thing-at-point-url-at-point):
* lisp/tmm.el (tmm-add-one-shortcut):
* lisp/transient.el (transient-format-key):
* lisp/url/url-auth.el (url-basic-auth)
(url-digest-auth-directory-id-assoc):
* lisp/url/url-news.el (url-news):
* lisp/url/url-util.el (url-parse-query-string):
* lisp/vc/vc-cvs.el (vc-cvs-parse-entry):
* lisp/wid-browse.el (widget-browse-sexp):
* lisp/woman.el (woman-parse-colon-path, woman-mini-help)
(WoMan-getpage-in-background, woman-negative-vertical-space):
* lisp/xml.el:
* test/lisp/emacs-lisp/check-declare-tests.el
(check-declare-tests-warn):
* test/lisp/files-tests.el
(files-tests-file-name-non-special-dired-compress-handler):
* test/lisp/net/network-stream-tests.el (server-process-filter):
* test/src/coding-tests.el (ert-test-unibyte-buffer-dos-eol-decode):
Use `string-search` instead of `string-match` and `string-match-p`.
2021-08-09 11:20:00 +02:00
|
|
|
(if (and (not (string-search ":" range))
|
2001-11-06 18:59:06 +00:00
|
|
|
(or (string-match "," range)
|
|
|
|
(string-match " " range)))
|
|
|
|
(aset range (match-beginning 0) ?\:))
|
|
|
|
(calc-graph-set-command cmd (if (not (equal range ""))
|
2001-11-14 09:09:09 +00:00
|
|
|
(concat "[" range "]"))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-log-x (flag)
|
|
|
|
(interactive "P")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-set-log flag 0 0))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-log-y (flag)
|
|
|
|
(interactive "P")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-set-log 0 flag 0))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-log-z (flag)
|
|
|
|
(interactive "P")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-set-log 0 0 flag))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-set-log (xflag yflag zflag)
|
|
|
|
(let* ((old (or (calc-graph-find-command "logscale") ""))
|
|
|
|
(xold (string-match "x" old))
|
|
|
|
(yold (string-match "y" old))
|
|
|
|
(zold (string-match "z" old))
|
|
|
|
str)
|
|
|
|
(setq str (concat (if (if xflag
|
|
|
|
(if (eq xflag 0) xold
|
|
|
|
(> (prefix-numeric-value xflag) 0))
|
|
|
|
(not xold)) "x" "")
|
|
|
|
(if (if yflag
|
|
|
|
(if (eq yflag 0) yold
|
|
|
|
(> (prefix-numeric-value yflag) 0))
|
|
|
|
(not yold)) "y" "")
|
|
|
|
(if (if zflag
|
|
|
|
(if (eq zflag 0) zold
|
|
|
|
(> (prefix-numeric-value zflag) 0))
|
|
|
|
(not zold)) "z" "")))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-set-command "logscale" (if (not (equal str "")) str))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-line-style (style)
|
|
|
|
(interactive "P")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-set-styles (and style (prefix-numeric-value style)) t))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-point-style (style)
|
|
|
|
(interactive "P")
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-set-styles t (and style (prefix-numeric-value style))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2007-08-03 05:25:03 +00:00
|
|
|
(defun calc-graph-set-styles (lines points &optional yerr)
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-graph-init)
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-input
|
2001-11-06 18:59:06 +00:00
|
|
|
(or (calc-graph-find-plot nil nil)
|
|
|
|
(error "No data points have been set!"))
|
|
|
|
(let ((base (point))
|
|
|
|
(mode nil) (lstyle nil) (pstyle nil)
|
2007-08-03 05:25:03 +00:00
|
|
|
start end lenbl penbl errform)
|
2001-11-06 18:59:06 +00:00
|
|
|
(re-search-forward "[,\n]")
|
|
|
|
(forward-char -1)
|
|
|
|
(setq end (point) start end)
|
|
|
|
(goto-char base)
|
|
|
|
(if (looking-at "[^,\n]*[^,\n \t]\\([ \t]+with\\)")
|
|
|
|
(progn
|
|
|
|
(setq start (match-beginning 1))
|
|
|
|
(goto-char (match-end 0))
|
|
|
|
(if (looking-at "[ \t]+\\([a-z]+\\)")
|
|
|
|
(setq mode (buffer-substring (match-beginning 1)
|
|
|
|
(match-end 1))))
|
|
|
|
(if (looking-at "[ \ta-z]+\\([0-9]+\\)")
|
2005-05-02 19:44:07 +00:00
|
|
|
(setq lstyle (string-to-number
|
2001-11-06 18:59:06 +00:00
|
|
|
(buffer-substring (match-beginning 1)
|
|
|
|
(match-end 1)))))
|
|
|
|
(if (looking-at "[ \ta-z]+[0-9]+[ \t]+\\([0-9]+\\)")
|
2005-05-02 19:44:07 +00:00
|
|
|
(setq pstyle (string-to-number
|
2001-11-06 18:59:06 +00:00
|
|
|
(buffer-substring (match-beginning 1)
|
|
|
|
(match-end 1)))))))
|
2007-08-03 05:25:03 +00:00
|
|
|
(unless yerr
|
2009-09-19 21:22:45 +00:00
|
|
|
(setq lenbl (or (equal mode "lines")
|
2007-08-03 05:25:03 +00:00
|
|
|
(equal mode "linespoints"))
|
2009-09-19 21:22:45 +00:00
|
|
|
penbl (or (equal mode "points")
|
2007-08-03 05:25:03 +00:00
|
|
|
(equal mode "linespoints")))
|
|
|
|
(if lines
|
|
|
|
(or (eq lines t)
|
|
|
|
(setq lstyle lines
|
|
|
|
lenbl (>= lines 0)))
|
|
|
|
(setq lenbl (not lenbl)))
|
|
|
|
(if points
|
|
|
|
(or (eq points t)
|
|
|
|
(setq pstyle points
|
|
|
|
penbl (>= points 0)))
|
|
|
|
(setq penbl (not penbl))))
|
|
|
|
(delete-region start end)
|
2001-11-06 18:59:06 +00:00
|
|
|
(goto-char start)
|
2007-08-03 05:25:03 +00:00
|
|
|
(setq errform
|
2020-10-10 16:00:51 -04:00
|
|
|
(ignore-errors
|
|
|
|
(math-contains-sdev-p
|
|
|
|
(symbol-value
|
|
|
|
(intern
|
|
|
|
(concat "var-"
|
|
|
|
(save-excursion
|
|
|
|
(re-search-backward ":\\(.*\\)}")
|
|
|
|
(match-string 1))))))))
|
2007-08-03 05:25:03 +00:00
|
|
|
(if yerr
|
|
|
|
(insert " with yerrorbars")
|
|
|
|
(insert " with "
|
|
|
|
(if (and errform
|
|
|
|
(equal mode "dots")
|
|
|
|
(eq lines t))
|
|
|
|
"yerrorbars"
|
|
|
|
(if lenbl
|
|
|
|
(if penbl "linespoints" "lines")
|
|
|
|
(if penbl "points" "dots"))))
|
|
|
|
(if (and pstyle (> pstyle 0))
|
2021-01-27 04:27:42 +01:00
|
|
|
(insert " ls "
|
2007-08-03 05:25:03 +00:00
|
|
|
(if (and lstyle (> lstyle 0)) (int-to-string lstyle) "1")
|
2021-01-27 04:27:42 +01:00
|
|
|
" ps " (int-to-string pstyle))
|
2007-08-03 05:25:03 +00:00
|
|
|
(if (and lstyle (> lstyle 0))
|
2021-01-27 04:27:42 +01:00
|
|
|
(insert " ls " (int-to-string lstyle)))))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-view-commands))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-zero-x (flag)
|
|
|
|
(interactive "P")
|
|
|
|
(calc-graph-set-command "noxzeroaxis"
|
|
|
|
(and (if flag
|
|
|
|
(<= (prefix-numeric-value flag) 0)
|
|
|
|
(not (calc-graph-find-command "noxzeroaxis")))
|
2001-11-14 09:09:09 +00:00
|
|
|
" ")))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-zero-y (flag)
|
|
|
|
(interactive "P")
|
|
|
|
(calc-graph-set-command "noyzeroaxis"
|
|
|
|
(and (if flag
|
|
|
|
(<= (prefix-numeric-value flag) 0)
|
|
|
|
(not (calc-graph-find-command "noyzeroaxis")))
|
2001-11-14 09:09:09 +00:00
|
|
|
" ")))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-name (name)
|
|
|
|
(interactive "sTitle for current curve: ")
|
|
|
|
(calc-graph-init)
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-input
|
2001-11-06 18:59:06 +00:00
|
|
|
(or (calc-graph-find-plot nil nil)
|
|
|
|
(error "No data points have been set!"))
|
|
|
|
(let ((base (point))
|
2020-10-10 16:00:51 -04:00
|
|
|
;; start
|
(calc-dumb-map): Declared it.
(calc-graph-show-dumb): Check if calc-dumb-map is non-nil rather than
unbound.
(calc-graph-name): Made `end' a local variable.
(calc-graph-lookup): Made `varname' a local variable.
(var-DUMMY, var-DUMMY2, var-PlotRejects, calc-gnuplot-trail-mark):
Declared them.
(calc-graph-format-data): Don't check if var-PlotRejects is bound.
(calc-graph-plot, calc-graph-compute-3d): Removed references to the
unused variable y3vec.
(calc-graph-show-dumb): Removed reference to unused variable found-pt.
(calc-graph-kill-hook, calc-graph-plot): Removed reference to
calc-graph-prev-kill-hook.
(calc-graph-yvalue, calc-graph-yvec, calc-graph-numsteps,
calc-graph-numsteps3, calc-graph-xvalue, calc-graph-xvec,
calc-graph-xname, calc-graph-yname, calc-graph-xstep,
calc-graph-ycache, calc-graph-ycacheptr, calc-graph-refine,
calc-graph-keep-file, calc-graph-xval, calc-graph-xlow,
calc-graph-xhigh, calc-graph-yval, calc-graph-yp, calc-graph-xp,
calc-graph-zp, calc-graph-yvector, calc-graph-resolution,
calc-graph-y3value, calc-graph-y3name,
calc-graph-y3step, calc-graph-y3step, calc-graph-zval,
calc-graph-stepcount, calc-graph-is-splot, calc-graph-surprise-splot,
calc-graph-blank, calc-graph-non-blank, calc-graph-curve-num): New
variables.
(calc-graph-plot, calc-graph-compute-2d, calc-graph-refine-2d)
(calc-graph-recompute-2d, calc-graph-compute-3d, calc-graph-format-data):
Replaced undeclared variables with the above declared variables.
2004-11-12 22:35:21 +00:00
|
|
|
end)
|
2001-11-06 18:59:06 +00:00
|
|
|
(re-search-forward "[,\n]\\|[ \t]+with")
|
|
|
|
(setq end (match-beginning 0))
|
|
|
|
(goto-char base)
|
|
|
|
(if (looking-at "[^,\n]*[^,\n \t]\\([ \t]+title\\)")
|
|
|
|
(progn
|
|
|
|
(goto-char (match-beginning 1))
|
|
|
|
(delete-region (point) end))
|
|
|
|
(goto-char end))
|
|
|
|
(insert " title " (prin1-to-string name))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-view-commands))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-hide (flag)
|
|
|
|
(interactive "P")
|
|
|
|
(calc-graph-init)
|
|
|
|
(and (calc-graph-find-plot nil nil)
|
|
|
|
(progn
|
|
|
|
(or (looking-at "{")
|
|
|
|
(error "Can't hide this curve (wrong format)"))
|
|
|
|
(forward-char 1)
|
Fix regular-expression glitches and typos
Problems reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00085.html
* admin/admin.el (set-version):
* lisp/allout.el (allout-latexify-one-item):
* lisp/arc-mode.el (archive-arc-rename-entry)
(archive-rar-summarize):
* lisp/calc/calc-graph.el (calc-graph-set-styles)
(calc-graph-hide):
* lisp/calc/calc-help.el (calc-describe-key):
* lisp/calc/calc-lang.el (math-compose-tex-func, eqn):
* lisp/calc/calc.el (calcDigit-key):
* lisp/cedet/ede/makefile-edit.el (makefile-macro-file-list):
* lisp/cedet/ede/speedbar.el (ede-tag-expand):
* lisp/cedet/semantic/sb.el (semantic-sb-show-extra)
(semantic-sb-expand-group):
* lisp/comint.el (comint-substitute-in-file-name):
* lisp/dired.el (dired-actual-switches):
* lisp/emacs-lisp/chart.el (chart-rmail-from):
* lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand):
* lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand):
* lisp/emacs-lisp/rx.el (rx-not, rx-atomic-p):
* lisp/emulation/viper-ex.el (viper-get-ex-token)
(viper-get-ex-pat, ex-set-read-variable):
* lisp/epg.el (epg--status-SIG_CREATED):
* lisp/erc/erc-speedbar.el (erc-speedbar-expand-user):
(erc-speedbar-expand-channel, erc-speedbar-expand-server)
* lisp/erc/erc.el (erc-is-message-ctcp-and-not-action-p)
(erc-banlist-update):
* lisp/eshell/em-dirs.el (eshell-parse-drive-letter, eshell/pwd):
* lisp/find-dired.el (find-dired):
* lisp/frame.el (frame-set-background-mode):
* lisp/generic-x.el (apache-log-generic-mode):
* lisp/gnus/gnus-art.el (gnus-button-valid-localpart-regexp):
* lisp/gnus/gnus.el (gnus-short-group-name):
* lisp/gnus/message.el (message-mailer-swallows-blank-line):
* lisp/ibuffer.el (ibuffer-fontification-alist):
* lisp/ido.el (ido-set-matches-1):
* lisp/info-xref.el (info-xref-lock-file-p):
* lisp/info.el (Info-dir-remove-duplicates)
(Info-unescape-quotes, Info-split-parameter-string)
(Info-speedbar-expand-node):
* lisp/international/mule.el (sgml-html-meta-auto-coding-function):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/language/ethio-util.el (ethio-fidel-to-tex-buffer):
* lisp/mail/rmail.el (rmail-collect-deleted):
* lisp/mh-e/mh-alias.el (mh-alias-suggest-alias):
* lisp/mh-e/mh-comp.el (mh-forward):
* lisp/mh-e/mh-search.el (mh-index-next-folder)
(mh-index-create-imenu-index):
* lisp/mh-e/mh-xface.el (mh-picon-get-image):
* lisp/minibuffer.el (completion--embedded-envvar-re):
* lisp/net/ange-ftp.el (ange-ftp-ls-parser):
* lisp/net/goto-addr.el (goto-address-mail-regexp)
(goto-address-find-address-at-point):
* lisp/net/pop3.el (pop3-read-response, pop3-user)
(pop3-pass, pop3-apop):
* lisp/net/tramp.el (tramp-ipv6-regexp)
(tramp-replace-environment-variables):
* lisp/nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* lisp/nxml/rng-uri.el (rng-uri-escape-multibyte):
* lisp/nxml/rng-xsd.el (rng-xsd-convert-any-uri):
* lisp/obsolete/pgg.el (pgg-fetch-key):
* lisp/obsolete/vip.el (vip-get-ex-token):
* lisp/org/ob-core.el (org-babel-string-read):
* lisp/org/org-agenda.el:
(org-agenda-add-entry-to-org-agenda-diary-file):
* lisp/org/org-element.el (org-element-keyword-parser):
* lisp/org/org-list.el (org-list-indent-item-generic):
* lisp/org/org-mhe.el (org-mhe-get-message-folder-from-index):
* lisp/org/org-mobile.el (org-mobile-apply):
* lisp/org/org-mouse.el (org-mouse-context-menu):
* lisp/org/org-plot.el (org-plot/gnuplot):
* lisp/org/org-protocol.el (org-protocol-flatten-greedy):
* lisp/org/org-table.el (org-table-copy-down)
(org-table-formula-make-cmp-string)
(org-table-get-stored-formulas, org-table-recalculate)
(org-table-edit-formulas):
* lisp/org/org.el (org-translate-link-from-planner)
(org-fill-line-break-nobreak-p):
* lisp/org/ox-ascii.el (org-ascii-item):
* lisp/org/ox-latex.el (org-latex-clean-invalid-line-breaks):
* lisp/org/ox.el (org-export-expand-include-keyword):
* lisp/progmodes/ada-xref.el (ada-treat-cmd-string):
* lisp/progmodes/cfengine.el (cfengine2-font-lock-keywords):
* lisp/progmodes/cperl-mode.el (cperl-to-comment-or-eol)
(cperl-find-pods-heres, cperl-fix-line-spacing)
(cperl-have-help-regexp, cperl-word-at-point-hard)
(cperl-make-regexp-x):
* lisp/progmodes/dcl-mode.el (dcl-option-value-offset):
* lisp/progmodes/etags.el (tag-implicit-name-match-p):
* lisp/progmodes/fortran.el (fortran-fill):
* lisp/progmodes/gdb-mi.el (gdb-speedbar-expand-node)
(gdb-locals-handler-custom):
* lisp/progmodes/grep.el (grep-mode-font-lock-keywords):
* lisp/progmodes/gud.el (gud-jdb-find-source-using-classpath):
* lisp/progmodes/js.el (js--continued-expression-p):
* lisp/progmodes/m4-mode.el (m4-font-lock-keywords):
* lisp/progmodes/meta-mode.el (meta-indent-level-count):
* lisp/progmodes/mixal-mode.el (mixal-font-lock-keywords):
* lisp/progmodes/opascal.el (opascal-find-unit-in-directory):
* lisp/progmodes/pascal.el (pascal-progbeg-re):
* lisp/progmodes/ruby-mode.el (ruby-expression-expansion-re)
(ruby-expr-beg, ruby-parse-partial)
(ruby-toggle-string-quotes, ruby-font-lock-keywords):
* lisp/progmodes/sql.el (sql--make-help-docstring):
* lisp/progmodes/verilog-mode.el (verilog-coverpoint-re)
(verilog-skip-forward-comment-p)
(verilog-read-sub-decls-gate)
(verilog-read-auto-template-middle):
* lisp/progmodes/vhdl-mode.el (vhdl-resolve-env-variable)
(vhdl-speedbar-expand-project, vhdl-speedbar-expand-entity)
(vhdl-speedbar-expand-architecture)
(vhdl-speedbar-expand-config, vhdl-speedbar-expand-package)
(vhdl-speedbar-dired):
* lisp/speedbar.el (speedbar-dired, speedbar-tag-file)
(speedbar-tag-expand):
* lisp/textmodes/dns-mode.el (dns-mode-font-lock-keywords):
* lisp/textmodes/flyspell.el (flyspell-debug-signal-word-checked):
* lisp/textmodes/ispell.el (ispell-process-line):
* lisp/textmodes/reftex-cite.el (reftex-end-of-bib-entry):
* lisp/textmodes/reftex-ref.el (reftex-replace-prefix-escapes):
* lisp/url/url-parse.el (url-generic-parse-url):
* lisp/url/url-util.el (url-truncate-url-for-viewing):
* lisp/vc/diff-mode.el (diff-unified->context):
* lisp/vc/vc-bzr.el (vc-bzr-error-regexp-alist):
* lisp/vc/vc-cvs.el (vc-cvs-parse-status):
* lisp/woman.el (woman0-el, woman-if-ignore)
(woman-change-fonts):
* lisp/xdg.el (xdg--substitute-home-env):
Fix regular-expression infelicities and typos.
Fix regular expression typos
Fix typos reported by Mattias Engdegård in:
that occurred in preloaded modules.
* lisp/frame.el (frame-set-background-mode):
* lisp/international/mule.el (sgml-html-meta-auto-coding-function):
* lisp/isearch.el (isearch-pre-command-hook):
* lisp/minibuffer.el (completion--embedded-envvar-re):
2019-03-04 18:00:00 -08:00
|
|
|
(if (looking-at "\\*")
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (or (null flag) (<= (prefix-numeric-value flag) 0))
|
|
|
|
(delete-char 1))
|
|
|
|
(if (or (null flag) (> (prefix-numeric-value flag) 0))
|
2001-11-14 09:09:09 +00:00
|
|
|
(insert "*"))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-header (title)
|
|
|
|
(interactive "sTitle for entire graph: ")
|
|
|
|
(calc-graph-set-command "title" (if (not (equal title ""))
|
2001-11-14 09:09:09 +00:00
|
|
|
(prin1-to-string title))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-border (flag)
|
|
|
|
(interactive "P")
|
|
|
|
(calc-graph-set-command "noborder"
|
|
|
|
(and (if flag
|
|
|
|
(<= (prefix-numeric-value flag) 0)
|
|
|
|
(not (calc-graph-find-command "noborder")))
|
2001-11-14 09:09:09 +00:00
|
|
|
" ")))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-grid (flag)
|
|
|
|
(interactive "P")
|
|
|
|
(calc-graph-set-command "grid" (and (if flag
|
|
|
|
(> (prefix-numeric-value flag) 0)
|
|
|
|
(not (calc-graph-find-command "grid")))
|
2001-11-14 09:09:09 +00:00
|
|
|
" ")))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-key (flag)
|
|
|
|
(interactive "P")
|
|
|
|
(calc-graph-set-command "key" (and (if flag
|
|
|
|
(> (prefix-numeric-value flag) 0)
|
|
|
|
(not (calc-graph-find-command "key")))
|
2001-11-14 09:09:09 +00:00
|
|
|
" ")))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-num-points (res flag)
|
|
|
|
(interactive "sNumber of data points: \nP")
|
|
|
|
(if flag
|
|
|
|
(if (> (prefix-numeric-value flag) 0)
|
|
|
|
(if (equal res "")
|
2001-11-19 07:44:56 +00:00
|
|
|
(message "Default resolution is %d"
|
2001-11-06 18:59:06 +00:00
|
|
|
calc-graph-default-resolution)
|
2005-05-02 19:44:07 +00:00
|
|
|
(setq calc-graph-default-resolution (string-to-number res)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (equal res "")
|
2001-11-19 07:44:56 +00:00
|
|
|
(message "Default 3D resolution is %d"
|
2001-11-06 18:59:06 +00:00
|
|
|
calc-graph-default-resolution-3d)
|
2005-05-02 19:44:07 +00:00
|
|
|
(setq calc-graph-default-resolution-3d (string-to-number res))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-set-command "samples" (if (not (equal res "")) res))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-device (name flag)
|
|
|
|
(interactive "sDevice name: \nP")
|
|
|
|
(if (equal name "?")
|
|
|
|
(progn
|
|
|
|
(calc-gnuplot-command "set terminal")
|
|
|
|
(calc-graph-view-trail))
|
|
|
|
(if flag
|
|
|
|
(if (> (prefix-numeric-value flag) 0)
|
|
|
|
(if (equal name "")
|
2001-11-19 07:44:56 +00:00
|
|
|
(message "Default GNUPLOT device is \"%s\""
|
2001-11-06 18:59:06 +00:00
|
|
|
calc-gnuplot-default-device)
|
|
|
|
(setq calc-gnuplot-default-device name))
|
|
|
|
(if (equal name "")
|
2001-11-19 07:44:56 +00:00
|
|
|
(message "GNUPLOT device for Print command is \"%s\""
|
2001-11-06 18:59:06 +00:00
|
|
|
calc-gnuplot-print-device)
|
|
|
|
(setq calc-gnuplot-print-device name)))
|
|
|
|
(calc-graph-set-command "terminal" (if (not (equal name ""))
|
2001-11-14 09:09:09 +00:00
|
|
|
name)))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-output (name flag)
|
|
|
|
(interactive "FOutput file name: \np")
|
|
|
|
(cond ((string-match "\\<[aA][uU][tT][oO]$" name)
|
|
|
|
(setq name "auto"))
|
|
|
|
((string-match "\\<[tT][tT][yY]$" name)
|
|
|
|
(setq name "tty"))
|
|
|
|
((string-match "\\<[sS][tT][dD][oO][uU][tT]$" name)
|
|
|
|
(setq name "STDOUT"))
|
|
|
|
((equal (file-name-nondirectory name) "")
|
|
|
|
(setq name ""))
|
|
|
|
(t (setq name (expand-file-name name))))
|
|
|
|
(if flag
|
|
|
|
(if (> (prefix-numeric-value flag) 0)
|
|
|
|
(if (equal name "")
|
2001-11-19 07:44:56 +00:00
|
|
|
(message "Default GNUPLOT output file is \"%s\""
|
2001-11-06 18:59:06 +00:00
|
|
|
calc-gnuplot-default-output)
|
|
|
|
(setq calc-gnuplot-default-output name))
|
|
|
|
(if (equal name "")
|
2001-11-19 07:44:56 +00:00
|
|
|
(message "GNUPLOT output file for Print command is \"%s\""
|
2001-11-06 18:59:06 +00:00
|
|
|
calc-gnuplot-print-output)
|
|
|
|
(setq calc-gnuplot-print-output name)))
|
|
|
|
(calc-graph-set-command "output" (if (not (equal name ""))
|
2001-11-14 09:09:09 +00:00
|
|
|
(prin1-to-string name)))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-display (name)
|
|
|
|
(interactive "sX display name: ")
|
|
|
|
(if (equal name "")
|
2001-11-19 07:44:56 +00:00
|
|
|
(message "Current X display is \"%s\""
|
2001-11-06 18:59:06 +00:00
|
|
|
(or calc-gnuplot-display "<none>"))
|
|
|
|
(setq calc-gnuplot-display name)
|
|
|
|
(if (calc-gnuplot-alive)
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-gnuplot-command "exit"))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-geometry (name)
|
|
|
|
(interactive "sX geometry spec (or \"default\"): ")
|
|
|
|
(if (equal name "")
|
2001-11-19 07:44:56 +00:00
|
|
|
(message "Current X geometry is \"%s\""
|
2001-11-06 18:59:06 +00:00
|
|
|
(or calc-gnuplot-geometry "default"))
|
|
|
|
(setq calc-gnuplot-geometry (and (not (equal name "default")) name))
|
|
|
|
(if (calc-gnuplot-alive)
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-gnuplot-command "exit"))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-find-command (cmd)
|
|
|
|
(calc-graph-init)
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-input
|
2001-11-06 18:59:06 +00:00
|
|
|
(goto-char (point-min))
|
|
|
|
(if (re-search-forward (concat "^set[ \t]+" cmd "[ \t]*\\(.*\\)$") nil t)
|
2001-11-14 09:09:09 +00:00
|
|
|
(buffer-substring (match-beginning 1) (match-end 1)))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-set-command (cmd &rest args)
|
|
|
|
(calc-graph-init)
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-input
|
2001-11-06 18:59:06 +00:00
|
|
|
(goto-char (point-min))
|
|
|
|
(if (re-search-forward (concat "^set[ \t]+" cmd "[ \t\n]") nil t)
|
|
|
|
(progn
|
|
|
|
(forward-char -1)
|
|
|
|
(end-of-line)
|
|
|
|
(let ((end (point)))
|
|
|
|
(beginning-of-line)
|
|
|
|
(delete-region (point) (1+ end))))
|
|
|
|
(if (calc-graph-find-plot t t)
|
|
|
|
(if (eq (preceding-char) ?\n)
|
|
|
|
(forward-char -1))
|
|
|
|
(goto-char (1- (point-max)))))
|
|
|
|
(if (and args (car args))
|
|
|
|
(progn
|
|
|
|
(or (bolp)
|
|
|
|
(insert "\n"))
|
|
|
|
(insert "set " (mapconcat 'identity (cons cmd args) " ") "\n"))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-view-commands))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-command (cmd)
|
|
|
|
(interactive "sGNUPLOT command: ")
|
|
|
|
(calc-wrapper
|
|
|
|
(calc-graph-init)
|
|
|
|
(calc-graph-view-trail)
|
|
|
|
(calc-gnuplot-command cmd)
|
2019-01-13 17:50:16 +02:00
|
|
|
(or (calc-graph-w32-p)
|
2009-08-07 14:54:10 +00:00
|
|
|
(progn
|
|
|
|
(accept-process-output)
|
|
|
|
(calc-graph-view-trail)))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-kill (&optional no-view)
|
|
|
|
(interactive)
|
|
|
|
(if (calc-gnuplot-alive)
|
|
|
|
(calc-wrapper
|
|
|
|
(or no-view (calc-graph-view-trail))
|
|
|
|
(let ((calc-graph-no-wait t))
|
|
|
|
(calc-gnuplot-command "exit"))
|
|
|
|
(sit-for 1)
|
|
|
|
(if (process-status calc-gnuplot-process)
|
|
|
|
(delete-process calc-gnuplot-process))
|
2019-01-13 17:50:16 +02:00
|
|
|
(setq calc-gnuplot-process nil)))
|
|
|
|
(calc-graph-delete-temps))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-quit ()
|
|
|
|
(interactive)
|
|
|
|
(if (get-buffer-window calc-gnuplot-input)
|
|
|
|
(calc-graph-view-commands t))
|
|
|
|
(if (get-buffer-window calc-gnuplot-buffer)
|
|
|
|
(calc-graph-view-trail t))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-kill t))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-view-commands (&optional no-need)
|
|
|
|
(interactive "p")
|
|
|
|
(or calc-graph-no-auto-view (calc-graph-init-buffers))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-view calc-gnuplot-input calc-gnuplot-buffer (null no-need)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-view-trail (&optional no-need)
|
|
|
|
(interactive "p")
|
|
|
|
(or calc-graph-no-auto-view (calc-graph-init-buffers))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-view calc-gnuplot-buffer calc-gnuplot-input (null no-need)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-view (buf other-buf need)
|
|
|
|
(let (win)
|
|
|
|
(or calc-graph-no-auto-view
|
|
|
|
(if (setq win (get-buffer-window buf))
|
|
|
|
(or need
|
|
|
|
(and (eq buf calc-gnuplot-buffer)
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer buf
|
2001-11-06 18:59:06 +00:00
|
|
|
(not (pos-visible-in-window-p (point-max) win))))
|
|
|
|
(progn
|
|
|
|
(bury-buffer buf)
|
|
|
|
(bury-buffer other-buf)
|
|
|
|
(let ((curwin (selected-window)))
|
|
|
|
(select-window win)
|
|
|
|
(switch-to-buffer nil)
|
|
|
|
(select-window curwin))))
|
|
|
|
(if (setq win (get-buffer-window other-buf))
|
|
|
|
(set-window-buffer win buf)
|
|
|
|
(if (eq major-mode 'calc-mode)
|
|
|
|
(if (or need
|
2009-10-06 02:42:29 +00:00
|
|
|
(not (window-full-height-p)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(display-buffer buf))
|
|
|
|
(switch-to-buffer buf)))))
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer buf
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (and (eq buf calc-gnuplot-buffer)
|
|
|
|
(setq win (get-buffer-window buf))
|
|
|
|
(not (pos-visible-in-window-p (point-max) win)))
|
|
|
|
(progn
|
|
|
|
(goto-char (point-max))
|
|
|
|
(vertical-motion (- 6 (window-height win)))
|
|
|
|
(set-window-start win (point))
|
|
|
|
(goto-char (point-max)))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(or calc-graph-no-auto-view (sit-for 0))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-gnuplot-check-for-errors ()
|
2021-09-11 17:13:14 +02:00
|
|
|
(if (with-current-buffer calc-gnuplot-buffer
|
|
|
|
(goto-char calc-gnuplot-last-error-pos)
|
|
|
|
(prog1
|
|
|
|
(re-search-forward "^[ \t]+\\^$" nil t)
|
|
|
|
(goto-char (point-max))
|
|
|
|
(setq calc-gnuplot-last-error-pos (point-max))))
|
2001-11-14 09:09:09 +00:00
|
|
|
(calc-graph-view-trail)))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-gnuplot-command (&rest args)
|
2021-08-31 03:47:45 +02:00
|
|
|
"Send ARGS to Gnuplot.
|
2022-11-18 13:06:55 +01:00
|
|
|
Returns nil if Gnuplot signaled an error."
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-graph-init)
|
|
|
|
(let ((cmd (concat (mapconcat 'identity args " ") "\n")))
|
2019-01-13 17:50:16 +02:00
|
|
|
(or (calc-graph-w32-p)
|
2009-08-07 14:54:10 +00:00
|
|
|
(accept-process-output))
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-buffer
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-gnuplot-check-for-errors)
|
|
|
|
(goto-char (point-max))
|
|
|
|
(setq calc-gnuplot-trail-mark (point))
|
|
|
|
(or (>= calc-gnuplot-version 3)
|
|
|
|
(insert cmd))
|
|
|
|
(set-marker (process-mark calc-gnuplot-process) (point))
|
|
|
|
(process-send-string calc-gnuplot-process cmd)
|
|
|
|
(if (get-buffer-window calc-gnuplot-buffer)
|
|
|
|
(calc-graph-view-trail))
|
2019-01-13 17:50:16 +02:00
|
|
|
(or (calc-graph-w32-p)
|
2009-08-07 14:54:10 +00:00
|
|
|
(accept-process-output (and (not calc-graph-no-wait)
|
|
|
|
calc-gnuplot-process)))
|
2021-08-31 03:47:45 +02:00
|
|
|
(prog1
|
|
|
|
;; Return nil if we got an error.
|
|
|
|
(not (calc-gnuplot-check-for-errors))
|
|
|
|
(if (get-buffer-window calc-gnuplot-buffer)
|
|
|
|
(calc-graph-view-trail))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-init-buffers ()
|
|
|
|
(or (and calc-gnuplot-buffer
|
|
|
|
(buffer-name calc-gnuplot-buffer))
|
|
|
|
(setq calc-gnuplot-buffer (get-buffer-create "*Gnuplot Trail*")))
|
|
|
|
(or (and calc-gnuplot-input
|
|
|
|
(buffer-name calc-gnuplot-input))
|
2001-11-14 09:09:09 +00:00
|
|
|
(setq calc-gnuplot-input (get-buffer-create "*Gnuplot Commands*"))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
|
|
|
(defun calc-graph-init ()
|
|
|
|
(or (calc-gnuplot-alive)
|
|
|
|
(let ((process-connection-type t)
|
|
|
|
origin)
|
|
|
|
(if calc-gnuplot-process
|
|
|
|
(progn
|
|
|
|
(delete-process calc-gnuplot-process)
|
|
|
|
(setq calc-gnuplot-process nil)))
|
|
|
|
(calc-graph-init-buffers)
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-buffer
|
2001-11-06 18:59:06 +00:00
|
|
|
(insert "\nStarting gnuplot...\n")
|
|
|
|
(setq origin (point)))
|
|
|
|
(setq calc-graph-last-device nil)
|
|
|
|
(setq calc-graph-last-output nil)
|
2019-01-13 17:50:16 +02:00
|
|
|
(if (calc-graph-w32-p)
|
|
|
|
(let ((version-str
|
|
|
|
(shell-command-to-string (concat calc-gnuplot-name " -V"))))
|
2009-08-07 14:54:10 +00:00
|
|
|
(if (string-match "gnuplot \\([0-9]+\\)\\." version-str)
|
|
|
|
(setq calc-gnuplot-version (string-to-number
|
|
|
|
(substring version-str
|
|
|
|
(match-beginning 1)
|
|
|
|
(match-end 1))))
|
|
|
|
(setq calc-gnuplot-version 1))))
|
2020-10-10 16:00:51 -04:00
|
|
|
(condition-case nil
|
2001-11-06 18:59:06 +00:00
|
|
|
(let ((args (append (and calc-gnuplot-display
|
|
|
|
(not (equal calc-gnuplot-display
|
|
|
|
(getenv "DISPLAY")))
|
2019-01-13 17:50:16 +02:00
|
|
|
(not (calc-graph-w32-p))
|
2001-11-06 18:59:06 +00:00
|
|
|
(list "-display"
|
|
|
|
calc-gnuplot-display))
|
|
|
|
(and calc-gnuplot-geometry
|
2019-01-13 17:50:16 +02:00
|
|
|
(not (calc-graph-w32-p))
|
2001-11-06 18:59:06 +00:00
|
|
|
(list "-geometry"
|
|
|
|
calc-gnuplot-geometry)))))
|
2003-02-04 13:24:35 +00:00
|
|
|
(setq calc-gnuplot-process
|
2001-11-06 18:59:06 +00:00
|
|
|
(apply 'start-process
|
|
|
|
"gnuplot"
|
|
|
|
calc-gnuplot-buffer
|
|
|
|
calc-gnuplot-name
|
|
|
|
args))
|
2004-10-21 15:41:15 +00:00
|
|
|
(set-process-query-on-exit-flag calc-gnuplot-process nil))
|
2001-11-06 18:59:06 +00:00
|
|
|
(file-error
|
2001-11-19 07:44:56 +00:00
|
|
|
(error "Sorry, can't find \"%s\" on your system"
|
2001-11-06 18:59:06 +00:00
|
|
|
calc-gnuplot-name)))
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-buffer
|
2019-01-13 17:50:16 +02:00
|
|
|
(while (and (not (calc-graph-w32-p))
|
2009-08-07 14:54:10 +00:00
|
|
|
(not (save-excursion
|
2001-11-06 18:59:06 +00:00
|
|
|
(goto-char origin)
|
|
|
|
(search-forward "gnuplot> " nil t)))
|
|
|
|
(memq (process-status calc-gnuplot-process) '(run stop)))
|
|
|
|
(accept-process-output calc-gnuplot-process))
|
|
|
|
(or (memq (process-status calc-gnuplot-process) '(run stop))
|
2001-11-19 07:44:56 +00:00
|
|
|
(error "Unable to start GNUPLOT process"))
|
2019-01-13 17:50:16 +02:00
|
|
|
(if (not (calc-graph-w32-p))
|
2009-08-07 14:54:10 +00:00
|
|
|
(if (save-excursion
|
|
|
|
(goto-char origin)
|
|
|
|
(re-search-forward
|
|
|
|
"G N U P L O T.*\n.*version \\([0-9]+\\)\\." nil t))
|
|
|
|
(setq calc-gnuplot-version
|
|
|
|
(string-to-number (buffer-substring
|
|
|
|
(match-beginning 1)
|
|
|
|
(match-end 1))))
|
|
|
|
(setq calc-gnuplot-version 1)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(goto-char (point-max)))))
|
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
(calcDigit-nondigit):
* calc/calc-yank.el (calc-copy-to-buffer):
* calc/calc-units.el (calc-invalidate-units-table):
* calc/calc-trail.el (calc-trail-yank):
* calc/calc-store.el (calc-insert-variables):
* calc/calc-rewr.el (math-rewrite, math-rewrite-phase):
* calc/calc-prog.el (calc-read-parse-table):
* calc/calc-keypd.el (calc-do-keypad, calc-keypad-right-click):
* calc/calc-help.el (calc-describe-bindings, calc-describe-key):
* calc/calc-graph.el (calc-graph-delete, calc-graph-add-curve)
(calc-graph-juggle, calc-graph-count-curves, calc-graph-plot)
(calc-graph-plot, calc-graph-format-data, calc-graph-set-styles)
(calc-graph-name, calc-graph-find-command, calc-graph-view)
(calc-graph-view, calc-gnuplot-command, calc-graph-init):
* calc/calc-ext.el (calc-realign):
* calc/calc-embed.el (calc-do-embedded, calc-do-embedded)
(calc-embedded-finish-edit, calc-embedded-make-info)
(calc-embedded-finish-command, calc-embedded-stack-change):
* calc/calc-aent.el (calcAlg-enter): Use with-current-buffer.
2009-10-28 18:35:33 +00:00
|
|
|
(with-current-buffer calc-gnuplot-input
|
2001-11-06 18:59:06 +00:00
|
|
|
(if (= (buffer-size) 0)
|
|
|
|
(insert "# Commands for running gnuplot\n\n\n")
|
|
|
|
(or calc-graph-no-auto-view
|
|
|
|
(eq (char-after (1- (point-max))) ?\n)
|
|
|
|
(progn
|
|
|
|
(goto-char (point-max))
|
2001-11-14 09:09:09 +00:00
|
|
|
(insert "\n"))))))
|
2001-11-06 18:59:06 +00:00
|
|
|
|
2004-11-30 17:10:43 +00:00
|
|
|
(provide 'calc-graph)
|
|
|
|
|
2001-11-14 09:09:09 +00:00
|
|
|
;;; calc-graph.el ends here
|