summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scdoc-mode.el61
1 files changed, 49 insertions, 12 deletions
diff --git a/scdoc-mode.el b/scdoc-mode.el
index e95af48..ea9877d 100644
--- a/scdoc-mode.el
+++ b/scdoc-mode.el
@@ -16,27 +16,64 @@
;;; Code:
-(defvar scdoc-level-1 'org-level-1)
-(defvar scdoc-level-2 'org-level-2)
-(defvar scdoc-level-3 'org-level-3)
+(defface scdoc-level-1-face
+ '((t :inherit org-level-1))
+ "Face for scdoc level 1 headings."
+ :group 'scdoc-faces)
+(defvar scdoc-level-1-face 'scdoc-level-1-face)
+
+(defface scdoc-level-2-face
+ '((t :inherit org-level-2))
+ "Face for scdoc level 2 headings."
+ :group 'scdoc-faces)
+(defvar scdoc-level-2-face 'org-level-2-face)
-(defvar scdoc-underline-face 'underline)
+(defface scdoc-line-break-face
+ '((t :inherit font-lock-warning-face))
+ "Face for scdoc manual line break markers."
+ :group 'scdoc-faces)
+(defvar scdoc-line-break-face 'scdoc-line-break-face)
+
+(defface scdoc-underline-face
+ '((t :inherit underline))
+ "Face for scdoc underlined text."
+ :group 'scdoc-faces)
+(defvar scdoc-underline-face 'scdoc-underline)
(defface scdoc-bold-face
- '((t :weight bold))
- "Plain bold face."
+ '((t :weight extra-bold))
+ "Face for scdoc bolded text."
:group 'scdoc-faces)
(defvar scdoc-bold-face 'scdoc-bold-face)
+(defface scdoc-man-face
+ '((t :inherit font-lock-builtin-face
+ :weight extra-bold))
+ "Face for scdoc references to manpages."
+ :group 'scdoc-faces)
+(defvar scdoc-man-face 'scdoc-man-face)
+
+(defface scdoc-literal-face
+ '((t :inherit font-lock-comment-delimiter-face))
+ "Face for scdoc literal blocks."
+ :group 'scdoc-faces)
+(defvar scdoc-literal-face 'scdoc-literal-face)
+
+(defface scdoc-comment-face
+ '((t :inherit font-lock-comment-face))
+ "Face for scdoc comments."
+ :group 'scdoc-faces)
+(defvar scdoc-comment-face 'scdoc-comment-face)
+
(defvar scdoc-faces
'(("^# .*" . scdoc-level-1) ; Heading 1
("^## .*" . scdoc-level-2) ; Heading 2
- ("^### .*" . scdoc-level-3) ; Heading 3
- ("++$" . font-lock-warning-face) ; Line break
- ("^```$" . font-lock-comment-delimiter-face) ; Literal text
- ("^; .*" . font-lock-comment-face) ; Comments
- ("_.*_" . scdoc-underline-face) ; Undsky blerlines
- ("\*.*\*" . scdoc-bold-face) ; Bold
+ ("++$" . scdoc-line-break-face) ; Line break
+ ("\\(\\s-\\|^\\)_.*_" . scdoc-underline-face) ; Underlines
+ ("\\*.*\\*" . scdoc-bold-face) ; Bold
+ ("^```$" . scdoc-literal-face) ; Literal text
+ ("^; .*" . scdoc-comment-face) ; Comments
+ ("\\(\\s-\\|^\\)\\sw*\([0-9]\)" . scdoc-man-face) ; References to manpages
))
(define-derived-mode scdoc-mode text-mode "scdoc"