diff options
author | Guido Günther <agx@sigxcpu.org> | 2015-11-05 18:49:44 +0000 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-11-05 18:49:44 +0000 |
commit | 2b2b482c036cada4a81496d6bea10de9c7ee88c9 (patch) | |
tree | ea8e3ee2285161432162f2a3f0a6a69a0d4e777f /conf/cvelist.el | |
parent | 6f6a2d86065b698ee71a5d32ebef1a3b903c2c26 (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/cvelist.el')
-rw-r--r-- | conf/cvelist.el | 15 |
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) |