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:
parent
60170dfe3b
commit
7f9893887e
11
lisp/org.el
11
lisp/org.el
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue