diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-09-25 16:15:16 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-09-25 16:15:16 -0400 |
commit | 650c20f1ca4e07591a727e1cfcc74b3363d15985 (patch) | |
tree | 85d11f6437cde22f410c25e0e5f71a3131ebd07d /build-aux/make-info-dir | |
parent | 8869332684c2302b5ba1ead4568bbc7ba1c0183e (diff) | |
parent | 4b85ae6a24380fb67a3315eaec9233f17a872473 (diff) | |
download | emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.gz emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.bz2 emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.zip |
Merge 'master' into noverlay
Diffstat (limited to 'build-aux/make-info-dir')
-rwxr-xr-x | build-aux/make-info-dir | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/build-aux/make-info-dir b/build-aux/make-info-dir index 8a1d580363a..c29ea5088b7 100755 --- a/build-aux/make-info-dir +++ b/build-aux/make-info-dir @@ -2,7 +2,7 @@ ### make-info-dir - create info/dir, for systems without install-info -## Copyright (C) 2013-2017 Free Software Foundation, Inc. +## Copyright (C) 2013-2022 Free Software Foundation, Inc. ## Author: Glenn Morris <rgm@gnu.org> ## Maintainer: emacs-devel@gnu.org @@ -52,8 +52,11 @@ exec "${AWK-awk}" ' topic[ntopics++] = "Emacs misc features" topic[ntopics++] = "Emacs lisp libraries" topic[ntopics] = "Unknown category" + texinfo = 0 } + /^@dircategory / { + texinfo = 1 sub(/^@dircategory /, "") detexinfo() for (dircat = 0; dircat < ntopics && topic[dircat] != $0; dircat++) @@ -66,6 +69,33 @@ exec "${AWK-awk}" ' data[dircat] = data[dircat] $0 "\n" } } + + ## Org stuff. TODO we assume the order of the texinfo items. + { + ## TODO Check FILENAME suffix instead? + ## TODO Is this portable awk? + if (FNR == 1) texinfo = 0 + + ## If applied to the generated org.texi file, this picks up the examples. + ## Thanks for making life more difficult... + if (texinfo) next + + if (tolower($0) ~ /^#\+texinfo_dir_category/) { + sub(/^#[^:]*: /, "") + for (dircat = 0; dircat < ntopics && topic[dircat] != $0; dircat++) + continue; + } + if (tolower($0) ~ /^#\+texinfo_dir_title/) { + sub(/^#[^:]*: /, "") + ## Note this does not fill any long descriptions. + data[dircat] = data[dircat] sprintf("* %-30s", ($0 ". ")) + } + if (tolower($0) ~ /^#\+texinfo_dir_desc/) { + sub(/^#[^:]*: /, "") + data[dircat] = data[dircat] $0 ".\n" + } + } + END { for (dircat = 0; dircat <= ntopics; dircat++) if (data[dircat]) |