[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/systemd a434645 063/131: improvements to autoload regexen
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/systemd a434645 063/131: improvements to autoload regexen |
Date: |
Sun, 29 Aug 2021 11:35:15 -0400 (EDT) |
branch: elpa/systemd
commit a434645e766f69144fbb4047ddbeb5f4b8ebf0f6
Author: Mark Oteiza <mvoteiza@udel.edu>
Commit: Mark Oteiza <mvoteiza@udel.edu>
improvements to autoload regexen
many thanks to @Lompik
* don't match empty unit names. AIUI unit names are alphanumeric with
the exception of the group [-_.@], non ascii are backslash-escaped.
* more strictly match temp file names: .# prefix, [[:hexdigit:]]{16}
suffix. the filenames are a unit name with a unit suffix (systemctl
edit --full) or just override.conf (edit without --full option)
* add regex for dropin config files. This is just a file with ".conf"
extension, with the added constraint that it's a file having some
parent directory named "systemd"
---
systemd.el | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/systemd.el b/systemd.el
index 850448e..d6ae0a2 100644
--- a/systemd.el
+++ b/systemd.el
@@ -199,7 +199,7 @@
(defconst systemd-autoload-regexp
(eval-when-compile
- (rx "."
+ (rx (+? (or alphanumeric (any "-_.@\\"))) "."
(or "automount" "busname" "mount" "service" "slice"
"socket" "swap" "target" "timer" "link" "netdev" "network")
string-end))
@@ -207,12 +207,20 @@
(defconst systemd-tempfn-autoload-regexp
(eval-when-compile
- (rx (or "automount" "busname" "mount" "service" "slice"
- "socket" "swap" "target" "timer" "link" "netdev" "network"
+ (rx ".#"
+ (or (and (+? (or alphanumeric (any "-_.@\\"))) "."
+ (or "automount" "busname" "mount" "service" "slice"
+ "socket" "swap" "target" "timer" "link" "netdev"
"network"))
"override.conf")
- (?? (= 16 (char hex-digit))) string-end))
+ (= 16 (char hex-digit)) string-end))
"Regexp for temp file buffers in which to autoload `systemd-mode'.")
+(defconst systemd-dropin-autoload-regexp
+ (eval-when-compile
+ (rx "/systemd/" (+? anything) ".d/"
+ (+? (or alphanumeric (any "-_.@\\"))) ".conf" string-end))
+ "Regexp for dropin config file buffers in which to autoload `systemd-mode'.")
+
(defun systemd-get-value (start)
"Return the value of the key whose value begins at position START.
Lines ending in a backslash are concatenated with the next
@@ -357,6 +365,8 @@ See systemd.unit(5) for details on unit file syntax.")
(add-to-list 'auto-mode-alist `(,systemd-autoload-regexp . systemd-mode))
;;;###autoload
(add-to-list 'auto-mode-alist `(,systemd-tempfn-autoload-regexp .
systemd-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist `(,systemd-dropin-autoload-regexp .
systemd-mode))
;;;###autoload
(define-derived-mode systemd-mode conf-mode "Systemd"
- [nongnu] elpa/systemd b561c6b 093/131: happy new year, (continued)
- [nongnu] elpa/systemd b561c6b 093/131: happy new year, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 47ae79a 112/131: Use syntax-propertize and font-lock-extend-region-functions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 22f024f 118/131: systemd 235, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd c6e06df 123/131: happy new year, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 5b68986 024/131: add C-c C-d for opening systemd.directives(7), ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 09bfb67 030/131: explicitly require cl-lib, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 077b294 036/131: no change in systemd 220, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd f69d903 040/131: add missing network directives, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 1513dd0 054/131: systemd 228, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd dbf7830 057/131: happy new year, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd a434645 063/131: improvements to autoload regexen,
ELPA Syncer <=
- [nongnu] elpa/systemd 4121a9a 064/131: section names can be prefixed with X-, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 5cb70eb 069/131: change dropin filename restrictions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 378eb36 077/131: nix some quotes. use some rx, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd a08af4c 080/131: systemd 230 directives, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 0e793b0 082/131: put the quotes back. faces are symbols, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 0a4b6c4 089/131: shrug, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd a2c60f4 096/131: happy belated new year, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 6884c8f 098/131: systemd 233?, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 995ebbe 106/131: add conventional environment variable highlighting, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 3ff4f0f 108/131: anchor some matchers to follow "=", ELPA Syncer, 2021/08/29