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

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

[nongnu] elpa/nix-mode 86b7195b3e 010/500: Use warning font lock for upp


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode 86b7195b3e 010/500: Use warning font lock for upper case vars
Date: Sat, 29 Jan 2022 08:26:26 -0500 (EST)

branch: elpa/nix-mode
commit 86b7195b3e0597b28e92ebba36568676ad9f1916
Author: Matthew Justin Bauer <mjbauer95@gmail.com>
Commit: GitHub <noreply@github.com>

    Use warning font lock for upper case vars
    
    warn on upper case variable names consistent with styling
---
 nix-mode.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/nix-mode.el b/nix-mode.el
index 3a613e9a3b..067e8d09d4 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -59,10 +59,15 @@
     ("\\_<toString\\_>" . font-lock-builtin-face)
     ("\\_<true\\_>" . font-lock-builtin-face)
 
+    ;; variable assignments
+    ;; warn on upper case variable names
+    ("\\<\\([A-Z_][a-zA-Z0-9_'\-\.]*\\)[ \t]*="
+     (1 font-lock-warning-face nil nil) ;; capitalized
+    ("\\<\\([a-z][a-zA-Z0-9_'\-\.]*\\)[ \t]*="
+     (1 font-lock-variable-name-face nil nil)) ;; uncapitalized
+
     ("[a-zA-Z][a-zA-Z0-9\\+-\\.]*:[a-zA-Z0-9%/\\?:@&=\\+\\$,_\\.!~\\*'-]+"
      . font-lock-constant-face)
-    ("\\<\\([a-zA-Z_][a-zA-Z0-9_'\-\.]*\\)[ \t]*="
-     (1 font-lock-variable-name-face nil nil))
     ("<[a-zA-Z0-9._\\+-]+\\(/[a-zA-Z0-9._\\+-]+\\)*>"
      . font-lock-constant-face)
     ("[a-zA-Z0-9._\\+-]*\\(/[a-zA-Z0-9._\\+-]+\\)+"



reply via email to

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