org.el (org-get-category): Save match data.

* org.el (org-get-category): Save match data.

Thanks to Adam Spiers for spotting this issue.
This commit is contained in:
Bastien Guerry 2012-03-08 14:08:15 +01:00
parent 11e441e85f
commit e78cb895ca
1 changed files with 6 additions and 5 deletions

View File

@ -8495,11 +8495,12 @@ call CMD."
(defun org-get-category (&optional pos force-refresh) (defun org-get-category (&optional pos force-refresh)
"Get the category applying to position POS." "Get the category applying to position POS."
(if force-refresh (org-refresh-category-properties)) (save-match-data
(let ((pos (or pos (point)))) (if force-refresh (org-refresh-category-properties))
(or (get-text-property pos 'org-category) (let ((pos (or pos (point))))
(progn (org-refresh-category-properties) (or (get-text-property pos 'org-category)
(get-text-property pos 'org-category))))) (progn (org-refresh-category-properties)
(get-text-property pos 'org-category))))))
(defun org-refresh-category-properties () (defun org-refresh-category-properties ()
"Refresh category text properties in the buffer." "Refresh category text properties in the buffer."