diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index d52fd7317..b08a000f7 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -932,7 +932,10 @@ CONTENTS is nil. INFO is a plist holding contextual information." ((string= key "TOC") (cond ((org-string-match-p "\\" value) (concat "@listoffloats " - (org-export-translate "Table" :utf-8 info)))))))) + (org-export-translate "Table" :utf-8 info))) + ((org-string-match-p "\\" value) + (concat "@listoffloats " + (org-export-translate "Listing" :utf-8 info)))))))) ;;;; Line Break @@ -1305,11 +1308,22 @@ as a communication channel." "Transcode a SRC-BLOCK element from Org to Texinfo. CONTENTS holds the contents of the item. INFO is a plist holding contextual information." - (let ((lispp (org-string-match-p "lisp" + (let* ((lisp (org-string-match-p "lisp" (org-element-property :language src-block))) - (code (org-texinfo--sanitize-content - (org-export-format-code-default src-block info)))) - (format (if lispp "@lisp\n%s@end lisp" "@example\n%s@end example") code))) + (code (org-texinfo--sanitize-content + (org-export-format-code-default src-block info))) + (value (format + (if lisp "@lisp\n%s@end lisp" "@example\n%s@end example") + code)) + (caption (org-export-get-caption src-block)) + (shortcaption (org-export-get-caption src-block t))) + (if (not (or caption shortcaption)) value + (org-texinfo--wrap-float value + info + (org-export-translate "Listing" :utf-8 info) + (org-element-property :name src-block) + caption + shortcaption)))) ;;;; Statistics Cookie diff --git a/lisp/ox.el b/lisp/ox.el index 525039b8b..fede7c985 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -5460,6 +5460,19 @@ them." :utf-8 "Список таблиц") ("sv" :default "Tabeller") ("zh-CN" :html "表格目录" :utf-8 "表格目录")) + ("Listing" + ("da" :default "Program") + ("de" :default "Programmlisting") + ("es" :default "Listado de programa") + ("et" :default "Loend") + ("fr" :default "Programme" :html "Programme") + ("ja" :default "ソースコード") + ("no" :default "Dataprogram") + ("nb" :default "Dataprogram") + ("pt_BR" :default "Listagem") + ("ru" :html "Распечатка" + :utf-8 "Распечатка") + ("zh-CN" :html "代码" :utf-8 "代码")) ("Listing %d:" ("da" :default "Program %d") ("de" :default "Programmlisting %d")