diff options
author | Glenn Morris <rgm@gnu.org> | 2021-03-04 10:43:25 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2021-03-04 10:43:25 -0800 |
commit | bd443f4e9c50463524f48cf5c43f35f2cecd528a (patch) | |
tree | 10d961c1a81ea47b81a6896d3dc3ecf8d06f8a6a | |
parent | ee6527545d4d81e27cfd8b460881c57e2bc5c40a (diff) | |
download | emacs-bd443f4e9c50463524f48cf5c43f35f2cecd528a.tar.gz emacs-bd443f4e9c50463524f48cf5c43f35f2cecd528a.tar.bz2 emacs-bd443f4e9c50463524f48cf5c43f35f2cecd528a.zip |
* build-aux/make-info-dir: Handle .org input files.
-rwxr-xr-x | build-aux/make-info-dir | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/build-aux/make-info-dir b/build-aux/make-info-dir index ea26479cd96..256c9f025cc 100755 --- a/build-aux/make-info-dir +++ b/build-aux/make-info-dir @@ -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]) |