diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-01-28 17:10:13 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-01-28 17:10:13 +0100 |
commit | 55e8c6f9c3d19fe290f4f6102b57396ccc19581f (patch) | |
tree | 860dc44437f577d77e50432a12dfba17729cae8e | |
parent | 00dbb3089f034e88a443049d68fa458f6fa0ef93 (diff) | |
parent | 5b4a711949eb3c757561b574b4d30af7c7e7cd79 (diff) | |
download | org-mode-55e8c6f9c3d19fe290f4f6102b57396ccc19581f.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org.el | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lisp/org.el b/lisp/org.el index c3711df..1e0e57e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5973,17 +5973,21 @@ by a #." (defun org-fontify-macros (limit) "Fontify macros." - (when (re-search-forward "\\({{{\\).+?\\(}}}\\)" limit t) - (add-text-properties - (match-beginning 0) (match-end 0) - '(font-lock-fontified t face org-macro)) - (when org-hide-macro-markers - (add-text-properties (match-end 2) (match-beginning 2) - '(invisible t)) - (add-text-properties (match-beginning 1) (match-end 1) - '(invisible t))) - (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) - t)) + (when (re-search-forward "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)" limit t) + (let ((begin (match-beginning 0)) + (opening-end (match-beginning 1))) + (when (and (re-search-forward "\n[ \t]*\n\\|\\(}}}\\)" limit t) + (match-string 1)) + (let ((end (match-end 1)) + (closing-start (match-beginning 1))) + (add-text-properties + begin end + '(font-lock-multiline t font-lock-fontified t face org-macro)) + (org-remove-flyspell-overlays-in begin end) + (when org-hide-macro-markers + (add-text-properties begin opening-end '(invisible t)) + (add-text-properties closing-start end '(invisible t))) + t))))) (defun org-activate-footnote-links (limit) "Add text properties for footnotes." |