Function: calc-gnuplot-command

calc-gnuplot-command is a byte-compiled function defined in calc-graph.el.gz.

Signature

(calc-gnuplot-command &rest ARGS)

Documentation

Send ARGS to Gnuplot.

Returns nil if Gnuplot signaled an error.

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-graph.el.gz
(defun calc-gnuplot-command (&rest args)
  "Send ARGS to Gnuplot.
Returns nil if Gnuplot signaled an error."
  (calc-graph-init)
  ;; We prepend the newline to work around a bug in Gnuplot, whereby it
  ;; sometimes does not display the plot, see bug#72778.
  (let ((cmd (concat "\n" (mapconcat 'identity args " ") "\n")))
    (or (calc-graph-w32-p)
	(accept-process-output))
    (with-current-buffer calc-gnuplot-buffer
      (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))
      (or (calc-graph-w32-p)
	  (accept-process-output (and (not calc-graph-no-wait)
				      calc-gnuplot-process)))
      (prog1
          ;; Return nil if we got an error.
          (not (calc-gnuplot-check-for-errors))
        (if (get-buffer-window calc-gnuplot-buffer)
	    (calc-graph-view-trail))))))