emacs-gnuplot / gnuplot

A major mode for Emacs for interacting with Gnuplot
GNU General Public License v3.0
137 stars 21 forks source link

pause -1 makes gnuplot hang in emacs #6

Closed bruceravel closed 4 years ago

bruceravel commented 13 years ago

Jim Mehl says: “I usually put pause -1 lines in my gnuplot scripts. I have to be careful to comment these out if I execute the script within emacs. It just hangs. Is there a way out?” When run in a terminal the pauses let me review the screen, then proceed (like many gnuplot demo scripts). When I run this script within emacs 23.1.1 with gnuplot-mode (gnuplot 4.5), emacs becomes unresponsive. I cannot switch buffers. I can switch to another window and kill emacs (usually undesirable).

plot [-5:5] sin(x)/x
pause -1
plot [-5:5] (sin(x)/x)**2
pause -1
joddie commented 13 years ago

This must have something to do with comint-mode blocking while waiting for the process. If you type "sleep 10" in a shell buffer Emacs will hang similarly for 10 secnds waiting for it to finish. The same thing happens when running "pause 10" from gnuplot. In any of these cases typing C-g breaks Emacs out of its stupor, so there must be a reasonably easy fix. I will have a look through the comint-mode sources and see if there's an obvious way to tell it not to block...

conao3 commented 4 years ago

Now pause -1 could cancel via C-c C-c in *gnuplot* buffer.