org-e-latex: Apply changes to org-export-resolve-fuzzy-link

* EXPERIMENTAL/org-e-latex.el (org-e-latex-link): Apply changes to
  org-export-resolve-fuzzy-link.
This commit is contained in:
Nicolas Goaziou 2012-01-14 01:02:02 +01:00
parent b03ec00a0e
commit 85588714ac
1 changed files with 22 additions and 21 deletions

View File

@ -1345,27 +1345,28 @@ INFO is a plist holding contextual information. See
;; the destination of the link. ;; the destination of the link.
((string= type "fuzzy") ((string= type "fuzzy")
(let ((destination (org-export-resolve-fuzzy-link link info))) (let ((destination (org-export-resolve-fuzzy-link link info)))
(cond (case (car destination)
;; Target match. (target
((stringp destination) (format "\\hyperref[%s]{%s}"
(format "\\hyperref[%s]{%s}" (org-export-solidify-link-text
(org-export-solidify-link-text destination) (org-element-get-property :raw-value destination))
(or desc (or desc
(org-export-secondary-string (org-export-secondary-string
(org-element-get-property :raw-link link) 'e-latex info)))) (org-element-get-property :raw-link link)
;; Headline match. 'e-latex info))))
((integerp destination) (headline
(format "\\hyperref[headline-%d]{%s}" (format "\\hyperref[headline-%d]{%s}"
destination (org-element-get-property :begin destination)
(or desc (or desc
(org-export-secondary-string (org-export-secondary-string
(org-element-get-property :raw-link link) 'e-latex info)))) (org-element-get-property :raw-link link)
;; No match. 'e-latex info))))
(t (format "\\texttt{%s}" (otherwise
(or desc (format "\\texttt{%s}"
(org-export-secondary-string (or desc
(org-element-get-property :raw-link link) (org-export-secondary-string
'e-latex info))))))) (org-element-get-property :raw-link link)
'e-latex info)))))))
;; Coderef: replace link with the reference name or the ;; Coderef: replace link with the reference name or the
;; equivalent line number. ;; equivalent line number.
((string= type "coderef") ((string= type "coderef")