Browse Source

org.el (org-font-lock-add-priority-faces): Speed up regexp

* org.el (org-font-lock-add-priority-faces): Speed up regexp.

Only fontify priority cookies in headlines.

Note that the variable org-priority-regexp can't be modified since
it is used in the agenda and in org-get-priority.

TINYCHANGE

Suggested-by: Ihor Radchenko <yantar92@gmail.com>
Sébastien Miquel 4 years ago
parent
commit
a03b4656cf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/org.el

+ 1 - 1
lisp/org.el

@@ -5855,7 +5855,7 @@ 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)
+  (while (re-search-forward (concat "^\\*+" org-priority-regexp) limit t)
     (let ((beg (match-beginning 1))
 	  (end (1+ (match-end 2))))
       (add-face-text-property