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

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

[nongnu] elpa/go-mode 7c5e9ad 303/495: Avoid warning because of font-loc


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 7c5e9ad 303/495: Avoid warning because of font-lock-syntactic-keywords
Date: Sat, 7 Aug 2021 09:05:36 -0400 (EDT)

branch: elpa/go-mode
commit 7c5e9ade4cf6036eb1eda8cc588b390927321f6e
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>

    Avoid warning because of font-lock-syntactic-keywords
    
    Use a macro to check for the existence syntax-propertize-function. That
    way, the byte compiler will optimize away one branch of the if, and not
    complain about our fallback use of font-lock-syntactic-keywords.
---
 go-mode.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/go-mode.el b/go-mode.el
index cde2567..7978fb6 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -46,6 +46,9 @@
 (defmacro go--xemacs-p ()
   `(featurep 'xemacs))
 
+(defmacro go--has-syntax-propertize-p ()
+  (boundp 'syntax-propertize-function))
+
 (defun go--delete-whole-line (&optional arg)
   "Delete the current line without putting it in the `kill-ring'.
 Derived from function `kill-whole-line'.  ARG is defined as for that
@@ -959,7 +962,7 @@ with goflymake \(see URL 
`https://github.com/dougm/goflymake'), gocode
   (set (make-local-variable 'end-of-defun-function) #'go-end-of-defun)
 
   (set (make-local-variable 'parse-sexp-lookup-properties) t)
-  (if (boundp 'syntax-propertize-function)
+  (if (go--has-syntax-propertize-p)
       (set (make-local-variable 'syntax-propertize-function) 
#'go-propertize-syntax)
     (set (make-local-variable 'font-lock-syntactic-keywords)
          go--font-lock-syntactic-keywords)



reply via email to

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