summaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2015-11-05 18:49:44 +0000
committerGuido Günther <agx@sigxcpu.org>2015-11-05 18:49:44 +0000
commit2974862f0094fb57ef646cc6c1716ccf62257d43 (patch)
treec8d0046a0ba7e83adf9c86029273c61c50e4966f /conf
parenteb3267eb5c876646a5d43ce1d83cc06786bb25d6 (diff)
Add some basic indentation
CVE- aligned to column 0, all the rest to 8 git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@37583 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'conf')
-rw-r--r--conf/cvelist.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/conf/cvelist.el b/conf/cvelist.el
index 789c671b52..03b5f56f91 100644
--- a/conf/cvelist.el
+++ b/conf/cvelist.el
@@ -35,8 +35,21 @@
("\\<end-of-life\\|not-affected\\|no-dsa\\>" . font-lock-constant-face))
"Keyword highlighting for `debian-cvelist-mode'")
+(defun debian-cvelist-is-cve ()
+ (save-excursion
+ (beginning-of-line)
+ (looking-at "[[:space:]]*CVE-")))
+
+(defun debian-cvelist-indent-line ()
+ "Indent current line as debian CVE list"
+ (beginning-of-line)
+ (if (debian-cvelist-is-cve)
+ (indent-line-to 0)
+ (indent-line-to 8)))
+
(define-derived-mode debian-cvelist-mode fundamental-mode "debian-cvelist"
"A major mode for editing data/CVE/list in the Debian secure-testing repo."
- (setq-local font-lock-defaults '(debian-cvelist-font-lock-keywords nil)))
+ (setq-local font-lock-defaults '(debian-cvelist-font-lock-keywords nil))
+ (setq indent-line-function 'debian-cvelist-indent-line))
(provide 'debian-cvelist)

© 2014-2024 Faster IT GmbH | imprint | privacy policy