Subject: bug#72778: 31.0.50; Calc: g f doesn't display gnuplot window after closing

From: Michael Heerdegen <[email-masked]>
Date: Sat, 24 Aug 2024 07:49:53 +0200

Hello,

I'm using a graphical version of Gnuplot in Debian Gnu/Linux.

In Calc, whenever I have displayed a graph view using g f, and then have
been closing the Gnuplot X window, the next g f or g p will always not
display the Gnuplot view.  Hitting the keys again displays it, however.

When I don't close the Gnuplot window, the graph view is updated as
expected.

I found nothing obvious in the Calc code.  In the scenario where the
window doesn't pop up, the Gnuplot process is alive.  I edebugged
`calc-gnuplot-command' and the relevant line

  (process-send-string calc-gnuplot-process cmd)

seems to be the correct call.  When edebugging, simply executing this
very same call makes the Gnuplot window appear!  For some reason,
Gnuplot only displays the window for the second process-send-string
call.  Could be a Gnuplot bug, I dunno.

And...when I redefine `calc-gnuplot-alive' to always fail, the problem
is fixed, in a very inelegant way of course.  So there is something
wrong when talking with Gnuplot, or with Gnuplot itself.

I'm on Debian, I tried several different graphical Gnuplot versions, but
it's the same for all of them.

I'm thankful for all insights.

Michael.