[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/systemd 070e15e 060/131: autoload temp files generated by
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/systemd 070e15e 060/131: autoload temp files generated by sd's tempfn_random |
Date: |
Sun, 29 Aug 2021 11:35:15 -0400 (EDT) |
branch: elpa/systemd
commit 070e15e4c083c43c716a223168a27497d5bfdef9
Author: Mark Oteiza <mvoteiza@udel.edu>
Commit: Mark Oteiza <mvoteiza@udel.edu>
autoload temp files generated by sd's tempfn_random
* adds 16 random hex digits to the end of file name
* instead of a bunch of autoloads, draw regexp into a pair of defconst
* not sure how to splice a reusable list of extensions into an rx call,
which would be nicer than duplicating it
---
systemd.el | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/systemd.el b/systemd.el
index bef7bd0..5076009 100644
--- a/systemd.el
+++ b/systemd.el
@@ -73,6 +73,22 @@
:type 'boolean
:group 'systemd)
+(defconst systemd-autoload-regexp
+ (eval-when-compile
+ (rx "."
+ (or "automount" "busname" "mount" "service" "slice"
+ "socket" "swap" "target" "timer" "link" "netdev" "network")
+ string-end))
+ "Regexp for file buffers in which to autoload `systemd-mode'.")
+
+(defconst systemd-tempfn-autoload-regexp
+ (eval-when-compile
+ (rx (or "automount" "busname" "mount" "service" "slice"
+ "socket" "swap" "target" "timer" "link" "netdev" "network"
+ "override.conf")
+ (?? (= 16 (char hex-digit))) string-end))
+ "Regexp for temp file buffers in which to autoload `systemd-mode'.")
+
(defvar systemd-font-lock-keywords
`(("^\\([#;]\\)\\(.*\\)$"
(1 'font-lock-comment-delimiter-face)
@@ -178,18 +194,10 @@ file, defaulting to the link under point, if any."
["Open systemd.directives(7)" systemd-doc-directives
:help "Index of configuration directives"]))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.automount\\'" .
systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.busname\\'" . systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.mount\\'" . systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.service\\'" . systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.slice\\'" . systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.socket\\'" . systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.target\\'" . systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.timer\\'" . systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.link\\'" . systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.netdev\\'" . systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.network\\'" . systemd-mode))
-;;;###autoload (add-to-list 'auto-mode-alist '("\\.override\\.conf.*\\'" .
systemd-mode))
+;;;###autoload
+(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
(define-derived-mode systemd-mode conf-mode "Systemd"
- [nongnu] elpa/systemd 2a27186 023/131: format the list more programmatically, (continued)
- [nongnu] elpa/systemd 2a27186 023/131: format the list more programmatically, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 00a2520 028/131: add Package-Requires for emacs 24.3 (setq-local), ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 8e6a8ce 038/131: remove backslash escapes from doc completions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 968ae5e 039/131: bump for bug fix, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 57dcf5a 041/131: for some reason, this directive is missing, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 6071c23 046/131: version 1.3, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 175d45f 047/131: checkdoc, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 05dd16c 049/131: systemd 226, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd a2ec338 055/131: use loop, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 3eb9390 058/131: add lists of directives, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 070e15e 060/131: autoload temp files generated by sd's tempfn_random,
ELPA Syncer <=
- [nongnu] elpa/systemd a86323e 059/131: v229, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 9fc0545 061/131: move systemd-font-lock-keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd f306614 066/131: dang spaces, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd b004b37 068/131: autoload sorcery, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd de5da7f 073/131: update Makefile, ELPA Syncer, 2021/08/29
- [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