summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/emacs-highlight-stages-add-gexp.patch
blob: 931355b4fea7e1c45a1ba97f16ac2e93b3817e73 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Copyright © 2017 Oleg Pykhalov <go.wigust@gmail.com>
Copyright © 2017 Ludovic Courtès <ludo@gnu.org>

This patch adds highlighting for (guix) G-Expressions.

diff --git a/highlight-stages.el b/highlight-stages.el
index 3094c3c..e11260e 100644
--- a/highlight-stages.el
+++ b/highlight-stages.el
@@ -237,14 +237,14 @@ non-nil, (match-string 0) must be the expression matched."
 
 (defun highlight-stages-lisp-quote-matcher (&optional limit)
   (when (highlight-stages--search-forward-regexp
-         "\\(?:`\\|\\(#?'\\)\\)\\|([\s\t\n]*\\(?:backquote\\|\\(quote\\)\\)[\s\t\n]+" limit)
+         "\\(?:`\\|\\(#?'\\)\\)\\|([\s\t\n]*\\(?:backquote\\|\\(quote\\)\\)[\s\t\n]+\\|\\(?:#~\\)\\|([\s\t\n]*\\(?:gexp\\)[\s\t\n]+" limit)
     (prog1 (if (or (match-beginning 1) (match-beginning 2)) 'real t)
       (set-match-data
        (list (point)
              (progn (ignore-errors (forward-sexp 1)) (point)))))))
 
 (defun highlight-stages-lisp-escape-matcher (&optional limit)
-  (when (highlight-stages--search-forward-regexp ",@?\\|([\s\t\n]*\\\\,@?+[\s\t\n]+" limit)
+  (when (highlight-stages--search-forward-regexp ",@?\\|([\s\t\n]*\\\\,@?+[\s\t\n]+\\|\\(unquote\\)\\|\\(unquote-splicing\\)\\|\\(ungexp-native\\)\\|\\(ungexp-splicing\\)\\|\\(ungexp-native-splicing\\)\\|\\(ungexp\\)\\|#\\$" limit)
     (set-match-data
      (list (point)
            (progn (ignore-errors (forward-sexp 1)) (point))))