Merge branch 'master' of orgmode.org:org-mode
This commit is contained in:
commit
91e2158977
|
@ -1259,7 +1259,7 @@ INFO is a plist holding contextual information. See
|
||||||
;; description.
|
;; description.
|
||||||
((string= type "radio")
|
((string= type "radio")
|
||||||
(let ((destination (org-export-resolve-radio-link link info)))
|
(let ((destination (org-export-resolve-radio-link link info)))
|
||||||
(when destination
|
(if (not destination) desc
|
||||||
(format "\\fI [%s] \\fP"
|
(format "\\fI [%s] \\fP"
|
||||||
(org-export-solidify-link-text
|
(org-export-solidify-link-text
|
||||||
(org-element-property :value destination))))))
|
(org-element-property :value destination))))))
|
||||||
|
|
|
@ -681,7 +681,7 @@ used as a communication channel."
|
||||||
(cond
|
(cond
|
||||||
((equal type "radio")
|
((equal type "radio")
|
||||||
(let ((destination (org-export-resolve-radio-link link info)))
|
(let ((destination (org-export-resolve-radio-link link info)))
|
||||||
(when destination
|
(if (not destination) contents
|
||||||
(format "\\hyperlink%s{%s}{%s}"
|
(format "\\hyperlink%s{%s}{%s}"
|
||||||
(or (org-beamer--element-has-overlay-p link) "")
|
(or (org-beamer--element-has-overlay-p link) "")
|
||||||
(org-export-solidify-link-text
|
(org-export-solidify-link-text
|
||||||
|
|
|
@ -2771,7 +2771,7 @@ INFO is a plist holding contextual information. See
|
||||||
;; link's description.
|
;; link's description.
|
||||||
((string= type "radio")
|
((string= type "radio")
|
||||||
(let ((destination (org-export-resolve-radio-link link info)))
|
(let ((destination (org-export-resolve-radio-link link info)))
|
||||||
(when destination
|
(if (not destination) desc
|
||||||
(format "<a href=\"#%s\"%s>%s</a>"
|
(format "<a href=\"#%s\"%s>%s</a>"
|
||||||
(org-export-solidify-link-text
|
(org-export-solidify-link-text
|
||||||
(org-element-property :value destination))
|
(org-element-property :value destination))
|
||||||
|
|
|
@ -1934,7 +1934,7 @@ INFO is a plist holding contextual information. See
|
||||||
;; description.
|
;; description.
|
||||||
((string= type "radio")
|
((string= type "radio")
|
||||||
(let ((destination (org-export-resolve-radio-link link info)))
|
(let ((destination (org-export-resolve-radio-link link info)))
|
||||||
(when destination
|
(if (not destination) desc
|
||||||
(format "\\hyperref[%s]{%s}"
|
(format "\\hyperref[%s]{%s}"
|
||||||
(org-export-solidify-link-text
|
(org-export-solidify-link-text
|
||||||
(org-element-property :value destination))
|
(org-element-property :value destination))
|
||||||
|
|
|
@ -2741,7 +2741,7 @@ INFO is a plist holding contextual information. See
|
||||||
;; link's description.
|
;; link's description.
|
||||||
((string= type "radio")
|
((string= type "radio")
|
||||||
(let ((destination (org-export-resolve-radio-link link info)))
|
(let ((destination (org-export-resolve-radio-link link info)))
|
||||||
(when destination
|
(if (not destination) desc
|
||||||
(format
|
(format
|
||||||
"<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>"
|
"<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>"
|
||||||
(org-export-solidify-link-text
|
(org-export-solidify-link-text
|
||||||
|
|
|
@ -451,18 +451,23 @@ INFO is a plist used as a communication channel. See
|
||||||
;; Else use format string.
|
;; Else use format string.
|
||||||
(t (format fmt text)))))
|
(t (format fmt text)))))
|
||||||
|
|
||||||
(defun org-texinfo--get-node (headline info)
|
(defun org-texinfo--get-node (blob info)
|
||||||
"Return node entry associated to HEADLINE.
|
"Return node or anchor associated to BLOB.
|
||||||
INFO is a plist used as a communication channel. The function
|
BLOB is an element or object. INFO is a plist used as
|
||||||
guarantees the node name is unique."
|
a communication channel. The function guarantees the node or
|
||||||
|
anchor name is unique."
|
||||||
(let ((cache (plist-get info :texinfo-node-cache)))
|
(let ((cache (plist-get info :texinfo-node-cache)))
|
||||||
(or (cdr (assq headline cache))
|
(or (cdr (assq blob cache))
|
||||||
(let ((name (org-texinfo--sanitize-node
|
(let ((name
|
||||||
(org-export-data
|
(org-texinfo--sanitize-node
|
||||||
(org-export-get-alt-title headline info) info))))
|
(case (org-element-type blob)
|
||||||
|
(headline
|
||||||
|
(org-export-data (org-export-get-alt-title blob info) info))
|
||||||
|
((radio-target target) (org-element-property :value blob))
|
||||||
|
(otherwise (or (org-element-property :name blob) ""))))))
|
||||||
;; Ensure NAME is unique.
|
;; Ensure NAME is unique.
|
||||||
(while (rassoc name cache) (setq name (concat name "x")))
|
(while (rassoc name cache) (setq name (concat name "x")))
|
||||||
(plist-put info :texinfo-node-cache (cons (cons headline name) cache))
|
(plist-put info :texinfo-node-cache (cons (cons blob name) cache))
|
||||||
name))))
|
name))))
|
||||||
|
|
||||||
;;;; Menu sanitizing
|
;;;; Menu sanitizing
|
||||||
|
@ -483,7 +488,7 @@ are not significant. Also remove the following characters: @
|
||||||
(defun org-texinfo--sanitize-content (text)
|
(defun org-texinfo--sanitize-content (text)
|
||||||
"Escape special characters in string TEXT.
|
"Escape special characters in string TEXT.
|
||||||
Special characters are: @ { }"
|
Special characters are: @ { }"
|
||||||
(replace-regexp-in-string "\\\([@{}]\\\)" "@\\1" text))
|
(replace-regexp-in-string "[@{}]" "@\\&" text))
|
||||||
|
|
||||||
;;; Template
|
;;; Template
|
||||||
|
|
||||||
|
@ -904,55 +909,69 @@ INFO is a plist holding contextual information. See
|
||||||
((and (string= type "file") (file-name-absolute-p raw-path))
|
((and (string= type "file") (file-name-absolute-p raw-path))
|
||||||
(concat "file:" raw-path))
|
(concat "file:" raw-path))
|
||||||
(t raw-path)))
|
(t raw-path)))
|
||||||
(email (if (string= type "mailto")
|
|
||||||
(let ((text (replace-regexp-in-string
|
|
||||||
"@" "@@" raw-path)))
|
|
||||||
(concat text (if desc (concat "," desc))))))
|
|
||||||
protocol)
|
protocol)
|
||||||
(cond
|
(cond
|
||||||
;; Links pointing to a headline: Find destination and build
|
((equal type "radio")
|
||||||
;; appropriate referencing command.
|
(let ((destination (org-export-resolve-radio-link link info)))
|
||||||
((member type '("custom-id" "id"))
|
(if (not destination) desc
|
||||||
(let ((destination (org-export-resolve-id-link link info)))
|
(format "@ref{%s,,%s}"
|
||||||
|
(org-texinfo--get-node destination info)
|
||||||
|
desc))))
|
||||||
|
((member type '("custom-id" "id" "fuzzy"))
|
||||||
|
(let ((destination
|
||||||
|
(if (equal type "fuzzy")
|
||||||
|
(org-export-resolve-fuzzy-link link info)
|
||||||
|
(org-export-resolve-id-link link info))))
|
||||||
(case (org-element-type destination)
|
(case (org-element-type destination)
|
||||||
|
((nil)
|
||||||
|
(format org-texinfo-link-with-unknown-path-format
|
||||||
|
(org-texinfo--sanitize-content path)))
|
||||||
;; Id link points to an external file.
|
;; Id link points to an external file.
|
||||||
(plain-text
|
(plain-text
|
||||||
(if desc (format "@uref{file://%s,%s}" destination desc)
|
(if desc (format "@uref{file://%s,%s}" destination desc)
|
||||||
(format "@uref{file://%s}" destination)))
|
(format "@uref{file://%s}" destination)))
|
||||||
;; LINK points to a headline. Use the headline as the NODE target
|
|
||||||
(headline
|
(headline
|
||||||
(format "@ref{%s,%s}"
|
(format "@ref{%s,%s}"
|
||||||
(org-texinfo--get-node destination info)
|
(org-texinfo--get-node destination info)
|
||||||
(or desc "")))
|
(cond
|
||||||
|
(desc)
|
||||||
|
((org-export-numbered-headline-p destination info)
|
||||||
|
(org-export-data
|
||||||
|
(org-element-property :title destination) info))
|
||||||
|
(t
|
||||||
|
(mapconcat
|
||||||
|
#'number-to-string
|
||||||
|
(org-export-get-headline-number destination info) ".")))))
|
||||||
(otherwise
|
(otherwise
|
||||||
(let ((path (org-export-solidify-link-text path)))
|
(let ((topic
|
||||||
(if (not desc) (format "@ref{%s}" path)
|
(or desc
|
||||||
(format "@ref{%s,,%s}" path desc)))))))
|
(if (and (eq (org-element-type destination) 'headline)
|
||||||
((member type '("info"))
|
(not (org-export-numbered-headline-p
|
||||||
|
destination info)))
|
||||||
|
(org-export-data
|
||||||
|
(org-element-property :title destination) info))
|
||||||
|
(let ((n (org-export-get-ordinal destination info)))
|
||||||
|
(cond
|
||||||
|
((not n) nil)
|
||||||
|
((integerp n) n)
|
||||||
|
(t (mapconcat #'number-to-string n ".")))))))
|
||||||
|
(when topic
|
||||||
|
(format "@ref{%s,,%s}"
|
||||||
|
(org-texinfo--get-node destination info)
|
||||||
|
topic)))))))
|
||||||
|
((equal type "info")
|
||||||
(let* ((info-path (split-string path "[:#]"))
|
(let* ((info-path (split-string path "[:#]"))
|
||||||
(info-manual (car info-path))
|
(info-manual (car info-path))
|
||||||
(info-node (or (cadr info-path) "top"))
|
(info-node (or (cadr info-path) "top"))
|
||||||
(title (or desc "")))
|
(title (or desc "")))
|
||||||
(format "@ref{%s,%s,,%s,}" info-node title info-manual)))
|
(format "@ref{%s,%s,,%s,}" info-node title info-manual)))
|
||||||
((member type '("fuzzy"))
|
((string= type "mailto")
|
||||||
(let ((destination (org-export-resolve-fuzzy-link link info)))
|
(format "@email{%s}"
|
||||||
(case (org-element-type destination)
|
(concat (org-texinfo--sanitize-content path)
|
||||||
;; Id link points to an external file.
|
(and desc (concat "," desc)))))
|
||||||
(plain-text
|
((let ((protocol (nth 2 (assoc type org-link-protocols))))
|
||||||
(if desc (format "@uref{file://%s,%s}" destination desc)
|
(and (functionp protocol)
|
||||||
(format "@uref{file://%s}" destination)))
|
(funcall protocol (org-link-unescape path) desc 'texinfo))))
|
||||||
;; LINK points to a headline. Use the headline as the NODE target
|
|
||||||
(headline
|
|
||||||
(format "@ref{%s,%s}"
|
|
||||||
(org-texinfo--get-node destination info)
|
|
||||||
(or desc "")))
|
|
||||||
(otherwise
|
|
||||||
(let ((path (org-export-solidify-link-text path)))
|
|
||||||
(if (not desc) (format "@ref{%s}" path)
|
|
||||||
(format "@ref{%s,,%s}" path desc)))))))
|
|
||||||
;; Special case for email addresses
|
|
||||||
(email
|
|
||||||
(format "@email{%s}" email))
|
|
||||||
;; External link with a description part.
|
;; External link with a description part.
|
||||||
((and path desc) (format "@uref{%s,%s}" path desc))
|
((and path desc) (format "@uref{%s,%s}" path desc))
|
||||||
;; External link without a description part.
|
;; External link without a description part.
|
||||||
|
|
Loading…
Reference in New Issue