Browse Source

Add macros fontifications

* org.el (org-set-font-lock-defaults): Fontify macros.

* org-faces.el (org-macro): New face.
Bastien Guerry 5 years ago
parent
commit
791ebc6e7b
2 changed files with 12 additions and 1 deletions
  1. 10 1
      lisp/org-faces.el
  2. 2 0
      lisp/org.el

+ 10 - 1
lisp/org-faces.el

@@ -779,7 +779,16 @@ level org-n-level-faces"
        (:foreground "burlywood"))
       (t (,@font))))
   "Face used to highlight LaTeX data, entities and sub/superscript."
-  :group 'org-faces)
+  :group 'org-faces
+  :version "24.4"
+  :package-version '(Org . "8.0"))
+
+(defface org-macro
+  (org-compatible-face 'org-latex-and-related nil)
+  "Face for macros."
+  :group 'org-faces
+  :version "24.4"
+  :package-version '(Org . "8.0"))
 
 (org-copy-face 'mode-line 'org-mode-line-clock
   "Face used for clock display in mode line.")

+ 2 - 0
lisp/org.el

@@ -6072,6 +6072,8 @@ needs to be inserted at a specific position in the font-lock sequence.")
            (list org-any-target-regexp '(0 'org-target t))
 	   ;; Diary sexps.
 	   '("^&?%%(.*\\|<%%([^>\n]*?>" (0 'org-sexp-date t))
+	   ;; Macro
+	   '("{{{.+}}}" (0 'org-macro t))
 	   '(org-hide-wide-columns (0 nil append))
 	   ;; TODO keyword
 	   (list (format org-heading-keyword-regexp-format