Skip to content

Commit cbd1230

Browse files
committed
Improve comint initialization
1 parent da40ffb commit cbd1230

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

gnuplot.el

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ These messages are shown after menu insertion of gnuplot commands."
214214
:group 'gnuplot-insertions
215215
:type 'boolean)
216216

217-
(defcustom gnuplot-delay 0.01
217+
(defcustom gnuplot-delay 0.02
218218
"Amount of time to delay before sending a new line to gnuplot.
219219
This is needed so that the the line is not written in the gnuplot
220220
buffer in advance of its prompt. Increase this number if the
@@ -1107,7 +1107,7 @@ called by this function after all of STRING is sent to gnuplot."
11071107
(goto-char (point-max))
11081108
;; bruce asks: what is this next line for?
11091109
(set-marker (process-mark gnuplot-process) (point-marker))
1110-
(sleep-for (* 20 gnuplot-delay))
1110+
(sleep-for (* 10 gnuplot-delay))
11111111
(while list
11121112
(insert (car list))
11131113
(comint-send-input)
@@ -1376,19 +1376,15 @@ buffer."
13761376
"Switch to the gnuplot program buffer or create one if none exists."
13771377
(unless (and gnuplot-process (eq (process-status gnuplot-process) 'run)
13781378
gnuplot-buffer (buffer-live-p gnuplot-buffer))
1379-
(message "Starting gnuplot plotting program...")
1380-
(let ((gnuplot-cmd (list #'make-comint gnuplot-process-name gnuplot-program)))
1381-
(when gnuplot-program-args
1382-
(setq gnuplot-cmd (append gnuplot-cmd '(nil) (split-string gnuplot-program-args))))
1383-
(setq gnuplot-buffer (eval gnuplot-cmd t)
1384-
gnuplot-process (get-buffer-process gnuplot-buffer)))
1379+
(setq gnuplot-buffer (apply #'make-comint gnuplot-process-name gnuplot-program nil
1380+
(and gnuplot-program-args (split-string gnuplot-program-args)))
1381+
gnuplot-process (get-buffer-process gnuplot-buffer))
13851382
(set-process-query-on-exit-flag gnuplot-process nil)
13861383
(with-current-buffer gnuplot-buffer
13871384
(gnuplot-comint-mode)
13881385
(when gnuplot-inline-image-mode
1389-
(sleep-for gnuplot-delay)
1390-
(gnuplot--setup-comint-for-image-mode)))
1391-
(message "Starting gnuplot plotting program...Done")))
1386+
(sleep-for (* 10 gnuplot-delay))
1387+
(gnuplot--setup-comint-for-image-mode)))))
13921388

13931389
(defvar gnuplot-prompt-regexp
13941390
(regexp-opt '("gnuplot> " "multiplot> "))

0 commit comments

Comments
 (0)