Browse Source

org.el (org-link-expand-abbrev): Save match data before before calling the replacement function

* org.el (org-link-expand-abbrev): Save match data before
before calling the replacement function.
Bastien Guerry 12 năm trước cách đây
mục cha
commit
8546ef131d
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      lisp/org.el

+ 3 - 1
lisp/org.el

@@ -9252,7 +9252,9 @@ property to set."
 	  (cond
 	  (cond
 	   ((symbolp rpl) (funcall rpl tag))
 	   ((symbolp rpl) (funcall rpl tag))
 	   ((string-match "%(\\([^)]+\\))" rpl)
 	   ((string-match "%(\\([^)]+\\))" rpl)
-	    (replace-match (funcall (intern-soft (match-string 1 rpl)) tag) t t rpl))
+	    (replace-match
+	     (save-match-data
+	       (funcall (intern-soft (match-string 1 rpl)) tag)) t t rpl))
 	   ((string-match "%s" rpl) (replace-match (or tag "") t t rpl))
 	   ((string-match "%s" rpl) (replace-match (or tag "") t t rpl))
 	   ((string-match "%h" rpl)
 	   ((string-match "%h" rpl)
 	    (replace-match (url-hexify-string (or tag "")) t t rpl))
 	    (replace-match (url-hexify-string (or tag "")) t t rpl))