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

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

[nongnu] elpa/gnuplot 1488629 174/184: Fix font-lock not loading.


From: ELPA Syncer
Subject: [nongnu] elpa/gnuplot 1488629 174/184: Fix font-lock not loading.
Date: Sun, 29 Aug 2021 11:03:39 -0400 (EDT)

branch: elpa/gnuplot
commit 1488629061665317e404801bee5c1e11e5f886fd
Author: mtreca <maxime.treca@gmail.com>
Commit: mtreca <maxime.treca@gmail.com>

    Fix font-lock not loading.
    
    The code block responsible for loading gnuplot-font-lock and
    syntax-proprietizing functions was too eagerly deleted when removing
    XEmacs functionality. This fixes it.
---
 gnuplot.el | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/gnuplot.el b/gnuplot.el
index 584c939..76de056 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -1633,11 +1633,10 @@ buffer."
 
   (set-syntax-table gnuplot-mode-syntax-table)
 
-  (progn
-    (setq font-lock-defaults gnuplot-font-lock-defaults)
-    (set (make-local-variable 'parse-sexp-lookup-properties) t)
-    (set (make-local-variable 'syntax-propertize-function)
-         #'gnuplot-syntax-propertize))
+  (setq font-lock-defaults gnuplot-font-lock-defaults)
+  (set (make-local-variable 'parse-sexp-lookup-properties) t)
+  (set (make-local-variable 'syntax-propertize-function)
+         #'gnuplot-syntax-propertize)
 
   (add-hook 'kill-buffer-hook 'gnuplot-close-down nil t)
 
@@ -2586,6 +2585,17 @@ a list:
   (when (eq gnuplot-keywords-when 'immediately) ; <HW>
     (gnuplot-setup-info-look)) ;; <SE>
 
+  ;; Add syntax-propertizing functions to search for strings and comments
+  (set (make-local-variable 'syntax-propertize-function)
+       #'gnuplot-syntax-propertize)
+  (add-hook 'syntax-propertize-extend-region-functions
+            #'gnuplot-syntax-propertize-extend-region nil t)
+
+  ;; Set up font-lock
+  (setq font-lock-defaults gnuplot-font-lock-defaults)
+  (set (make-local-variable 'font-lock-multiline) t)
+  (set (make-local-variable 'parse-sexp-lookup-properties) t)
+
   (if (fboundp 'widget-create)          ; gnuplot-gui
       (condition-case ()
           (require 'gnuplot-gui)



reply via email to

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