[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/systemd 23c0caf 115/131: extend anchored matches past the
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/systemd 23c0caf 115/131: extend anchored matches past the current line if \ broken |
Date: |
Sun, 29 Aug 2021 11:35:25 -0400 (EDT) |
branch: elpa/systemd
commit 23c0caf214ee1ed92eb12a0d7b613682f4091979
Author: Mark Oteiza <mvoteiza@udel.edu>
Commit: Mark Oteiza <mvoteiza@udel.edu>
extend anchored matches past the current line if \ broken
---
systemd.el | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/systemd.el b/systemd.el
index 807ebd9..3ce5d32 100644
--- a/systemd.el
+++ b/systemd.el
@@ -266,6 +266,14 @@ file, defaulting to the link under point, if any."
(1 (when (systemd-construct-start-p) (string-to-syntax "<")))))
start end)))
+(defun systemd-value-extend-region ()
+ "Return the EOL position of the last line of the construct at point."
+ (while (and (= (char-before (line-end-position)) ?\\)
+ (skip-chars-forward " \t")
+ (not (memq (following-char) '(?# ?\;)))
+ (zerop (forward-line))))
+ (line-end-position))
+
(defun systemd-font-lock-extend-region ()
(goto-char font-lock-beg)
(while (and (zerop (forward-line -1))
@@ -274,11 +282,7 @@ file, defaulting to the link under point, if any."
(not (memq (following-char) '(?# ?\;)))))
(setq font-lock-beg (point-marker))
(goto-char font-lock-end)
- (while (and (= (char-before (line-end-position)) ?\\)
- (skip-chars-forward " \t")
- (not (memq (following-char) '(?# ?\;)))
- (zerop (forward-line))))
- (setq font-lock-end (line-end-position)))
+ (setq font-lock-end (systemd-value-extend-region)))
(defmacro define-systemd-matcher (name regexp &optional docstring)
"Define a new function NAME that matches REGEXP in a multi-line construct.
@@ -330,9 +334,11 @@ See `font-lock-keywords' and (info \"(elisp) Search-based
Fontification\")."
(systemd-exec-prefix-anchored-matcher
nil nil (0 'font-lock-negation-char-face))
;; environment variables
- ("\\$[A-Z_]+\\>" nil nil (0 'font-lock-variable-name-face))
+ ("\\$[A-Z_]+\\>"
+ (systemd-value-extend-region) nil (0 'font-lock-variable-name-face))
;; specifiers
- ("%[nNpPiIfcrRtuUhsmbHv%]" nil nil (0 'font-lock-constant-face))))
+ ("%[nNpPiIfcrRtuUhsmbHv%]"
+ (systemd-value-extend-region) nil (0 'font-lock-constant-face))))
"Extended expressions to highlight in `systemd-mode'.")
(defconst systemd-font-lock-keywords-3
- [nongnu] elpa/systemd 63d64ad 076/131: generate directive lists from files, (continued)
- [nongnu] elpa/systemd 63d64ad 076/131: generate directive lists from files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd fe443ac 078/131: use font-lock-defaults to disable syntax highlighting, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 2e1f739 081/131: update readme, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 4c073b0 091/131: missed one, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 4c1b2be 097/131: bump, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd bd94a2c 094/131: shim in support for nspawn settings files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 28601d8 101/131: woops, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 2c71ec5 103/131: systemd 234.11, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 16ba942 113/131: rename tests directory, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 839094d 114/131: use rx here, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 23c0caf 115/131: extend anchored matches past the current line if \ broken,
ELPA Syncer <=
- [nongnu] elpa/systemd 228f0b9 119/131: happy new year, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd e97f78e 120/131: Add %S, %C, %L specifiers, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd eaaf16f 033/131: fix indentation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd cf435f4 034/131: convolute sexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 2b70f83 035/131: these groups need not be nested, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 807c748 044/131: systemd 225, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 0f2f936 052/131: clarify parent mode hooks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd aa9f4f6 053/131: update commentary, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd bf39be2 062/131: assimilate systemd-company.el into systemd.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 3580191 067/131: add autoload regex tests, ELPA Syncer, 2021/08/29