Explorar o código

org-element.el: Fix bug about short captions

* lisp/org-element.el
(org-element--collect-affiliated-keywords): Save match data when
setting the main value for keywords.

This fixes a bug about defining short captions.  Thanks to Anthony
Cowley for reporting this and suggesting this fix.
Bastien %!s(int64=5) %!d(string=hai) anos
pai
achega
c964cf79bc
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      lisp/org-element.el

+ 2 - 1
lisp/org-element.el

@@ -4023,7 +4023,8 @@ When PARSE is non-nil, values from keywords belonging to
 			     (skip-chars-backward " \t")
 			     (point))))
 		  (if parsed?
-		      (org-element--parse-objects beg end nil restrict)
+		      (save-match-data
+			(org-element--parse-objects beg end nil restrict))
 		    (org-trim (buffer-substring-no-properties beg end)))))
 	       ;; If KWD is a dual keyword, find its secondary value.
 	       ;; Maybe parse it.