Parcourir la source

Fix consecutive radio links

* lisp/org.el (org-activate-target-links): Properly match consecutive
  radio links.

Reported-by: Jay Dresser <jay@jaydresser.us>
<http://lists.gnu.org/r/emacs-orgmode/2019-01/msg00327.html>
Nicolas Goaziou il y a 6 ans
Parent
commit
24030ef62b
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      lisp/org.el

+ 3 - 0
lisp/org.el

@@ -6163,6 +6163,9 @@ by a #."
   "Add text properties for target matches."
   (when org-target-link-regexp
     (let ((case-fold-search t))
+      ;; `org-target-link-regexp' matches one character before the
+      ;; actual target.
+      (unless (bolp) (forward-char -1))
       (when (re-search-forward org-target-link-regexp limit t)
 	(org-remove-flyspell-overlays-in (match-beginning 1) (match-end 1))
 	(add-text-properties (match-beginning 1) (match-end 1)