]> git.eshelyaron.com Git - emacs.git/commitdiff
Work around Gnuplot bug in displaying plots
authorEli Zaretskii <eliz@gnu.org>
Sat, 31 Aug 2024 09:58:39 +0000 (12:58 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 4 Sep 2024 07:51:53 +0000 (09:51 +0200)
* lisp/calc/calc-graph.el (calc-gnuplot-command): Prepend newline
to Gnuplot command.  Suggested by Visuwesh <visuweshm@gmail.com>.
(Bug#72778)

(cherry picked from commit bb5576fc9071590143af2106111d95ca2221a20c)

lisp/calc/calc-graph.el

index c355b37346cbda6fbcb57dd6b2b8b80adac63ba3..026e0b5c8a7a674f95cdd29c17e65913af33a50c 100644 (file)
@@ -1417,7 +1417,9 @@ This \"dumb\" driver will be present in Gnuplot 3.0."
   "Send ARGS to Gnuplot.
 Returns nil if Gnuplot signaled an error."
   (calc-graph-init)
-  (let ((cmd (concat (mapconcat 'identity args " ") "\n")))
+  ;; 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