emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/gnuplot 35a8a19 108/184: Check for `syntax-propertize-func


From: ELPA Syncer
Subject: [nongnu] elpa/gnuplot 35a8a19 108/184: Check for `syntax-propertize-function' when defining syntax-table
Date: Sun, 29 Aug 2021 11:03:26 -0400 (EDT)

branch: elpa/gnuplot
commit 35a8a19d8b23c5bebd10180a8cc6b049f33cf046
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>

    Check for `syntax-propertize-function' when defining syntax-table
    
    In pre-24 Emacs which lack `syntax-propertize', syntax parsing of
    strings and comments can be done by the normal syntax-table mechanism,
    which works OK except for the corner cases.
---
 gnuplot.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/gnuplot.el b/gnuplot.el
index 3af5f31..88fce08 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -1664,19 +1664,21 @@ static char *help_btn[] = {
 
     (modify-syntax-entry ?_ "w" table )
 
-    ;; In GNU Emacs we scan for strings and comments ourselves in
-    ;; `gnuplot-scan-after-change'.  I can't get this to work in xemacs,
-    ;; so there we'll make ", ', and # delimiters as normal, and use the
-    ;; built-in parser
-    (if (featurep 'xemacs)
+    ;; In GNU Emacs >=24 we can use `syntax-propertize-function' to
+    ;; accurately scan for strings and comments (see
+    ;; `gnuplot-syntax-propertize').  If there's no
+    ;; `syntax-propertize', fall back to using the built-in parser and
+    ;; making ", ', and # string or comment delimiters as normal.
+    (if (not (boundp 'syntax-propertize-function))
        (progn
          (modify-syntax-entry ?\' "\"" table)
          (modify-syntax-entry ?# "<" table)
          (modify-syntax-entry ?\n ">" table)
          (modify-syntax-entry ?\\ "\\" table))
 
-      ;; GNU Emacs: Make ", ', and # punctuation, so the built-in parser
-      ;; doesn't interfere with them
+      ;; When syntax-propertize is available, ", ', and # should be
+      ;; punctuation so that the built-in parser doesn't interfere
+      ;; with the syntax-propertize search.
       (modify-syntax-entry ?\" "." table)
       (modify-syntax-entry ?\' "." table)
       (modify-syntax-entry ?` "." table)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]