[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/systemd 930e82e 100/131: font lock additional exec prefix
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/systemd 930e82e 100/131: font lock additional exec prefix |
Date: |
Sun, 29 Aug 2021 11:35:23 -0400 (EDT) |
branch: elpa/systemd
commit 930e82e5fefe8a8a05bb0145002380287bb4ec02
Author: Mark Oteiza <mvoteiza@udel.edu>
Commit: Mark Oteiza <mvoteiza@udel.edu>
font lock additional exec prefix
---
systemd.el | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/systemd.el b/systemd.el
index 1b79065..3e7f6f3 100644
--- a/systemd.el
+++ b/systemd.el
@@ -202,6 +202,21 @@ file, defaulting to the link under point, if any."
(interactive)
(systemd-doc-man "systemd.directives(7)"))
+(defun systemd-exec-prefix-anchored-matcher (limit)
+ "Matcher for the exec prefix in anchored font-lock rule.
+See `font-lock-keywords' and (info \"(elisp) Search-based Fontification\")."
+ (let ((pos (car (match-data)))
+ (prefixes '(?- ?@ ?+))
+ char end res)
+ (while (and (memq (setq char (following-char)) prefixes)
+ (< (point) limit))
+ (forward-char)
+ (setq prefixes (delq char prefixes))
+ (setq end (point-marker)))
+ (when end
+ (prog1 (setq res (list (1+ pos) end))
+ (set-match-data res)))))
+
(defun systemd-buffer-section-p ()
"Return t if current line begins with \"[\", otherwise nil."
(save-excursion
@@ -255,16 +270,16 @@ file, defaulting to the link under point, if any."
("^\\(\\[\\([[:upper:]][[:alnum:]]+\\|X-.*?\\)\\]\\)"
1 'font-lock-type-face)
;; keys
- ("^\\([[:upper:]][[:alnum:]]+\\)="
- 1 'font-lock-keyword-face)
+ ("^\\([[:upper:]][[:alnum:]]+\\)=" 1 'font-lock-keyword-face)
;; boolean arguments
(,(rx "=" (group (or "yes" "true" "on" "0" "no" "false" "off")) eol)
1 'font-lock-constant-face)
;; specifiers
("%[nNpPiIfcrRtuUhsmbHv%]" 0 'font-lock-constant-face)
;; exec prefixes
- ;; TODO account for @ being a prefix now
- ("=\\(-@\\|@-\\|[@-]\\)" 1 'font-lock-negation-char-face)))
+ ("="
+ (systemd-exec-prefix-anchored-matcher
+ nil nil (0 'font-lock-negation-char-face)))))
"Default expressions to highlight in `systemd-mode'.
See systemd.unit(5) for details on unit file syntax.")
- [nongnu] elpa/systemd 347c157 031/131: lexical binding, (continued)
- [nongnu] elpa/systemd 347c157 031/131: lexical binding, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd e7a2efb 021/131: mention `package-install-file` in README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd ed00e3f 029/131: require 24.4 (with-eval-after-load), ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd ef24360 037/131: spaces unneeded in syntax table modifications, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 0c871fc 042/131: Use four different candidate lists:, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 602d9d3 050/131: reword some commentary, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 6fd29c5 070/131: font lock keywords: comments and sections, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd ff523bc 071/131: woops, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 2e6309d 002/131: add systemd-mode.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 37541b2 003/131: add facility for browsing documentation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 930e82e 100/131: font lock additional exec prefix,
ELPA Syncer <=
- [nongnu] elpa/systemd 9cfd315 102/131: simplify, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 1e7567a 117/131: prepare v1.6, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 077aedd 125/131: systemd 244 directives, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 53b44ad 001/131: initial commit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 7bdb35a 032/131: mention package archive in README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 3cb77a5 013/131: add a link, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd a46e81b 017/131: autoload for slice units, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd b03e616 079/131: bump, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd a1633c2 083/131: systemd 231 directives, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 7769000 086/131: bump to 0.4.1, ELPA Syncer, 2021/08/29