浏览代码

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 年之前
父节点
当前提交
8546ef131d
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lisp/org.el

+ 3 - 1
lisp/org.el

@@ -9252,7 +9252,9 @@ property to set."
 	  (cond
 	   ((symbolp rpl) (funcall rpl tag))
 	   ((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 "%h" rpl)
 	    (replace-match (url-hexify-string (or tag "")) t t rpl))