diff options
| author | Glenn Morris | 2021-03-04 10:43:25 -0800 |
|---|---|---|
| committer | Glenn Morris | 2021-03-04 10:43:25 -0800 |
| commit | bd443f4e9c50463524f48cf5c43f35f2cecd528a (patch) | |
| tree | 10d961c1a81ea47b81a6896d3dc3ecf8d06f8a6a /build-aux | |
| parent | ee6527545d4d81e27cfd8b460881c57e2bc5c40a (diff) | |
| download | emacs-bd443f4e9c50463524f48cf5c43f35f2cecd528a.tar.gz emacs-bd443f4e9c50463524f48cf5c43f35f2cecd528a.zip | |
* build-aux/make-info-dir: Handle .org input files.
Diffstat (limited to 'build-aux')
| -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}" ' | |||
| 52 | topic[ntopics++] = "Emacs misc features" | 52 | topic[ntopics++] = "Emacs misc features" |
| 53 | topic[ntopics++] = "Emacs lisp libraries" | 53 | topic[ntopics++] = "Emacs lisp libraries" |
| 54 | topic[ntopics] = "Unknown category" | 54 | topic[ntopics] = "Unknown category" |
| 55 | texinfo = 0 | ||
| 55 | } | 56 | } |
| 57 | |||
| 56 | /^@dircategory / { | 58 | /^@dircategory / { |
| 59 | texinfo = 1 | ||
| 57 | sub(/^@dircategory /, "") | 60 | sub(/^@dircategory /, "") |
| 58 | detexinfo() | 61 | detexinfo() |
| 59 | for (dircat = 0; dircat < ntopics && topic[dircat] != $0; dircat++) | 62 | for (dircat = 0; dircat < ntopics && topic[dircat] != $0; dircat++) |
| @@ -66,6 +69,33 @@ exec "${AWK-awk}" ' | |||
| 66 | data[dircat] = data[dircat] $0 "\n" | 69 | data[dircat] = data[dircat] $0 "\n" |
| 67 | } | 70 | } |
| 68 | } | 71 | } |
| 72 | |||
| 73 | ## Org stuff. TODO we assume the order of the texinfo items. | ||
| 74 | { | ||
| 75 | ## TODO Check FILENAME suffix instead? | ||
| 76 | ## TODO Is this portable awk? | ||
| 77 | if (FNR == 1) texinfo = 0 | ||
| 78 | |||
| 79 | ## If applied to the generated org.texi file, this picks up the examples. | ||
| 80 | ## Thanks for making life more difficult... | ||
| 81 | if (texinfo) next | ||
| 82 | |||
| 83 | if (tolower($0) ~ /^#\+texinfo_dir_category/) { | ||
| 84 | sub(/^#[^:]*: /, "") | ||
| 85 | for (dircat = 0; dircat < ntopics && topic[dircat] != $0; dircat++) | ||
| 86 | continue; | ||
| 87 | } | ||
| 88 | if (tolower($0) ~ /^#\+texinfo_dir_title/) { | ||
| 89 | sub(/^#[^:]*: /, "") | ||
| 90 | ## Note this does not fill any long descriptions. | ||
| 91 | data[dircat] = data[dircat] sprintf("* %-30s", ($0 ". ")) | ||
| 92 | } | ||
| 93 | if (tolower($0) ~ /^#\+texinfo_dir_desc/) { | ||
| 94 | sub(/^#[^:]*: /, "") | ||
| 95 | data[dircat] = data[dircat] $0 ".\n" | ||
| 96 | } | ||
| 97 | } | ||
| 98 | |||
| 69 | END { | 99 | END { |
| 70 | for (dircat = 0; dircat <= ntopics; dircat++) | 100 | for (dircat = 0; dircat <= ntopics; dircat++) |
| 71 | if (data[dircat]) | 101 | if (data[dircat]) |