[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org d74a824 54/85: org.el (org-fontify-extend-region):
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org d74a824 54/85: org.el (org-fontify-extend-region): Fix headline fontification in edge case |
Date: |
Mon, 27 Sep 2021 15:57:49 -0400 (EDT) |
branch: externals/org
commit d74a82448bc28dd9be7b57611038bbb4c7172bce
Author: Sébastien Miquel <sebastien.miquel@posteo.eu>
Commit: Bastien <bzg@gnu.org>
org.el (org-fontify-extend-region): Fix headline fontification in edge case
* lisp/org.el (org-fontify-extend-region): Fix fontification of
headline or meta line created by inserting a newline.
Unrelated to the fix: `org-fontify-extend-region' is added to
`font-lock-extend-after-change-region-function' and doesn't need to
use `save-excursion'.
---
lisp/org.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 66ca73d..96d0e8a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5440,7 +5440,9 @@ by a #."
t)))))
(defun org-fontify-extend-region (beg end _old-len)
- (let ((begin-re "\\(\\\\\\[\\|\\(#\\+begin_\\|\\\\begin{\\)\\S-+\\)")
+ (let ((end (if (progn (goto-char end) (looking-at-p "^[*#]"))
+ (1+ end) end))
+ (begin-re "\\(\\\\\\[\\|\\(#\\+begin_\\|\\\\begin{\\)\\S-+\\)")
(end-re "\\(\\\\\\]\\|\\(#\\+end_\\|\\\\end{\\)\\S-+\\)")
(extend
(lambda (r1 r2 dir)
@@ -5450,15 +5452,14 @@ by a #."
"[][]" r2
(match-string-no-properties 0)))))
(re-search-forward (regexp-quote re) nil t dir)))))
+ (goto-char beg)
+ (back-to-indentation)
(save-match-data
- (save-excursion
- (goto-char beg)
- (back-to-indentation)
- (cond ((looking-at end-re)
- (cons (or (funcall extend "begin" "[" -1) beg) end))
- ((looking-at begin-re)
- (cons beg (or (funcall extend "end" "]" 1) end)))
- (t (cons beg end)))))))
+ (cond ((looking-at end-re)
+ (cons (or (funcall extend "begin" "[" -1) beg) end))
+ ((looking-at begin-re)
+ (cons beg (or (funcall extend "end" "]" 1) end)))
+ (t (cons beg end))))))
(defun org-activate-footnote-links (limit)
"Add text properties for footnotes."
- [elpa] externals/org c80fea7 82/85: lisp/oc.el: Fix docstring wrapping, (continued)
- [elpa] externals/org c80fea7 82/85: lisp/oc.el: Fix docstring wrapping, ELPA Syncer, 2021/09/27
- [elpa] externals/org 2d2f774 16/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org b967a05 24/85: org-indent: Allow indentation per level to be 0, ELPA Syncer, 2021/09/27
- [elpa] externals/org e0bf528 30/85: CONTRIBUTE: Update to follow the new structure of doc/, ELPA Syncer, 2021/09/27
- [elpa] externals/org bf1c4c7 22/85: Include support for evaluating julia code, ELPA Syncer, 2021/09/27
- [elpa] externals/org c0ca5e3 29/85: CONTRIBUTE: Fix typo, ELPA Syncer, 2021/09/27
- [elpa] externals/org 4651121 45/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 98fd6d5 56/85: Remove references to deleted packages, ELPA Syncer, 2021/09/27
- [elpa] externals/org 6300e0e 84/85: test-org-protocol.el: Decode "+" to " " tests, ELPA Syncer, 2021/09/27
- [elpa] externals/org 4b7d80c 50/85: Add faces to improve contextuality of agenda views, ELPA Syncer, 2021/09/27
- [elpa] externals/org d74a824 54/85: org.el (org-fontify-extend-region): Fix headline fontification in edge case,
ELPA Syncer <=
- [elpa] externals/org 54c2327 49/85: Allow :var header args to be assigned to cons cells, ELPA Syncer, 2021/09/27
- [elpa] externals/org e0535fa 39/85: ob-sql.el (org-babel-expand-body:sql): Support :prologue :epilogue, ELPA Syncer, 2021/09/27
- [elpa] externals/org ef66170 42/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 578d99b 57/85: lisp/ob-tangle.el: Add variable declaration, ELPA Syncer, 2021/09/27
- [elpa] externals/org c21dceb 61/85: lisp/org.el: Fix some compiler warnings, ELPA Syncer, 2021/09/27
- [elpa] externals/org 41f7609 67/85: ob-core: Make recent change compatible with older Emacs versions, ELPA Syncer, 2021/09/27
- [elpa] externals/org c12a159 78/85: ORG-NEWS: Mention proportional image width display, ELPA Syncer, 2021/09/27