aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2011-12-10 14:22:25 +0200
committerEli Zaretskii2011-12-10 14:22:25 +0200
commitb8830d2864fa513f951bcaf392bd577b0315b7ad (patch)
tree1dc91c5c072812642535e01df9ca2a8b3c1f8680
parente5d84bfe065f1d8172165ee2bdd15193f7447d8a (diff)
downloademacs-b8830d2864fa513f951bcaf392bd577b0315b7ad.tar.gz
emacs-b8830d2864fa513f951bcaf392bd577b0315b7ad.zip
Fix bug #2975 with insufficient docs of texinfo-master-menu.
lisp/textmodes/texnfo-upd.el: Correct outdated description about texinfo-master-menu. (texinfo-master-menu): Explain better in the doc string what the function really does. (texinfo-insert-master-menu-list): Improve the error message displayed if there's no menu in the Top node.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/textmodes/texnfo-upd.el37
2 files changed, 28 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3d1f85ea73e..74fc51c5e69 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,12 +3,17 @@
3 * textmodes/texnfo-upd.el: Update commentary. Add a warning not 3 * textmodes/texnfo-upd.el: Update commentary. Add a warning not
4 to use texinfo-update-node and commands that call it if the 4 to use texinfo-update-node and commands that call it if the
5 Texinfo file uses @node lines without next/prev/up pointers. 5 Texinfo file uses @node lines without next/prev/up pointers.
6 Correct outdated description about texinfo-master-menu.
6 (texinfo-all-menus-update, texinfo-master-menu) 7 (texinfo-all-menus-update, texinfo-master-menu)
7 (texinfo-update-node, texinfo-every-node-update) 8 (texinfo-update-node, texinfo-every-node-update)
8 (texinfo-multiple-files-update): Doc fix. Warn against updating 9 (texinfo-multiple-files-update): Doc fix. Warn against updating
9 all the @node lines. 10 all the @node lines.
10 (texinfo-master-menu): Only call texinfo-update-node if the prefix 11 (texinfo-master-menu): Only call texinfo-update-node if the prefix
11 argument is numeric. (Bug#2975) See also this thread: 12 argument is numeric. Explain better in the doc string what the
13 function really does.
14 (texinfo-insert-master-menu-list): Improve the error message
15 displayed if there's no menu in the Top node.
16 (Bug#2975) See also this thread:
12 http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00156.html. 17 http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00156.html.
13 18
142011-12-09 Manuel Gómez <mgrojo@gmail.com> (tiny change) 192011-12-09 Manuel Gómez <mgrojo@gmail.com> (tiny change)
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el
index e21e8ba7623..d674b3a397e 100644
--- a/lisp/textmodes/texnfo-upd.el
+++ b/lisp/textmodes/texnfo-upd.el
@@ -142,14 +142,14 @@
142 142
143;; The `texinfo-master-menu' function creates an extended menu located 143;; The `texinfo-master-menu' function creates an extended menu located
144;; after the top node. (The file must have a top node.) This 144;; after the top node. (The file must have a top node.) This
145;; function works only on Texinfo files all of whose @node lines are 145;; function works only on Texinfo files all of whose menus are
146;; present in a single file; use `texinfo-multiple-files-update' for 146;; present in a single file; use `texinfo-multiple-files-update' for
147;; multi-file manuals. The function first updates all the regular 147;; multi-file manuals. The function constructs a master menu that
148;; menus in the buffer (incorporating the descriptions from 148;; includes every entry from every other menu. Use this command to
149;; pre-existing menus), and then constructs a master menu that 149;; create or update the @detailmenu menu after you've created or
150;; includes every entry from every other menu. (However, the function 150;; updated all the menus in the file, including the menu in the Top
151;; cannot update an already existing master menu; if one exists, it 151;; node, using the `texinfo-make-menu' or the `texinfo-all-menus-update'
152;; must be removed before calling the function.) 152;; command.
153 153
154;; The `texinfo-indent-menu-description' function indents every 154;; The `texinfo-indent-menu-description' function indents every
155;; description in the menu following point, to the specified column. 155;; description in the menu following point, to the specified column.
@@ -878,6 +878,16 @@ Remove pre-existing master menu, if there is one.
878This function supports only single-file manuals. For multi-file 878This function supports only single-file manuals. For multi-file
879manuals, use `texinfo-multiple-files-update'. 879manuals, use `texinfo-multiple-files-update'.
880 880
881This function creates or updates the @detailmenu section of a
882master menu that follows the Top node. It replaces any existing
883detailed menu that follows the top node. The detailed menu
884includes every entry from all the other menus. By default, the
885existing menus, including the menu in the Top node, are not
886updated according to the buffer contents, so all the menus should
887be updated first using `texinfo-make-menu' or
888`texinfo-all-menus-update', which see. Alternatively, invoke
889this function with a prefix argument, see below.
890
881Non-nil, non-numeric argument (C-u prefix, if interactive) means 891Non-nil, non-numeric argument (C-u prefix, if interactive) means
882first update all existing menus in the buffer (incorporating 892first update all existing menus in the buffer (incorporating
883descriptions from pre-existing menus) before it constructs the 893descriptions from pre-existing menus) before it constructs the
@@ -888,13 +898,10 @@ invoke with a numeric argument if your Texinfo file uses @node
888lines without the `Next', `Previous', `Up' pointers, as the 898lines without the `Next', `Previous', `Up' pointers, as the
889result could be an invalid Texinfo file! 899result could be an invalid Texinfo file!
890 900
891This function creates a master menu that follows the top node. The 901The function removes and recreates the detailed part of an already
892master menu includes every entry from all the other menus. It 902existing master menu. This action assumes that the pre-existing
893replaces any existing ordinary menu that follows the top node. 903master menu uses the standard `texinfo-master-menu-header' for the
894 904detailed menu.
895The function removes the detailed part of an already existing master
896menu. This action depends on the pre-existing master menu using the
897standard `texinfo-master-menu-header'.
898 905
899The master menu has the following format, which is adapted from the 906The master menu has the following format, which is adapted from the
900recommendation in the Texinfo Manual: 907recommendation in the Texinfo Manual:
@@ -1017,7 +1024,7 @@ However, there does not need to be a title field."
1017 (let ((first-chapter 1024 (let ((first-chapter
1018 (save-excursion (re-search-forward "^@node\\|^@include") (point)))) 1025 (save-excursion (re-search-forward "^@node\\|^@include") (point))))
1019 (unless (re-search-forward "^@menu" first-chapter t) 1026 (unless (re-search-forward "^@menu" first-chapter t)
1020 (error "Buffer lacks ordinary `Top' menu in which to insert master"))) 1027 (error "Buffer lacks a menu in its first node; create it, then run me again")))
1021 (beginning-of-line) 1028 (beginning-of-line)
1022 (delete-region ; buffer must have ordinary top menu 1029 (delete-region ; buffer must have ordinary top menu
1023 (point) 1030 (point)