diff options
author | Ryan Kavanagh <rak@rak.ac> | 2023-02-09 19:29:20 -0500 |
---|---|---|
committer | Ryan Kavanagh <rak@rak.ac> | 2023-02-09 19:29:20 -0500 |
commit | 1cd70a9954b6206de484f89ed7d71f2124c8c2cb (patch) | |
tree | 2d5b6ad8f8a2c7f3afb7238a980bacb642841053 /dot_emacs.d/local/dictem/dictem-lingvo-dsl.el | |
parent | elisp .emacs (diff) | |
parent | s-l should force xlock to immediately lock (diff) |
Merge remote-tracking branch 'refs/remotes/origin/master'
Diffstat (limited to 'dot_emacs.d/local/dictem/dictem-lingvo-dsl.el')
-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) |