2001-11-19 07:44:56 +00:00
|
|
|
;;; calc-graph.el --- graph output functions for Calc
|
|
|
|
|
2019-01-01 00:59:58 +00:00
|
|
|
;; Copyright (C) 1990-1993, 2001-2019 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))
|
|
|
|
(math-contains-sdev-p (eval (nth 2 ydata))))))
|
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)
|
|
|
|
|
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*"))
|
|
|
|
(tempbuftop 1)
|
|
|
|
(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"
|
2001-11-06 18:59:06 +00:00
|
|
|
"set notime\nset border\nset ztics\nset zeroaxis\n"
|
|
|
|
"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"))))
|
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))
|
|
|
|
(setq output (eval output)))
|
|
|
|
(or (equal device calc-graph-last-device)
|
|
|
|
(progn
|
|
|
|
(setq calc-graph-last-device device)
|
|
|
|
(calc-gnuplot-command "set terminal" device)))
|
|
|
|
(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)
|
|
|
|
(calc-graph-xlow nil) (calc-graph-xhigh nil) (y3low nil) (y3high nil)
|
|
|
|
calc-graph-xvec calc-graph-xval calc-graph-xstep var-DUMMY
|
|
|
|
y3val calc-graph-y3step var-DUMMY2 (calc-graph-zval nil)
|
|
|
|
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)
|
2001-11-14 09:09:09 +00:00
|
|
|
(eval command))))))))))
|
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))
|
|
|
|
(delq calc-graph-ycache calc-graph-data-cache)
|
2001-11-06 18:59:06 +00:00
|
|
|
(nconc calc-graph-data-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
|
|
|
(list (or calc-graph-ycache (setq calc-graph-ycache (list calc-graph-yvalue)))))
|
|
|
|
(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)))
|
|
|
|
(condition-case err
|
|
|
|
(delete-file (car (car calc-graph-file-cache)))
|
|
|
|
(error nil)))
|
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)
|
|
|
|
"Default calc-gnuplot-plot-command for \"tty\" output mode.
|
|
|
|
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.")
|
|
|
|
|
2001-11-06 18:59:06 +00:00
|
|
|
(defun calc-graph-show-dumb (&optional output)
|
|
|
|
"Default calc-gnuplot-plot-command for Pinard's \"dumb\" terminal type.
|
|
|
|
This \"dumb\" driver will be present in Gnuplot 3.0."
|
|
|
|
(interactive)
|
|
|
|
(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)
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 08:41:44 -07:00
|
|
|
(message "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)))
|
|
|
|
(if (and (not (string-match ":" range))
|
|
|
|
(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
|
|
|
|
(condition-case nil
|
|
|
|
(math-contains-sdev-p
|
2009-09-19 21:22:45 +00:00
|
|
|
(eval (intern
|
2007-08-03 05:25:03 +00:00
|
|
|
(concat "var-"
|
|
|
|
(save-excursion
|
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
|
|
|
(re-search-backward ":\\(.*\\)}")
|
2007-08-03 05:25:03 +00:00
|
|
|
(match-string 1))))))
|
|
|
|
(error nil)))
|
|
|
|
(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))
|
2009-09-19 21:22:45 +00:00
|
|
|
(insert " "
|
2007-08-03 05:25:03 +00:00
|
|
|
(if (and lstyle (> lstyle 0)) (int-to-string lstyle) "1")
|
|
|
|
" " (int-to-string pstyle))
|
|
|
|
(if (and lstyle (> lstyle 0))
|
|
|
|
(insert " " (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))
|
(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
|
|
|
start
|
|
|
|
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 ()
|
|
|
|
(if (save-excursion
|
|
|
|
(prog2
|
|
|
|
(progn
|
|
|
|
(set-buffer calc-gnuplot-buffer)
|
|
|
|
(goto-char calc-gnuplot-last-error-pos))
|
|
|
|
(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)
|
|
|
|
(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)))
|
2001-11-06 18:59:06 +00:00
|
|
|
(calc-gnuplot-check-for-errors)
|
|
|
|
(if (get-buffer-window calc-gnuplot-buffer)
|
2001-11-14 09:09:09 +00:00
|
|
|
(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))))
|
2001-11-06 18:59:06 +00:00
|
|
|
(condition-case err
|
|
|
|
(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
|