From a94493f5a2ff02e87900640c667c49c6a6a5e994 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 29 Oct 2016 01:09:26 +0200 Subject: [PATCH] Properly fontify short captions * lisp/org.el (org-fontify-meta-lines-and-blocks-1): Properly fontify short captions. --- lisp/org.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 138c03f8b..5de4b68b7 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6092,13 +6092,17 @@ by a #." (if (string-equal dc1 "+title:") '(font-lock-fontified t face org-document-title) '(font-lock-fontified t face org-document-info)))) - ((equal dc1 "+caption:") + ((string-prefix-p "+caption" dc1) (org-remove-flyspell-overlays-in (match-end 2) (match-end 0)) (remove-text-properties (match-beginning 0) (match-end 0) '(display t invisible t intangible t)) - (add-text-properties (match-beginning 1) (match-end 3) + ;; Handle short captions. + (save-excursion + (beginning-of-line) + (looking-at "\\([ \t]*#\\+caption\\(?:\\[.*\\]\\)?:\\)[ \t]*")) + (add-text-properties (line-beginning-position) (match-end 1) '(font-lock-fontified t face org-meta-line)) - (add-text-properties (match-beginning 6) (+ (match-end 6) 1) + (add-text-properties (match-end 0) (line-end-position) '(font-lock-fontified t face org-block)) t) ((member dc3 '(" " "")) -- 2.11.4.GIT