瀏覽代碼

org-e-texinfo.el: Fix link export to account for alternate TOC names

* contrib/lisp/org-e-texinfo.el (org-e-texinfo-link): Texinfo uses the
menu/TOC names for finding cross-references.  Use the menu-title as
the link destination.  Also ensures link descriptions are used as
link titles.
Jonathan Leech-Pepin 12 年之前
父節點
當前提交
676180a5fb
共有 1 個文件被更改,包括 10 次插入4 次删除
  1. 10 4
      contrib/lisp/org-e-texinfo.el

+ 10 - 4
contrib/lisp/org-e-texinfo.el

@@ -1199,9 +1199,12 @@ INFO is a plist holding contextual information.  See
 	     (format "@uref{file://%s}" destination)))
 	  ;; LINK points to an headline.  Use the headline as the NODE target
 	  (headline
-	   (format "@ref{%s}"
+	   (format "@ref{%s,%s}"
 		   (org-export-data
-		    (org-element-property :title destination) info)))
+		    (or
+		     (org-element-property :texinfo-menu-title destination)
+		     (org-element-property :title destination)) info)
+		   (or desc "")))
 	  (otherwise
 	   (let ((path (org-export-solidify-link-text path)))
 	     (if (not desc) (format "@ref{%s}" path)
@@ -1221,9 +1224,12 @@ INFO is a plist holding contextual information.  See
 	     (format "@uref{file://%s}" destination)))
 	  ;; LINK points to an headline.  Use the headline as the NODE target
 	  (headline
-	   (format "@ref{%s}"
+	   (format "@ref{%s,%s}"
 		   (org-export-data
-		    (org-element-property :title destination) info)))
+		    (or
+		     (org-element-property :texinfo-menu-title destination)
+		     (org-element-property :title destination)) info)
+		   (or desc "")))
 	  (otherwise
 	   (let ((path (org-export-solidify-link-text path)))
 	     (if (not desc) (format "@ref{%s}" path)