[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gnuplot 59f7a94 061/184: Better prompt tracking. Setup inl
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gnuplot 59f7a94 061/184: Better prompt tracking. Setup inline images on creating comint buffer. |
Date: |
Sun, 29 Aug 2021 11:03:15 -0400 (EDT) |
branch: elpa/gnuplot
commit 59f7a9463f4285a3c4f4e554e2f473e2b4a7d7b1
Author: Jonathan Oddie <j.j.oddie@gmail.com>
Commit: joddie <jonxfield@gmail.com>
Better prompt tracking. Setup inline images on creating comint buffer.
- new constant: `gnuplot-prompt-regexp', recognizes "gnuplot>" and
"multiplot>"
- call (gnuplot-inline-image-mode) with right value in
`gnuplot-make-gnuplot-buffer', after creating process and buffer
---
gnuplot.el | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/gnuplot.el b/gnuplot.el
index 9d053be..119cd2a 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -2133,6 +2133,7 @@ buffer."
(process-kill-without-query gnuplot-process nil)
(with-current-buffer gnuplot-buffer
(gnuplot-comint-mode)
+ (gnuplot-inline-image-mode gnuplot-inline-image-mode)
(message "Starting gnuplot plotting program...Done")))))
(defun gnuplot-fetch-version-number ()
@@ -2191,6 +2192,10 @@ defaults to 3.7."
gnuplot-version gnuplot-program-version
(substitute-command-keys "\\[gnuplot-bug-report]")))
+(defvar gnuplot-prompt-regexp
+ (regexp-opt '("gnuplot> " "multiplot> "))
+ "Regexp for recognizing the GNUPLOT prompt")
+
(defun gnuplot-protect-prompt-fn (string)
"Prevent the Gnuplot prompt from being deleted or overwritten.
STRING is the text as originally inserted in the comint buffer."
@@ -2200,7 +2205,7 @@ STRING is the text as originally inserted in the comint
buffer."
(beginning-of-line)
(point)))
e)
- (if (re-search-forward "^gnuplot> " (point-max) t)
+ (if (re-search-forward gnuplot-prompt-regexp (point-max) t)
(progn
(setq e (point))
(put-text-property b e 'rear-nonsticky '(read-only intangible
face))
@@ -2299,16 +2304,24 @@ display."
(message "Plot output will be displayed in gnuplot buffer.")))))
(defun gnuplot-inline-image-set-output ()
- "Set GNUPLOT's output file to `gnuplot-inline-image-filename'."
+ "Set Gnuplot's output file to `gnuplot-inline-image-filename'."
(let ((tmp (make-temp-file "gnuplot")))
(setq gnuplot-inline-image-filename tmp)
(gnuplot-send-hiding-output (format "set output '%s'\n" tmp))))
(defun gnuplot-insert-inline-image-output (string)
+ "Insert Gnuplot graphical output in the gnuplot-comint buffer.
+
+Called via `comint-preoutput-filter-functions' hook when
+`gnuplot-inline-image-mode' is enabled. Checks the status of the
+file `gnuplot-inline-image-filename'; if it exists and has
+nonzero size, inserts it as an inline image, stores a new
+temporary filename in `gnuplot-inline-image-filename', and
+updates Gnuplot with the appropriate 'set output' command."
(save-excursion
(goto-char (point-max))
(beginning-of-line)
- (when (looking-at "^gnuplot> ")
+ (when (looking-at gnuplot-prompt-regexp)
(let* ((filename gnuplot-inline-image-filename)
(size (nth 7 (file-attributes filename))))
(if (and size (> size 0))
@@ -2337,7 +2350,7 @@ display."
(with-current-buffer
(get-buffer-create gnuplot-hidden-output-buffer)
(insert string)
- (when (looking-back "gnuplot> ")
+ (when (looking-back gnuplot-prompt-regexp)
(with-current-buffer gnuplot-buffer
(remove-hook 'comint-preoutput-filter-functions
'gnuplot-discard-output t))))
- [nongnu] elpa/gnuplot 51756c3 015/184: Changed fetch-version-number to work with older gnuplots, (continued)
- [nongnu] elpa/gnuplot 51756c3 015/184: Changed fetch-version-number to work with older gnuplots, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 710854f 026/184: Fixed a bug in gnuplot-end-of-continuation at beginning of buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot cc4c45c 042/184: Merge branch 'context' of github.com:bruceravel/gnuplot-mode into context, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 8169bb8 045/184: Minor updates to info pages for some "set" commands, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot a4d00db 014/184: Added gnuplot-comint-mode. Improved completion, version check (?), ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot ca6841b 041/184: Added experimental context-sensitive completion and help code., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 7cb3975 047/184: Cleaned up the tokenizer and got rid of gnuplot-token-at-point., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot a276f0d 033/184: Fix bug #8: remove `eval-when-compile' from definition of `gnuplot-make-regexp', ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot cd73487 064/184: Remove other cruft, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 76cfd01 043/184: Lots of fixes to grammar, and some bugfixes., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 59f7a94 061/184: Better prompt tracking. Setup inline images on creating comint buffer.,
ELPA Syncer <=
- [nongnu] elpa/gnuplot 18dccc2 058/184: Merge branch 'context' into devel, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot d4f8c3a 082/184: display progress while running parse tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 6da76ee 052/184: Merge branch 'devel', ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot d26d498 062/184: Added a customization option for gnuplot-inline-image-mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot d70c94a 065/184: Better docstrings for context-sensitive and inline-image modes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 43effb0 068/184: Add gnuplot-context to makefiles., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot f0b1ea7 085/184: Update lists of font-lock keywords., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 70dd22e 060/184: Keyboard shortcut and menu item for toggling inline mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot a0fee02 086/184: use `many1' for iteration spec, and tweak its test case, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 2dc71de 077/184: Move window-full-height-p up with other compatibility hacks, ELPA Syncer, 2021/08/29