Fix meta lines regexp

* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Fix meta lines
regexp to work correctly for lines with only a #.

Replace blank in regexp by (any " \t").

TINYCHANGE
This commit is contained in:
Sébastien Miquel 2020-09-16 07:49:34 +02:00 committed by Nicolas Goaziou
parent 469ee63401
commit 38fbd161e4
1 changed files with 7 additions and 7 deletions

View File

@ -5219,14 +5219,14 @@ by a #."
"Fontify #+ lines and blocks." "Fontify #+ lines and blocks."
(let ((case-fold-search t)) (let ((case-fold-search t))
(when (re-search-forward (when (re-search-forward
(rx bol (group (zero-or-more blank) "#" (rx bol (group (zero-or-more (any " \t")) "#"
(group (group (or (seq "+" (one-or-more (any "a-zA-Z")) (optional ":")) (group (group (or (seq "+" (one-or-more (any "a-zA-Z")) (optional ":"))
space (any " \t")
eol)) eol))
(optional (group "_" (group (one-or-more (any "a-zA-Z")))))) (optional (group "_" (group (one-or-more (any "a-zA-Z"))))))
(zero-or-more blank) (zero-or-more (any " \t"))
(group (group (zero-or-more (not (any " \t\n")))) (group (group (zero-or-more (not (any " \t\n"))))
(zero-or-more blank) (zero-or-more (any " \t"))
(group (zero-or-more any))))) (group (zero-or-more any)))))
limit t) limit t)
(let ((beg (match-beginning 0)) (let ((beg (match-beginning 0))
@ -5249,7 +5249,7 @@ by a #."
quoting (member block-type org-protecting-blocks)) quoting (member block-type org-protecting-blocks))
(when (re-search-forward (when (re-search-forward
(rx-to-string `(group bol (or (seq (one-or-more "*") space) (rx-to-string `(group bol (or (seq (one-or-more "*") space)
(seq (zero-or-more blank) (seq (zero-or-more (any " \t"))
"#+end" "#+end"
,(match-string 4) ,(match-string 4)
word-end word-end
@ -5323,11 +5323,11 @@ by a #."
;; Handle short captions ;; Handle short captions
(save-excursion (save-excursion
(beginning-of-line) (beginning-of-line)
(looking-at (rx (group (zero-or-more blank) (looking-at (rx (group (zero-or-more (any " \t"))
"#+caption" "#+caption"
(optional "[" (zero-or-more any) "]") (optional "[" (zero-or-more any) "]")
":") ":")
(zero-or-more blank)))) (zero-or-more (any " \t")))))
(add-text-properties (line-beginning-position) (match-end 1) (add-text-properties (line-beginning-position) (match-end 1)
'(font-lock-fontified t face org-meta-line)) '(font-lock-fontified t face org-meta-line))
(add-text-properties (match-end 0) (line-end-position) (add-text-properties (match-end 0) (line-end-position)