aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2024-03-03 22:09:24 -0500
committerStefan Monnier2024-03-03 22:09:24 -0500
commit445f376e4e613ebee94d2844926269bfa8793858 (patch)
treed75d7ea7351fb7fddb63f24fa1aa220ce49e7727
parent1a37fe3a66930bb8151a29c722dbe3bebc20d033 (diff)
downloademacs-445f376e4e613ebee94d2844926269bfa8793858.tar.gz
emacs-445f376e4e613ebee94d2844926269bfa8793858.zip
Revert "ox-texinfo:: Require only TEXINFO_DIR_CATEGORY"
This reverts commit 5254c582efb3e7171e955dde653e7530d2d3ffef.
-rw-r--r--doc/misc/org.org11
-rw-r--r--lisp/org/ox-texinfo.el58
2 files changed, 32 insertions, 37 deletions
diff --git a/doc/misc/org.org b/doc/misc/org.org
index f4590525892..05ab5b36ca0 100644
--- a/doc/misc/org.org
+++ b/doc/misc/org.org
@@ -15322,18 +15322,11 @@ the general options (see [[*Export Settings]]).
15322 15322
15323 #+cindex: @samp{TEXINFO_DIR_TITLE}, keyword 15323 #+cindex: @samp{TEXINFO_DIR_TITLE}, keyword
15324 The directory title of the document. 15324 The directory title of the document.
15325 This is the short name under which the ~m~ command will find your
15326 manual in the main Info directory. It defaults to the base name of
15327 the Texinfo file.
15328
15329 If you need more control, it can also be the full entry using the
15330 syntax ~* TITLE: (FILENAME).~.
15331 15325
15332- =TEXINFO_DIR_DESC= :: 15326- =TEXINFO_DIR_DESC= ::
15333 15327
15334 #+cindex: @samp{TEXINFO_DIR_DESC}, keyword 15328 #+cindex: @samp{TEXINFO_DIR_DESC}, keyword
15335 The directory description of the document. 15329 The directory description of the document.
15336 Defaults to the title of the document.
15337 15330
15338- =TEXINFO_PRINTED_TITLE= :: 15331- =TEXINFO_PRINTED_TITLE= ::
15339 15332
@@ -15429,7 +15422,7 @@ Here is an example that writes to the Info directory file:
15429 15422
15430#+begin_example 15423#+begin_example
15431,#+TEXINFO_DIR_CATEGORY: Emacs 15424,#+TEXINFO_DIR_CATEGORY: Emacs
15432,#+TEXINFO_DIR_TITLE: Org Mode 15425,#+TEXINFO_DIR_TITLE: Org Mode: (org)
15433,#+TEXINFO_DIR_DESC: Outline-based notes management and organizer 15426,#+TEXINFO_DIR_DESC: Outline-based notes management and organizer
15434#+end_example 15427#+end_example
15435 15428
@@ -15837,7 +15830,7 @@ Texinfo code.
15837,#+TEXINFO_HEADER: @syncodeindex pg cp 15830,#+TEXINFO_HEADER: @syncodeindex pg cp
15838 15831
15839,#+TEXINFO_DIR_CATEGORY: Texinfo documentation system 15832,#+TEXINFO_DIR_CATEGORY: Texinfo documentation system
15840,#+TEXINFO_DIR_TITLE: sample 15833,#+TEXINFO_DIR_TITLE: sample: (sample)
15841,#+TEXINFO_DIR_DESC: Invoking sample 15834,#+TEXINFO_DIR_DESC: Invoking sample
15842 15835
15843,#+TEXINFO_PRINTED_TITLE: GNU Sample 15836,#+TEXINFO_PRINTED_TITLE: GNU Sample
diff --git a/lisp/org/ox-texinfo.el b/lisp/org/ox-texinfo.el
index 5065c3fb63c..84313645e6e 100644
--- a/lisp/org/ox-texinfo.el
+++ b/lisp/org/ox-texinfo.el
@@ -110,10 +110,6 @@
110 (:subtitle "SUBTITLE" nil nil parse) 110 (:subtitle "SUBTITLE" nil nil parse)
111 (:subauthor "SUBAUTHOR" nil nil newline) 111 (:subauthor "SUBAUTHOR" nil nil newline)
112 (:texinfo-dircat "TEXINFO_DIR_CATEGORY" nil nil t) 112 (:texinfo-dircat "TEXINFO_DIR_CATEGORY" nil nil t)
113 ;; FIXME: The naming of these options is unsatisfactory:
114 ;; TEXINFO_DIR_DESC corresponds (and defaults) to the document's
115 ;; title, whereas TEXINFO_DIR_TITLE corresponds (and defaults) to
116 ;; its filename.
117 (:texinfo-dirtitle "TEXINFO_DIR_TITLE" nil nil t) 113 (:texinfo-dirtitle "TEXINFO_DIR_TITLE" nil nil t)
118 (:texinfo-dirdesc "TEXINFO_DIR_DESC" nil nil t) 114 (:texinfo-dirdesc "TEXINFO_DIR_DESC" nil nil t)
119 (:texinfo-printed-title "TEXINFO_PRINTED_TITLE" nil nil t) 115 (:texinfo-printed-title "TEXINFO_PRINTED_TITLE" nil nil t)
@@ -151,10 +147,12 @@
151 "Default document encoding for Texinfo output. 147 "Default document encoding for Texinfo output.
152 148
153If nil it will default to `buffer-file-coding-system'." 149If nil it will default to `buffer-file-coding-system'."
150 :group 'org-export-texinfo
154 :type 'coding-system) 151 :type 'coding-system)
155 152
156(defcustom org-texinfo-default-class "info" 153(defcustom org-texinfo-default-class "info"
157 "The default Texinfo class." 154 "The default Texinfo class."
155 :group 'org-export-texinfo
158 :type '(string :tag "Texinfo class")) 156 :type '(string :tag "Texinfo class"))
159 157
160(defcustom org-texinfo-classes 158(defcustom org-texinfo-classes
@@ -207,6 +205,7 @@ The sectioning structure of the class is given by the elements
207following the header string. For each sectioning level, a number 205following the header string. For each sectioning level, a number
208of strings is specified. A %s formatter is mandatory in each 206of strings is specified. A %s formatter is mandatory in each
209section string and will be replaced by the title of the section." 207section string and will be replaced by the title of the section."
208 :group 'org-export-texinfo
210 :version "27.1" 209 :version "27.1"
211 :package-version '(Org . "9.2") 210 :package-version '(Org . "9.2")
212 :type '(repeat 211 :type '(repeat
@@ -234,6 +233,7 @@ TEXT the main headline text (string).
234TAGS the tags as a list of strings (list of strings or nil). 233TAGS the tags as a list of strings (list of strings or nil).
235 234
236The function result will be used in the section format string." 235The function result will be used in the section format string."
236 :group 'org-export-texinfo
237 :type 'function 237 :type 'function
238 :version "26.1" 238 :version "26.1"
239 :package-version '(Org . "8.3")) 239 :package-version '(Org . "8.3"))
@@ -244,32 +244,38 @@ The function result will be used in the section format string."
244 "Column at which to start the description in the node listings. 244 "Column at which to start the description in the node listings.
245If a node title is greater than this length, the description will 245If a node title is greater than this length, the description will
246be placed after the end of the title." 246be placed after the end of the title."
247 :group 'org-export-texinfo
247 :type 'integer) 248 :type 'integer)
248 249
249;;;; Timestamps 250;;;; Timestamps
250 251
251(defcustom org-texinfo-active-timestamp-format "@emph{%s}" 252(defcustom org-texinfo-active-timestamp-format "@emph{%s}"
252 "A printf format string to be applied to active timestamps." 253 "A printf format string to be applied to active timestamps."
254 :group 'org-export-texinfo
253 :type 'string) 255 :type 'string)
254 256
255(defcustom org-texinfo-inactive-timestamp-format "@emph{%s}" 257(defcustom org-texinfo-inactive-timestamp-format "@emph{%s}"
256 "A printf format string to be applied to inactive timestamps." 258 "A printf format string to be applied to inactive timestamps."
259 :group 'org-export-texinfo
257 :type 'string) 260 :type 'string)
258 261
259(defcustom org-texinfo-diary-timestamp-format "@emph{%s}" 262(defcustom org-texinfo-diary-timestamp-format "@emph{%s}"
260 "A printf format string to be applied to diary timestamps." 263 "A printf format string to be applied to diary timestamps."
264 :group 'org-export-texinfo
261 :type 'string) 265 :type 'string)
262 266
263;;;; Links 267;;;; Links
264 268
265(defcustom org-texinfo-link-with-unknown-path-format "@indicateurl{%s}" 269(defcustom org-texinfo-link-with-unknown-path-format "@indicateurl{%s}"
266 "Format string for links with unknown path type." 270 "Format string for links with unknown path type."
271 :group 'org-export-texinfo
267 :type 'string) 272 :type 'string)
268 273
269;;;; Tables 274;;;; Tables
270 275
271(defcustom org-texinfo-tables-verbatim nil 276(defcustom org-texinfo-tables-verbatim nil
272 "When non-nil, tables are exported verbatim." 277 "When non-nil, tables are exported verbatim."
278 :group 'org-export-texinfo
273 :type 'boolean) 279 :type 'boolean)
274 280
275(defcustom org-texinfo-table-scientific-notation nil 281(defcustom org-texinfo-table-scientific-notation nil
@@ -279,6 +285,7 @@ The format should have \"%s\" twice, for mantissa and exponent
279\(i.e. \"%s\\\\times10^{%s}\"). 285\(i.e. \"%s\\\\times10^{%s}\").
280 286
281When nil, no transformation is made." 287When nil, no transformation is made."
288 :group 'org-export-texinfo
282 :type '(choice 289 :type '(choice
283 (string :tag "Format string") 290 (string :tag "Format string")
284 (const :tag "No formatting" nil))) 291 (const :tag "No formatting" nil)))
@@ -290,6 +297,7 @@ This should an indicating command, e.g., \"@code\", \"@kbd\" or
290\"@samp\". 297\"@samp\".
291 298
292It can be overridden locally using the \":indic\" attribute." 299It can be overridden locally using the \":indic\" attribute."
300 :group 'org-export-texinfo
293 :type 'string 301 :type 'string
294 :version "26.1" 302 :version "26.1"
295 :package-version '(Org . "9.1") 303 :package-version '(Org . "9.1")
@@ -315,6 +323,7 @@ to typeset and protects special characters.
315 323
316When no association is found for a given markup, text is returned 324When no association is found for a given markup, text is returned
317as-is." 325as-is."
326 :group 'org-export-texinfo
318 :version "26.1" 327 :version "26.1"
319 :package-version '(Org . "9.1") 328 :package-version '(Org . "9.1")
320 :type 'alist 329 :type 'alist
@@ -332,6 +341,7 @@ The function must accept two parameters:
332The function should return the string to be exported. 341The function should return the string to be exported.
333 342
334The default function simply returns the value of CONTENTS." 343The default function simply returns the value of CONTENTS."
344 :group 'org-export-texinfo
335 :version "24.4" 345 :version "24.4"
336 :package-version '(Org . "8.2") 346 :package-version '(Org . "8.2")
337 :type 'function) 347 :type 'function)
@@ -351,6 +361,7 @@ The function must accept six parameters:
351 CONTENTS the contents of the inlinetask, as a string. 361 CONTENTS the contents of the inlinetask, as a string.
352 362
353The function should return the string to be exported." 363The function should return the string to be exported."
364 :group 'org-export-texinfo
354 :type 'function) 365 :type 'function)
355 366
356;;;; LaTeX 367;;;; LaTeX
@@ -363,6 +374,7 @@ fragments as Texinfo \"@displaymath\" and \"@math\" commands
363respectively. Alternatively, when set to `detect', the exporter 374respectively. Alternatively, when set to `detect', the exporter
364does so only if the installed version of Texinfo supports the 375does so only if the installed version of Texinfo supports the
365necessary commands." 376necessary commands."
377 :group 'org-export-texinfo
366 :package-version '(Org . "9.6") 378 :package-version '(Org . "9.6")
367 :type '(choice 379 :type '(choice
368 (const :tag "Detect" detect) 380 (const :tag "Detect" detect)
@@ -379,6 +391,7 @@ body but is followed by another item, then the second item is
379transcoded to `@itemx'. See info node `(org)Plain lists in 391transcoded to `@itemx'. See info node `(org)Plain lists in
380Texinfo export' for how to enable this for individual lists." 392Texinfo export' for how to enable this for individual lists."
381 :package-version '(Org . "9.6") 393 :package-version '(Org . "9.6")
394 :group 'org-export-texinfo
382 :type 'boolean 395 :type 'boolean
383 :safe t) 396 :safe t)
384 397
@@ -393,6 +406,7 @@ relative file name, %F by the absolute file name, %b by the file
393base name (i.e. without directory and extension parts), %o by the 406base name (i.e. without directory and extension parts), %o by the
394base directory of the file and %O by the absolute file name of 407base directory of the file and %O by the absolute file name of
395the output file." 408the output file."
409 :group 'org-export-texinfo
396 :version "26.1" 410 :version "26.1"
397 :package-version '(Org . "9.1") 411 :package-version '(Org . "9.1")
398 :type '(repeat :tag "Shell command sequence" 412 :type '(repeat :tag "Shell command sequence"
@@ -402,8 +416,8 @@ the output file."
402 '("aux" "toc" "cp" "fn" "ky" "pg" "tp" "vr") 416 '("aux" "toc" "cp" "fn" "ky" "pg" "tp" "vr")
403 "The list of file extensions to consider as Texinfo logfiles. 417 "The list of file extensions to consider as Texinfo logfiles.
404The logfiles will be remove if `org-texinfo-remove-logfiles' is 418The logfiles will be remove if `org-texinfo-remove-logfiles' is
405
406non-nil." 419non-nil."
420 :group 'org-export-texinfo
407 :type '(repeat (string :tag "Extension"))) 421 :type '(repeat (string :tag "Extension")))
408 422
409(defcustom org-texinfo-remove-logfiles t 423(defcustom org-texinfo-remove-logfiles t
@@ -801,31 +815,19 @@ holding export options."
801 (format "@copying\n%s@end copying\n\n" 815 (format "@copying\n%s@end copying\n\n"
802 (org-element-normalize-string 816 (org-element-normalize-string
803 (org-export-data copying info)))) 817 (org-export-data copying info))))
804 ;; Info directory information. Only supply if category is provided. 818 ;; Info directory information. Only supply if both title and
805 ;; FIXME: A Texinfo doc without a direntry is significantly less useful 819 ;; category are provided.
806 ;; since it won't appear in the main Info-directory, so maybe we should 820 (let ((dircat (plist-get info :texinfo-dircat))
807 ;; use a default category like "misc"? 821 (dirtitle
808 (let* ((dircat (plist-get info :texinfo-dircat)) 822 (let ((title (plist-get info :texinfo-dirtitle)))
809 (dt (plist-get info :texinfo-dirtitle)) 823 (and title
810 (file (file-name-sans-extension 824 (string-match "^\\(?:\\* \\)?\\(.*?\\)\\(\\.\\)?$" title)
811 (or (org-strip-quotes (plist-get info :texinfo-filename)) 825 (format "* %s." (match-string 1 title))))))
812 (plist-get info :output-file)))) 826 (when (and dircat dirtitle)
813 (dirtitle
814 (cond
815 ((and dt
816 (or (string-match "\\`\\* \\(.*?\\)\\(\\.\\)?\\'" dt)
817 (string-match "\\`\\(.*(.*)\\)\\(\\.\\)?\\'" dt)))
818 ;; `dt' is already "complete".
819 (format "* %s." (match-string 1 dt)))
820 ((and dt (not (equal dt file)))
821 (format "* %s: (%s)." dt file))
822 (t (format "* %s." file)))))
823 (when dircat
824 (concat "@dircategory " dircat "\n" 827 (concat "@dircategory " dircat "\n"
825 "@direntry\n" 828 "@direntry\n"
826 (let ((dirdesc 829 (let ((dirdesc
827 (let ((desc (or (plist-get info :texinfo-dirdesc) 830 (let ((desc (plist-get info :texinfo-dirdesc)))
828 title)))
829 (cond ((not desc) nil) 831 (cond ((not desc) nil)
830 ((string-suffix-p "." desc) desc) 832 ((string-suffix-p "." desc) desc)
831 (t (concat desc ".")))))) 833 (t (concat desc "."))))))
@@ -1588,7 +1590,7 @@ information."
1588 (concat 1590 (concat
1589 "@noindent" 1591 "@noindent"
1590 (mapconcat 1592 (mapconcat
1591 #'identity 1593 'identity
1592 (delq nil 1594 (delq nil
1593 (list 1595 (list
1594 (let ((closed (org-element-property :closed planning))) 1596 (let ((closed (org-element-property :closed planning)))