[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 7ce031c 481/495: Allow disabling variable font loc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 7ce031c 481/495: Allow disabling variable font locking. |
Date: |
Sat, 7 Aug 2021 09:06:13 -0400 (EDT) |
branch: elpa/go-mode
commit 7ce031ce8f534271f5a8eccac5c04601796bb0d3
Author: Muir Manders <muir@mnd.rs>
Commit: Peter Sanford <psanford@sanford.io>
Allow disabling variable font locking.
Add go-fontify-variables setting which can be used to disable variable
coloring.
Closes: #343 [via git-merge-pr]
---
go-mode.el | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index 8bcc8e4..a3fc9c0 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -130,6 +130,11 @@ constant is changed.")
:type 'boolean
:group 'go)
+(defcustom go-fontify-variables t
+ "Fontify variable declarations if this is non-nil."
+ :type 'boolean
+ :group 'go)
+
(defcustom go-mode-hook nil
"Hook called by `go-mode'."
:type 'hook
@@ -402,6 +407,9 @@ For mode=set, all covered lines will have this weight."
st)
"Syntax table for Go mode.")
+(defvar go--default-face 'default
+ "A variable to refer to `default' face for use in font lock rules.")
+
(defun go--build-font-lock-keywords ()
;; we cannot use 'symbols in regexp-opt because GNU Emacs <24
;; doesn't understand that
@@ -419,7 +427,7 @@ For mode=set, all covered lines will have this weight."
;; Post-match form that runs after last sub-match.
(go--fontify-param-post)
;; Subexp 1 is the param variable name, if any.
- (1 font-lock-variable-name-face)
+ (1 ,(if go-fontify-variables 'font-lock-variable-name-face
'go--default-face))
;; Subexp 2 is the param type name, if any. We set the LAXMATCH
;; flag to allow optional regex groups.
(2 font-lock-type-face nil t)))
@@ -437,7 +445,7 @@ For mode=set, all covered lines will have this weight."
;; Match variable names in var decls, constant names in const
;; decls, and type names in type decls.
(go--match-decl
- (1 font-lock-variable-name-face nil t)
+ (1 ,(if go-fontify-variables 'font-lock-variable-name-face
'go--default-face) nil t)
(2 font-lock-constant-face nil t)
(3 font-lock-type-face nil t))
- [nongnu] elpa/go-mode a82369b 453/495: Readme: add basic information about gopls., (continued)
- [nongnu] elpa/go-mode a82369b 453/495: Readme: add basic information about gopls., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 839190b 455/495: Run all tests in GH CI, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7248358 462/495: Fontify type names in type switch statements, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4fabba6 464/495: Small fix for fontification of array types, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 656590a 463/495: Fontify qualified composite literal types., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d304565 474/495: Fix signature fontification after comments., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e9b9c0e 473/495: Add some fontification faces for go-dot-mod-mode., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4acf733 468/495: Fully fontify type and const decls., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dac200f 469/495: Fix font locking in nested signatures., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fa2162b 475/495: Fix "nil" fontification in type switch clause., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7ce031c 481/495: Allow disabling variable font locking.,
ELPA Syncer <=
- [nongnu] elpa/go-mode e10d677 478/495: indent: fix func literals in dangling lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c9f5e92 483/495: Fix indentation of chained dangling selectors., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fdf46fe 492/495: Fix go.mod fontification., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e8eea7f 487/495: Fix fontification of multiline type switch clauses., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2f2910c 223/495: fix end-of-defun for function with inline struct/interface arguments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f1adac0 230/495: switch versioning to semver, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d9f0bee 232/495: add variable to customize godef command, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3da268f 285/495: README: improve description of new functions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9047fcd 238/495: add a menu, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 466e188 239/495: add `go-play-browse-function', ELPA Syncer, 2021/08/07