From ba6cf4645f156707c4f412ba64a1666fa9f93586 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 11 Oct 2020 02:05:27 -0400 Subject: [PATCH] org.el: Avoid repeated calls in org-font-lock-add-priority-faces * lisp/org.el (org-font-lock-add-priority-faces): Let-bind bounds to avoid repeated calls. This will also make the conflict resolution in the next merge of maint clearer. --- lisp/org.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 579fbd7bd..3906a22b9 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5845,13 +5845,14 @@ If TAG is a number, get the corresponding match group." (defun org-font-lock-add-priority-faces (limit) "Add the special priority faces." (while (re-search-forward org-priority-regexp limit t) - (add-face-text-property - (match-beginning 1) - (match-end 1) - (org-get-priority-face (string-to-char (match-string 2)))) - (add-text-properties - (match-beginning 1) (match-end 1) - (list 'font-lock-fontified t)))) + (let ((beg (match-beginning 1)) + (end (match-end 1))) + (add-face-text-property + beg end + (org-get-priority-face (string-to-char (match-string 2)))) + (add-text-properties + beg end + (list 'font-lock-fontified t))))) (defun org-font-lock-add-tag-faces (limit) "Add the special tag faces."