branch: elpa/gnuplot
commit 58a1cf5fa98d0b5c46038779b4cc3b61e13b33d2
Author: Jonathan Oddie <[email protected]>
Commit: Jonathan Oddie <[email protected]>
Fixed horrible bug in gnuplot-in-string/gnuplot-in-comment
I forgot that syntax-ppss needs a save-excursion around it. Oops.
---
gnuplot.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/gnuplot.el b/gnuplot.el
index 186aa94..d5118eb 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -1691,8 +1691,9 @@ limit passed by font-lock."
(t "#")))
(begin (search-forward-regexp re limit t)))
;; Skip over anything which is already inside a string
- (while (and (gnuplot-in-string (1- (point)))
- (setq begin (search-forward re limit t))))
+ (when (> (point) (point-min))
+ (while (and (gnuplot-in-string (1- (point)))
+ (setq begin (search-forward-regexp re limit t)))))
(if (not begin)
nil ; Nothing found on this line
@@ -1768,16 +1769,18 @@ limit passed by font-lock."
If WHERE is omitted, defaults to text at point.
This is a simple wrapper for `syntax-ppss'."
- (let ((parse-state (syntax-ppss where)))
- (nth 3 parse-state)))
+ (save-excursion
+ (let ((parse-state (syntax-ppss where)))
+ (nth 3 parse-state))))
(defun gnuplot-in-comment (&optional where)
"Returns non-nil if the text at WHERE is within a comment.
If WHERE is omitted, defaults to text at point.
This is a simple wrapper for `syntax-ppss'."
- (let ((parse-state (syntax-ppss where)))
- (nth 4 parse-state)))
+ (save-excursion
+ (let ((parse-state (syntax-ppss where)))
+ (nth 4 parse-state))))
(defun gnuplot-in-string-or-comment (&optional where)
(or (gnuplot-in-string where)