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 | 3a113b005e9da8d50ccb13d7313961933f946b44 (patch) | |
tree | 13ca19eddee359bd991d4c7a9ef2e8524e489d16 /conf | |
parent | bc11352795b3d111e23b8b4ba4846fb9669d5fca (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.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) |