diff options
author | Kyle Meyer <kyle@kyleam.com> | 2020-10-11 02:04:11 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2020-10-11 02:04:11 -0400 |
commit | b1de0c8e4b2a6cf4c338d200df76d2e2df29412e (patch) | |
tree | 9ed544d6154bed6780b70ec9da2cb68b6a447eff | |
parent | f0902bf185242a62d3f6b7f1b0dc18908c951e6f (diff) | |
download | org-mode-b1de0c8e4b2a6cf4c338d200df76d2e2df29412e.tar.gz |
Fix regression in priority fontification
* lisp/org-agenda.el (org-agenda-fontify-priorities):
* lisp/org.el (org-font-lock-add-priority-faces): Fontify up to the
end of the closing bracket of the priority, as was the case before
v9.4.
7b1077def (Tiny enhancements to priority handling, 2020-01-30)
switched org-agenda-fontify-priorities and
org-font-lock-add-priority-faces over to using org-priority-regexp
rather than inline regexps. For the inline regexps, the first group
ended at the closing bracket, but the first group in
org-priority-regexp includes an optional space, leading to the face
extending one character too far.
Restore the bound to the closing bracket by determining the bound
based on the second group, the priority label, instead.
Reported-by: Roman Rudakov <rrudakov@pm.me>
Helped-by: Protesilaos Stavrou <info@protesilaos.com>
Ref: https://orgmode.org/list/87r1r2kh77.fsf@pm.me
-rw-r--r-- | lisp/org-agenda.el | 2 | ||||
-rw-r--r-- | lisp/org.el | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 82fe609..a1b2064 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3987,7 +3987,7 @@ agenda display, configure `org-agenda-finalize-hook'." p (string-to-char (match-string 2)) b (match-beginning 1) e (if (eq org-agenda-fontify-priorities 'cookies) - (match-end 1) + (1+ (match-end 2)) (point-at-eol)) ov (make-overlay b e)) (overlay-put diff --git a/lisp/org.el b/lisp/org.el index a464eb5..6d29476 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5843,7 +5843,7 @@ If TAG is a number, get the corresponding match group." "Add the special priority faces." (while (re-search-forward org-priority-regexp limit t) (add-text-properties - (match-beginning 1) (match-end 1) + (match-beginning 1) (1+ (match-end 2)) (list 'face (org-get-priority-face (string-to-char (match-string 2))) 'font-lock-fontified t)))) |