[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Clean up org-faces.el
From: |
stardiviner |
Subject: |
Re: [O] Clean up org-faces.el |
Date: |
Sun, 08 Apr 2018 23:53:32 +0800 |
User-agent: |
mu4e 1.0; emacs 27.0.50 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Add face for inline src: src_ruby{require 'library'}
Here is my custom face:
;; inline code face => src_ruby{require 'something'}
;;
;; (REGEXP . FACE)
;; Highlight REGEXP with FACE
;; (REGEXP N FACE)
;; Highlight group N in REGEXP with FACE
;; (REGEXP (N1 FACE1) (N2 FACE2) (N3 FACE3) …)
;; Highlight group Ni in REGEXP with FACEi
;;
;; src_lang{code...}[:header arguments] / NOTE: override by `org-verbatim'.
;; result in following =[result]=
;; src_
(font-lock-add-keywords
'org-mode
'(("\\(src_\\)\\([^[{]+\\)\\(\\[:.*\\]\\)\\({\\)\\([^}]*\\)\\(}\\)"
(1 '(:foreground "black" :weight 'normal :height 0.1)) ; src_ part
(2 '(:foreground "cyan" :weight 'bold :height 0.8 :box '(:color "light
gray"))) ; "lang" part.
(3 '(:foreground "#555555" :height 0.7)) ; [:header arguments] part.
(4 '(:foreground "#333333")) ; {
(5 'org-code) ; "code..." part.
(6 '(:foreground "#333333")) ; }
))
'append)
;; src without arguments
(font-lock-add-keywords
'org-mode
'(("\\(src_\\)\\([^[{]+\\)\\({\\)\\([^}]*\\)\\(}\\)"
(1 '(:foreground "black" :weight 'normal :height 0.1)) ; src_ part
(2 '(:foreground "cyan" :weight 'bold :height 0.8 :box '(:color "light
gray"))) ; "lang" part.
(3 '(:foreground "#333333")) ; {
(4 'org-code) ; "code..." part.
(5 '(:foreground "#333333")) ; }
))
'append)
;; inline babel call
;; ... call_<name>[<inside header arguments>](<arguments>)[<end header
arguments>] ...
(font-lock-add-keywords
'org-mode
'(("\\(call_\\)\\([^[(]*\\)\\[\\(.*\\)\\](\\(.*\\))\\[\\(.*\\)\\]"
;; "\\(call_\\)\\([^[(]*\\)\\([([][^)]*]\\)+"
(1 '(:foreground "orange red" :height 0.6)) ; call_
(2 '(:foreground "yellow" :weight 'bold :underline "dark gray")) ; <name>
(3 '(:foreground "gray" :height 0.6)) ; [<inside header arguments>]
(4 '(:foreground "cyan" :weight 'bold)) ; (<arguments>)
(5 '(:foreground "gray" :height 0.6)) ; [<end header arguments>]
))
'append)
;; call_<name>[<inside header arguments>](<arguments>)
(font-lock-add-keywords
'org-mode
'(("\\(call_\\)\\([^[(]*\\)\\[\\(.*\\)\\](\\(.*\\))"
(1 '(:foreground "orange red" :height 0.6)) ; call_
(2 '(:foreground "yellow" :weight 'bold :underline "dark gray")) ; <name>
(3 '(:foreground "gray" :height 0.6)) ; [<inside header argument>]
(4 '(:foreground "cyan" :weight 'bold)) ; (<arguments>)
))
'append)
;; call_<name>(arguments)
(font-lock-add-keywords
'org-mode
'(("\\(call_\\)\\([^[(]*\\)\\((.*)\\)"
(1 '(:foreground "orange red" :height 0.6)) ; call_
(2 '(:foreground "yellow" :weight 'bold :underline "dark gray")) ; <name>
(3 '(:foreground "cyan" :weight 'bold)) ; (<arguments>)
))
'append)
- --
[ stardiviner ] don't need to convince with trends.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAlrKOvwACgkQG13xyVro
msPuAwf/WNhzQi6UNCfO/Oeb6Mh5O+OwXK9wDU8rZI+pxN17XrBhGEqsLgDUO3RF
W/vmMs49a1C45Id5xlRZXiZ16oC6nuIWjP4W7syorf7WIZismk6AncsATin5DfiG
TzrmZ2jjpHhucr8kjbCji3r5/ch/JZUJ52MQVsmD4MqyG/RSVUknbDRJD0qWsaxJ
AComyyaNqQbtWPwi0s896RKa+aWPTXg62Yq26Z0k5ANwh022APRu/ona4FIVMmbN
fEGflIgfXmDPkqZg9O8v9WPVwq0ZhA4kc+3+Efkatwf9nmPW2BtHi2eTo/+c50Jh
WgwPhqMf7CYdUUEOaxx4UdqcDe1JUQ==
=bJNn
-----END PGP SIGNATURE-----