diff options
author | Ryan Kavanagh <rak@rak.ac> | 2023-02-09 18:07:36 -0500 |
---|---|---|
committer | Ryan Kavanagh <rak@rak.ac> | 2023-02-09 18:07:36 -0500 |
commit | 150c9ccde7a8c6fca80e764c799df64b2d4a3271 (patch) | |
tree | c542bbbf1a817249467982a83d859746e0726826 /dot_emacs.d/local/dictem/dictem-lingvo-dsl.el | |
parent | xidle is configured by xresources instead of in xinitrc (diff) | |
parent | Squashed 'dot_emacs.d/local/dictem/' content from commit 078e608 (diff) |
Merge commit 'bf77e060f17055a5efa6941be7a94cb278d3935c' as 'dot_emacs.d/local/dictem'
Diffstat (limited to '')
-rw-r--r-- | dot_emacs.d/local/dictem/dictem-lingvo-dsl.el | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/dot_emacs.d/local/dictem/dictem-lingvo-dsl.el b/dot_emacs.d/local/dictem/dictem-lingvo-dsl.el new file mode 100644 index 0000000..35f92d5 --- /dev/null +++ b/dot_emacs.d/local/dictem/dictem-lingvo-dsl.el @@ -0,0 +1,67 @@ +;; -*- coding: utf-8; -*- + +(require 'dictem) + +(defun dictem-lingvo-dsl-highlight () + ; trn/ex/com/* + (goto-char (point-min)) + (while (search-forward-regexp "\\[/?trn\\]\\|\\[/?p\\]\\|\\[/?c\\]\\|\\[/?com\\]\\|\\[/?[*]\\]\\|\\[/?b\\]\\|\\[/?i\\]\\|\\[/?m[0-9]?\\]\\|\\[/?ex\\]" nil t) + (replace-match "" t t)) + + ; [ex] [/ex] +; (goto-char (point-min)) +; (while (search-forward-regexp "\\[ex\\]\\([][]*\\)\\[/ex\\]" nil t) +; (add-text-properties (match-beginning 0) (match-end 0) +; '(face dictem-lingvo-dsl-example-face)) +; (let* ((beg (match-beginning 1)) +; (end (match-end 1)) +; (repl (buffer-substring beg end))) +; (replace-match repl 1 1))) + + ; <<>> + (goto-char (point-min)) + (while (search-forward-regexp "\\(<<\\|\\[ref\\]\\)\\([^\n]*\\)\\(>>\\|\\[/ref\\]\\)" nil t) + (let* ((beg (match-beginning 2)) + (end (match-end 2)) + (repl (buffer-substring beg end))) + (replace-match (concat "{" repl "}") t t))) + + ; hyperlinks + (dictem-postprocess-definition-hyperlinks) + ) + +(progn + (set-buffer "*dsl-buffer*") + (dictem-lingvo-dsl-highlight)) + +(defface dictem-lingvo-dsl-italic-face + '((((background light)) (:italic true)) + (((background dark)) (:italic true))) + "Face for italic" + ) + +(defface dictem-lingvo-dsl-color-face + '((((background light)) (:italic true)) + (((background dark)) (:italic true))) + "Face for color" + ) + +(defface dictem-lingvo-dsl-example-face + '((((background light)) (:italic true)) + (((background dark)) (:italic true))) + "Face for color" + ) + +(defface dictem-lingvo-dsl-bold-face + '((((background light)) (:bold true)) + (((background dark)) (:bold true))) + "Face for bold" + ) + +(defface dictem-lingvo-dsl-trn-face + '((((background light)) (:bold true :italic true)) + (((background dark)) (:bold true :italic true))) + "Face for trn" + ) + +(provide 'dictem-lingvo-dsl) |