Preserve priority of #+TARGET over #+NAME when resolving a link

* lisp/org.el (org-link-search): Preserve priority of #+TARGET over
  #+NAME when resolving a link.  This reverts partially commit
  49b14b0224.
This commit is contained in:
Nicolas Goaziou 2013-03-27 23:14:56 +01:00
parent 60170dfe3b
commit 7f9893887e
1 changed files with 9 additions and 2 deletions

View File

@ -10631,11 +10631,18 @@ visibility around point, thus ignoring
(goto-char (point-min))
(and
(re-search-forward
(format "^[ \t]*#\\+\\(?:TARGET\\|NAME\\): %s"
(regexp-quote s0)) nil t)
(format "^[ \t]*#\\+TARGET: %s" (regexp-quote s0)) nil t)
(setq type 'dedicated pos (match-beginning 0))))
;; Found an invisible target.
(goto-char pos))
((save-excursion
(goto-char (point-min))
(and
(re-search-forward
(format "^[ \t]*#\\+NAME: %s" (regexp-quote s0)) nil t)
(setq type 'dedicated pos (match-beginning 0))))
;; Found an element with a matching #+name affiliated keyword.
(goto-char pos))
((and (string-match "^(\\(.*\\))$" s0)
(save-excursion
(goto-char (point-min))