0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-04 22:42:59 +00:00

Backport commit 5254c582e from Emacs

* lisp/ox-texinfo.el: Remove redundant `:group` arguments.
Prefer #' to quote function names.
(org-texinfo-template): Use sane defaults for `@direntry`.

* doc/org.org (Texinfo specific export settings): Adjust accordingly.

ox-texinfo:: Require only TEXINFO_DIR_CATEGORY
5254c582efb3e7171e955dde653e7530d2d3ffef
Stefan Monnier
Sun Mar 3 16:57:56 2024 -0500
This commit is contained in:
Stefan Monnier 2024-03-02 14:48:29 -05:00 committed by Kyle Meyer
parent 5a176d76ad
commit 338ff105c5
2 changed files with 37 additions and 32 deletions

View file

@ -15322,11 +15322,18 @@ the general options (see [[*Export Settings]]).
#+cindex: @samp{TEXINFO_DIR_TITLE}, keyword #+cindex: @samp{TEXINFO_DIR_TITLE}, keyword
The directory title of the document. The directory title of the document.
This is the short name under which the ~m~ command will find your
manual in the main Info directory. It defaults to the base name of
the Texinfo file.
If you need more control, it can also be the full entry using the
syntax ~* TITLE: (FILENAME).~.
- =TEXINFO_DIR_DESC= :: - =TEXINFO_DIR_DESC= ::
#+cindex: @samp{TEXINFO_DIR_DESC}, keyword #+cindex: @samp{TEXINFO_DIR_DESC}, keyword
The directory description of the document. The directory description of the document.
Defaults to the title of the document.
- =TEXINFO_PRINTED_TITLE= :: - =TEXINFO_PRINTED_TITLE= ::
@ -15422,7 +15429,7 @@ Here is an example that writes to the Info directory file:
#+begin_example #+begin_example
,#+TEXINFO_DIR_CATEGORY: Emacs ,#+TEXINFO_DIR_CATEGORY: Emacs
,#+TEXINFO_DIR_TITLE: Org Mode: (org) ,#+TEXINFO_DIR_TITLE: Org Mode
,#+TEXINFO_DIR_DESC: Outline-based notes management and organizer ,#+TEXINFO_DIR_DESC: Outline-based notes management and organizer
#+end_example #+end_example
@ -15830,7 +15837,7 @@ Texinfo code.
,#+TEXINFO_HEADER: @syncodeindex pg cp ,#+TEXINFO_HEADER: @syncodeindex pg cp
,#+TEXINFO_DIR_CATEGORY: Texinfo documentation system ,#+TEXINFO_DIR_CATEGORY: Texinfo documentation system
,#+TEXINFO_DIR_TITLE: sample: (sample) ,#+TEXINFO_DIR_TITLE: sample
,#+TEXINFO_DIR_DESC: Invoking sample ,#+TEXINFO_DIR_DESC: Invoking sample
,#+TEXINFO_PRINTED_TITLE: GNU Sample ,#+TEXINFO_PRINTED_TITLE: GNU Sample

View file

@ -110,6 +110,10 @@
(:subtitle "SUBTITLE" nil nil parse) (:subtitle "SUBTITLE" nil nil parse)
(:subauthor "SUBAUTHOR" nil nil newline) (:subauthor "SUBAUTHOR" nil nil newline)
(:texinfo-dircat "TEXINFO_DIR_CATEGORY" nil nil t) (:texinfo-dircat "TEXINFO_DIR_CATEGORY" nil nil t)
;; FIXME: The naming of these options is unsatisfactory:
;; TEXINFO_DIR_DESC corresponds (and defaults) to the document's
;; title, whereas TEXINFO_DIR_TITLE corresponds (and defaults) to
;; its filename.
(:texinfo-dirtitle "TEXINFO_DIR_TITLE" nil nil t) (:texinfo-dirtitle "TEXINFO_DIR_TITLE" nil nil t)
(:texinfo-dirdesc "TEXINFO_DIR_DESC" nil nil t) (:texinfo-dirdesc "TEXINFO_DIR_DESC" nil nil t)
(:texinfo-printed-title "TEXINFO_PRINTED_TITLE" nil nil t) (:texinfo-printed-title "TEXINFO_PRINTED_TITLE" nil nil t)
@ -147,12 +151,10 @@
"Default document encoding for Texinfo output. "Default document encoding for Texinfo output.
If nil it will default to `buffer-file-coding-system'." If nil it will default to `buffer-file-coding-system'."
:group 'org-export-texinfo
:type 'coding-system) :type 'coding-system)
(defcustom org-texinfo-default-class "info" (defcustom org-texinfo-default-class "info"
"The default Texinfo class." "The default Texinfo class."
:group 'org-export-texinfo
:type '(string :tag "Texinfo class")) :type '(string :tag "Texinfo class"))
(defcustom org-texinfo-classes (defcustom org-texinfo-classes
@ -205,7 +207,6 @@ The sectioning structure of the class is given by the elements
following the header string. For each sectioning level, a number following the header string. For each sectioning level, a number
of strings is specified. A %s formatter is mandatory in each of strings is specified. A %s formatter is mandatory in each
section string and will be replaced by the title of the section." section string and will be replaced by the title of the section."
:group 'org-export-texinfo
:version "27.1" :version "27.1"
:package-version '(Org . "9.2") :package-version '(Org . "9.2")
:type '(repeat :type '(repeat
@ -233,7 +234,6 @@ TEXT the main headline text (string).
TAGS the tags as a list of strings (list of strings or nil). TAGS the tags as a list of strings (list of strings or nil).
The function result will be used in the section format string." The function result will be used in the section format string."
:group 'org-export-texinfo
:type 'function :type 'function
:version "26.1" :version "26.1"
:package-version '(Org . "8.3")) :package-version '(Org . "8.3"))
@ -244,38 +244,32 @@ The function result will be used in the section format string."
"Column at which to start the description in the node listings. "Column at which to start the description in the node listings.
If a node title is greater than this length, the description will If a node title is greater than this length, the description will
be placed after the end of the title." be placed after the end of the title."
:group 'org-export-texinfo
:type 'integer) :type 'integer)
;;;; Timestamps ;;;; Timestamps
(defcustom org-texinfo-active-timestamp-format "@emph{%s}" (defcustom org-texinfo-active-timestamp-format "@emph{%s}"
"A printf format string to be applied to active timestamps." "A printf format string to be applied to active timestamps."
:group 'org-export-texinfo
:type 'string) :type 'string)
(defcustom org-texinfo-inactive-timestamp-format "@emph{%s}" (defcustom org-texinfo-inactive-timestamp-format "@emph{%s}"
"A printf format string to be applied to inactive timestamps." "A printf format string to be applied to inactive timestamps."
:group 'org-export-texinfo
:type 'string) :type 'string)
(defcustom org-texinfo-diary-timestamp-format "@emph{%s}" (defcustom org-texinfo-diary-timestamp-format "@emph{%s}"
"A printf format string to be applied to diary timestamps." "A printf format string to be applied to diary timestamps."
:group 'org-export-texinfo
:type 'string) :type 'string)
;;;; Links ;;;; Links
(defcustom org-texinfo-link-with-unknown-path-format "@indicateurl{%s}" (defcustom org-texinfo-link-with-unknown-path-format "@indicateurl{%s}"
"Format string for links with unknown path type." "Format string for links with unknown path type."
:group 'org-export-texinfo
:type 'string) :type 'string)
;;;; Tables ;;;; Tables
(defcustom org-texinfo-tables-verbatim nil (defcustom org-texinfo-tables-verbatim nil
"When non-nil, tables are exported verbatim." "When non-nil, tables are exported verbatim."
:group 'org-export-texinfo
:type 'boolean) :type 'boolean)
(defcustom org-texinfo-table-scientific-notation nil (defcustom org-texinfo-table-scientific-notation nil
@ -285,7 +279,6 @@ The format should have \"%s\" twice, for mantissa and exponent
\(i.e. \"%s\\\\times10^{%s}\"). \(i.e. \"%s\\\\times10^{%s}\").
When nil, no transformation is made." When nil, no transformation is made."
:group 'org-export-texinfo
:type '(choice :type '(choice
(string :tag "Format string") (string :tag "Format string")
(const :tag "No formatting" nil))) (const :tag "No formatting" nil)))
@ -297,7 +290,6 @@ This should an indicating command, e.g., \"@code\", \"@kbd\" or
\"@samp\". \"@samp\".
It can be overridden locally using the \":indic\" attribute." It can be overridden locally using the \":indic\" attribute."
:group 'org-export-texinfo
:type 'string :type 'string
:version "26.1" :version "26.1"
:package-version '(Org . "9.1") :package-version '(Org . "9.1")
@ -323,7 +315,6 @@ to typeset and protects special characters.
When no association is found for a given markup, text is returned When no association is found for a given markup, text is returned
as-is." as-is."
:group 'org-export-texinfo
:version "26.1" :version "26.1"
:package-version '(Org . "9.1") :package-version '(Org . "9.1")
:type 'alist :type 'alist
@ -341,7 +332,6 @@ The function must accept two parameters:
The function should return the string to be exported. The function should return the string to be exported.
The default function simply returns the value of CONTENTS." The default function simply returns the value of CONTENTS."
:group 'org-export-texinfo
:version "24.4" :version "24.4"
:package-version '(Org . "8.2") :package-version '(Org . "8.2")
:type 'function) :type 'function)
@ -361,7 +351,6 @@ The function must accept six parameters:
CONTENTS the contents of the inlinetask, as a string. CONTENTS the contents of the inlinetask, as a string.
The function should return the string to be exported." The function should return the string to be exported."
:group 'org-export-texinfo
:type 'function) :type 'function)
;;;; LaTeX ;;;; LaTeX
@ -374,7 +363,6 @@ fragments as Texinfo \"@displaymath\" and \"@math\" commands
respectively. Alternatively, when set to `detect', the exporter respectively. Alternatively, when set to `detect', the exporter
does so only if the installed version of Texinfo supports the does so only if the installed version of Texinfo supports the
necessary commands." necessary commands."
:group 'org-export-texinfo
:package-version '(Org . "9.6") :package-version '(Org . "9.6")
:type '(choice :type '(choice
(const :tag "Detect" detect) (const :tag "Detect" detect)
@ -391,7 +379,6 @@ body but is followed by another item, then the second item is
transcoded to `@itemx'. See info node `(org)Plain lists in transcoded to `@itemx'. See info node `(org)Plain lists in
Texinfo export' for how to enable this for individual lists." Texinfo export' for how to enable this for individual lists."
:package-version '(Org . "9.6") :package-version '(Org . "9.6")
:group 'org-export-texinfo
:type 'boolean :type 'boolean
:safe t) :safe t)
@ -406,7 +393,6 @@ relative file name, %F by the absolute file name, %b by the file
base name (i.e. without directory and extension parts), %o by the base name (i.e. without directory and extension parts), %o by the
base directory of the file and %O by the absolute file name of base directory of the file and %O by the absolute file name of
the output file." the output file."
:group 'org-export-texinfo
:version "26.1" :version "26.1"
:package-version '(Org . "9.1") :package-version '(Org . "9.1")
:type '(repeat :tag "Shell command sequence" :type '(repeat :tag "Shell command sequence"
@ -416,8 +402,8 @@ the output file."
'("aux" "toc" "cp" "fn" "ky" "pg" "tp" "vr") '("aux" "toc" "cp" "fn" "ky" "pg" "tp" "vr")
"The list of file extensions to consider as Texinfo logfiles. "The list of file extensions to consider as Texinfo logfiles.
The logfiles will be remove if `org-texinfo-remove-logfiles' is The logfiles will be remove if `org-texinfo-remove-logfiles' is
non-nil." non-nil."
:group 'org-export-texinfo
:type '(repeat (string :tag "Extension"))) :type '(repeat (string :tag "Extension")))
(defcustom org-texinfo-remove-logfiles t (defcustom org-texinfo-remove-logfiles t
@ -815,19 +801,31 @@ holding export options."
(format "@copying\n%s@end copying\n\n" (format "@copying\n%s@end copying\n\n"
(org-element-normalize-string (org-element-normalize-string
(org-export-data copying info)))) (org-export-data copying info))))
;; Info directory information. Only supply if both title and ;; Info directory information. Only supply if category is provided.
;; category are provided. ;; FIXME: A Texinfo doc without a direntry is significantly less useful
(let ((dircat (plist-get info :texinfo-dircat)) ;; since it won't appear in the main Info-directory, so maybe we should
(dirtitle ;; use a default category like "misc"?
(let ((title (plist-get info :texinfo-dirtitle))) (let* ((dircat (plist-get info :texinfo-dircat))
(and title (dt (plist-get info :texinfo-dirtitle))
(string-match "^\\(?:\\* \\)?\\(.*?\\)\\(\\.\\)?$" title) (file (file-name-sans-extension
(format "* %s." (match-string 1 title)))))) (or (org-strip-quotes (plist-get info :texinfo-filename))
(when (and dircat dirtitle) (plist-get info :output-file))))
(dirtitle
(cond
((and dt
(or (string-match "\\`\\* \\(.*?\\)\\(\\.\\)?\\'" dt)
(string-match "\\`\\(.*(.*)\\)\\(\\.\\)?\\'" dt)))
;; `dt' is already "complete".
(format "* %s." (match-string 1 dt)))
((and dt (not (equal dt file)))
(format "* %s: (%s)." dt file))
(t (format "* %s." file)))))
(when dircat
(concat "@dircategory " dircat "\n" (concat "@dircategory " dircat "\n"
"@direntry\n" "@direntry\n"
(let ((dirdesc (let ((dirdesc
(let ((desc (plist-get info :texinfo-dirdesc))) (let ((desc (or (plist-get info :texinfo-dirdesc)
title)))
(cond ((not desc) nil) (cond ((not desc) nil)
((string-suffix-p "." desc) desc) ((string-suffix-p "." desc) desc)
(t (concat desc ".")))))) (t (concat desc "."))))))
@ -1590,7 +1588,7 @@ information."
(concat (concat
"@noindent" "@noindent"
(mapconcat (mapconcat
'identity #'identity
(delq nil (delq nil
(list (list
(let ((closed (org-element-property :closed planning))) (let ((closed (org-element-property :closed planning)))