From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: Clean up org-faces.el Date: Sun, 08 Apr 2018 23:53:32 +0800 Message-ID: <87fu45bsoz.fsf@gmail.com> References: <871sfpg75y.fsf@gmx.us> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5CdZ-0000WU-Up for emacs-orgmode@gnu.org; Sun, 08 Apr 2018 11:53:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5CdV-0000n7-Hv for emacs-orgmode@gnu.org; Sun, 08 Apr 2018 11:53:50 -0400 Received: from [183.249.132.203] (port=10038 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5CdV-0000al-2B for emacs-orgmode@gnu.org; Sun, 08 Apr 2018 11:53:45 -0400 In-reply-to: <871sfpg75y.fsf@gmx.us> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Rasmus Cc: emacs-orgmode@gnu.org =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Add face for inline src: src_ruby{require 'library'} Here is my custom face: ;; inline code face =3D> 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) =E2=80=A6) ;; Highlight group Ni in REGEXP with FACEi ;; ;; src_lang{code...}[:header arguments] / NOTE: override by `org-verbatim'. ;; result in following =3D[result]=3D ;; 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_[]()[] ... (font-lock-add-keywords 'org-mode '(("\\(call_\\)\\([^[(]*\\)\\[\\(.*\\)\\](\\(.*\\))\\[\\(.*\\)\\]" ;; "\\(call_\\)\\([^[(]*\\)\\([([][^)]*]\\)+" (1 '(:foreground "orange red" :height 0.6)) ; call_ (2 '(:foreground "yellow" :weight 'bold :underline "dark gray")) ; (3 '(:foreground "gray" :height 0.6)) ; [] (4 '(:foreground "cyan" :weight 'bold)) ; () (5 '(:foreground "gray" :height 0.6)) ; [] )) 'append) ;; call_[]() (font-lock-add-keywords 'org-mode '(("\\(call_\\)\\([^[(]*\\)\\[\\(.*\\)\\](\\(.*\\))" (1 '(:foreground "orange red" :height 0.6)) ; call_ (2 '(:foreground "yellow" :weight 'bold :underline "dark gray")) ; (3 '(:foreground "gray" :height 0.6)) ; [] (4 '(:foreground "cyan" :weight 'bold)) ; () )) 'append) ;; call_(arguments) (font-lock-add-keywords 'org-mode '(("\\(call_\\)\\([^[(]*\\)\\((.*)\\)" (1 '(:foreground "orange red" :height 0.6)) ; call_ (2 '(:foreground "yellow" :weight 'bold :underline "dark gray")) ; (3 '(:foreground "cyan" :weight 'bold)) ; () )) 'append) =2D --=20 [ stardiviner ] don't need to convince with trends. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 =20=20=20=20=20=20 =2D----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAlrKOvwACgkQG13xyVro msPuAwf/WNhzQi6UNCfO/Oeb6Mh5O+OwXK9wDU8rZI+pxN17XrBhGEqsLgDUO3RF W/vmMs49a1C45Id5xlRZXiZ16oC6nuIWjP4W7syorf7WIZismk6AncsATin5DfiG TzrmZ2jjpHhucr8kjbCji3r5/ch/JZUJ52MQVsmD4MqyG/RSVUknbDRJD0qWsaxJ AComyyaNqQbtWPwi0s896RKa+aWPTXg62Yq26Z0k5ANwh022APRu/ona4FIVMmbN fEGflIgfXmDPkqZg9O8v9WPVwq0ZhA4kc+3+Efkatwf9nmPW2BtHi2eTo/+c50Jh WgwPhqMf7CYdUUEOaxx4UdqcDe1JUQ=3D=3D =3DbJNn =2D----END PGP SIGNATURE-----