diff --git a/lisp/org.el b/lisp/org.el index fd6226702..f45adb308 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8757,8 +8757,8 @@ If the file does not exist, throw an error." (save-match-data (let ((match-index 1) (number-of-groups (- (/ (length link-match-data) 2) 1))) - (set-match-data link-match-data) (while (<= match-index number-of-groups) + (set-match-data link-match-data) (let ((regex (concat "%" (number-to-string match-index))) (replace-with (match-string match-index dlink))) (while (string-match regex cmd)