Lines Matching defs:the

12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
30 ;; Summary: how to use the updating commands
35 ;; * insert the `Next', `Previous' and `Up' pointers of a node,
36 ;; * insert or update the menu for a section,
39 ;; With a prefix argument, the `texinfo-update-node' and
40 ;; `texinfo-make-menu' functions do their jobs in the region.
42 ;; In brief, the functions for creating or updating nodes and menus, are:
56 ;; The `texinfo-column-for-description' variable specifies the column to
62 ;; To use the updating commands, you must structure your Texinfo file
63 ;; hierarchically. Each `@node' line, with the exception of the top
72 ;; or like this (without the `@comment' line):
77 ;; If the file has a `top' node, it must be called `top' or `Top' and
78 ;; be the first node in the file.
85 ;; the correct next, previous and up pointers for the node in which
86 ;; point is located (i.e., for the node preceding point).
88 ;; With prefix argument, the `texinfo-update-node' function inserts the
89 ;; correct next, previous and up pointers for the nodes inside the
92 ;; It does not matter whether the `@node' line has pre-existing
96 ;; on the whole buffer.
98 ;; The `texinfo-sequential-node-update' function inserts the
99 ;; immediately following and preceding node into the `Next' or
109 ;; updates a menu for the section encompassing the node that follows
110 ;; point. With an argument, it makes or updates menus for the nodes
111 ;; within or part of the marked region.
113 ;; Whenever an existing menu is updated, the descriptions from
114 ;; that menu are incorporated into the new menu. This is done by copying
115 ;; descriptions from the existing menu to the entries in the new menu
116 ;; that have the same node names. If the node names are different, the
117 ;; descriptions are not copied to the new menu.
123 ;; on the whole buffer.
126 ;; after the top node. (The file must have a top node.) The function
127 ;; first updates all the regular menus in the buffer (incorporating the
129 ;; menu that includes every entry from every other menu. (However, the
131 ;; exists, it must be removed before calling the function.)
134 ;; description in the menu following point, to the specified column.
136 ;; description in every menu in the region. This function does not
139 ;; The `texinfo-insert-node-lines' function inserts `@node' before the
141 ;; file where the `@node' lines are missing.
143 ;; With a non-nil argument (prefix, if interactive), the function not
144 ;; only inserts `@node' lines but also inserts the chapter or section
145 ;; titles as the names of the corresponding nodes; and inserts titles
158 It comes after the chapter-level menu entries.")
162 Make the menu for the section enclosing the node found following point.
165 for nodes within or part of the marked region.
167 Whenever a menu exists, and is being updated, the descriptions that
168 are associated with node names in the pre-existing menu are
169 incorporated into the new menu. Otherwise, the nodes' section titles
202 "Make a menu of all the appropriate nodes in this section.
204 at the level specified by LEVEL. Point is left at the end of menu."
230 If called with a non-nil argument, this function first updates all the
231 nodes in the buffer before updating the menus."
269 (message "Updating the master menu in %s... " (buffer-name))
273 (message "Done...updated all the menus. You may save the buffer.")))
277 Search is limited to the end of the marked region, REGION-END,
278 and to the end of the menu region for the level.
280 Return t if the node is found, else nil. Leave point at the beginning
281 of the node if one is found; else do not move point."
291 ;; the next higher level node marks the end of this
300 Search is limited to the end of the marked region, REGION-END.
302 Return t if the node is found, else nil. Leave point at the beginning
303 of the node if one is found; else do not move point."
322 ;;; Making the list of new menu entries
326 Point is left at the end of the menu region, but the menu is not inserted.
330 third argument is the level of the nodes that are the entries.
333 an element of the list. If the description does not exist, the
334 element consists only of the node name."
349 First argument is a string such as \"section\" specifying the general
350 hierarchical level of the menu; second argument is a position
351 specifying the end of the search.
353 The function returns t if the node is found, else nil. It searches
354 forward from point, and leaves point at the beginning of the node.
356 The function finds entries of the same type. Thus `subsections' and
357 `unnumberedsubsecs' will appear in the same menu."
372 "Return the node name as a string.
374 Start with point at the beginning of the node line; copy the text
375 after the node command up to the first comma on the line, if any, and
376 return the text as a string. Leaves point at the beginning of the
391 "Return the title of the section as a string.
392 The title is used as a description line in the menu when one does not
395 Move point to the beginning of the appropriate section line by going
396 to the start of the text matched by last regexp searched for, which
399 ;; could use the same re-search as in `texinfo-menu-locate-entry-p'
413 ;;; Handling the old menu
416 "Move point to the beginning of the menu for this section, if any.
417 Otherwise move point to the end of the first node of this section.
420 First argument is the position of the beginning of the section in which
421 the menu will be located; second argument is the position of the first
422 node within the section.
424 If no menu is found, the function inserts two newlines just before the
425 end of the section, and leaves point there where a menu ought to be."
432 "Copy the old menu line descriptions that exist to the new menu.
436 If the node-name of the new menu is found in the old menu, insert the
437 old description into the new entry.
439 For this function, the new menu is a list made up of lists of dotted
440 pairs in which the first element of the pair is the node name and the
441 second element the description. The new menu is changed destructively.
442 The old menu is the menu as it appears in the Texinfo file."
449 ;; Existing nodes can have the form
454 ;; Recognize both when looking for the description.
469 "Copy any old menu entry names to the new menu.
473 If the node-name of the new menu entry cannot be found in the old
476 For this function, the new menu is a list made up of lists of dotted
477 pairs in which the first element of the pair is the node name and the
478 second element is the description (or nil).
480 If we find an existing menu entry name, we change the first element of
481 the pair to be another dotted pair in which the car is the menu entry
482 name and the cdr is the node name.
484 NEW-MENU-LIST is changed destructively. The old menu is the menu as it
485 appears in the texinfo file."
492 ;; Existing nodes can have the form
497 ;; We're interested in the second case.
503 (car new-menu-list) ; replace the node name
511 Point must be located just after the node name. Point left before description.
537 "Delete the old menu. Point must be in or after menu.
538 First argument is position of the beginning of the section in which
539 the menu will be located; second argument is the position of the first
540 node within the section."
558 Indents the first line of the description, if any, to the value of
566 However, the description field might be nil.
568 Also, the node-name field might itself be a dotted pair (call it P) of
569 strings instead of just a string. In that case, the car of P
570 is the menu entry name, and the cdr of P is the node name."
577 ;; Insert the node name (and menu entry name, if present).
580 ;; "Double colon" entry line; menu entry and node name are the same,
585 ;; Insert the description, if present.
604 "In this menu entry, insert the node's section title as a description.
606 Do not insert a title if the line contains an existing description.
608 You will need to edit the inserted text since a useful description
609 complements the node name rather than repeats it as a title does."
621 ;; "Double colon" entry line; menu entry and node name are the same,
649 ;; Search for node that matches node name, and copy the section title.
673 ;; Return point to the menu and insert the title.
685 ;; Since the make-menu functions indent descriptions, these functions
691 description in every menu in the region. Does not indent second and
704 "Indented descriptions in menu. You may save the buffer."))
712 (message "Indenting done. You may save the buffer.")))))
715 "Indent the Texinfo file menu description to TO-COLUMN-NUMBER.
716 Start with point just after the word `menu' in the `@menu' line and
717 leave point on the line before the `@end menu' line. Does not indent
743 ;;; Making the master menu
750 This function creates a master menu that follows the top node. The
751 master menu includes every entry from all the other menus. It
752 replaces any existing ordinary menu that follows the top node.
754 If called with a non-nil argument, this function first updates all the
755 menus in the buffer (incorporating descriptions from pre-existing
756 menus) before it constructs the master menu.
758 The function removes the detailed part of an already existing master
759 menu. This action depends on the pre-existing master menu using the
762 The master menu has the following format, which is adapted from the
763 recommendation in the Texinfo Manual:
765 * The first part contains the major nodes in the Texinfo file: the
766 nodes for the chapters, chapter-like sections, and the major
767 appendices. This includes the indices, so long as they are in
770 * The second and subsequent parts contain a listing of the other,
775 Each of the menus in the detailed node listing is introduced by the
776 title of the section containing the menu."
819 (message "Now making the master menu in %s... " (buffer-name))
852 "Done...completed making master menu. You may save the buffer.")))
855 "Return a list of menu entries and header lines for the master menu.
857 Start with the menu for chapters and indices and then find each
858 following menu and the title of the node preceding that menu.
878 "Format and insert the master menu in the current buffer."
923 ;; Now, insert all the other menus
953 "Find the next menu in the texinfo file.
954 If found, leave point after word `menu' on the `@menu' line, and return t.
959 "Return the title of the section preceding the menu as a string.
982 "Return the entries of an existing menu as a list.
983 Start with point just after the word `menu' in the `@menu' line
984 and leave point on the line before the `@end menu' line."
1010 ;;; Determining the hierarchical level in the texinfo file
1013 "Return the specific type of next section, as a string.
1016 Searches forward for a section. Hence, point must be before the
1018 error if the node is not the top node and a section is not found."
1041 "Return the general hierarchal level of the next node in a texinfo file.
1050 ;;; Locating the major positions
1054 Return position of the beginning of the node line; do not move point.
1056 Only argument is a string of the general type of section."
1059 ;; returns the beginning of the buffer as the beginning of the
1086 subsection, find the node for the section this subsection is within.
1088 string of the general type of section."
1106 "Locate first node of the section the menu will be placed in.
1110 First argument is the position of the beginning of the section in
1111 which the menu will be located; second argument is the position of the
1112 end of that region; it limits the search."
1149 The keys are strings specifying specific types of section; the values
1155 "Regexp matching chapter, section, other headings (but not the top node).")
1159 "Regular expression matching just the Texinfo chapter level headings.")
1163 "Regular expression matching just the Texinfo section level headings.")
1167 "Regular expression matching just the Texinfo subsection level headings.")
1171 "Regular expression matching just the Texinfo subsubsection level headings.")
1184 The keys are strings specifying the general hierarchical level in the
1185 document; the values are regular expressions.")
1212 The keys are strings specifying the general hierarchical level in the
1213 document; the values are regular expressions.")
1250 The keys are strings specifying the general hierarchical level in the
1251 document; the values are regular expressions.")
1259 "Without any prefix argument, update the node in which point is located.
1260 Interactively, a prefix argument means to operate on the region.
1275 The `texinfo-column-for-description' variable specifies the column to
1286 (texinfo-update-the-node)
1287 (message "Done...updated the node. You may save the buffer."))
1297 (texinfo-update-the-node))
1299 (message "Done...nodes updated in region. You may save the buffer."))))))
1307 (message "Done...updated every node. You may save the buffer.")))
1309 (defun texinfo-update-the-node ()
1310 "Update one node. Point must be at the beginning of node line.
1311 Leave point at the end of the node line."
1331 "Insert pointers in the Top node. This is a special case.
1334 hierarchical level in the file. The `Previous' and `Up' pointers are
1335 to `(dir)'. Point must be at the beginning of the node line, and is
1336 left at the end of the node line."
1342 ;; the top node line and the next node line, as a title
1344 ;; must be skipped. So the procedure is to search for
1345 ;; the next `@node' line, and then copy its name.
1354 "Determine whether the node has a node name. Prompt for one if not.
1358 ;; This is not clean. Use `interactive' to read the arg.
1371 Starts from the current position of the cursor, and searches forward
1372 on the line for a comma and if one is found, deletes the rest of the
1373 line, including the comma. Leaves point at beginning of line."
1383 The first and second arguments bound the search for a pointer to the
1384 beginning and end, respectively, of the enclosing higher level
1385 section. The third argument is a string specifying the general kind
1386 of section such as \"chapter\" or \"section\". When looking for the
1387 `Next' pointer, the section found will be at the same hierarchical
1388 level in the Texinfo file; when looking for the `Previous' pointer,
1389 the section found will be at the same or higher hierarchical level in
1390 the Texinfo file; when looking for the `Up' pointer, the section found
1391 will be at some level higher in the Texinfo file. The fourth argument
1392 \(one of 'next, 'previous, or 'up\) specifies whether to find the
1398 ;; ignore section commands in the middle of nodes.
1461 "Return the node name preceding the section command.
1462 The argument is the kind of section, either `normal' or `no-pointer'."
1467 "^@node" ; at the beginning of @node line
1472 ;; Don't need to put a blank in the pointer slot,
1474 (setq name " "))) ; put a blank in the pointer slot
1478 "Insert the `Next', `Previous' or `Up' node name at point.
1481 The first and second arguments bound the search for a pointer to the
1482 beginning and end, respectively, of the enclosing higher level
1483 section. The third argument is the hierarchical level of the Texinfo
1485 towards which the pointer is directed, one of `next', `previous', or `up'."
1504 ;; pointers that point to the following or preceding nodes even if they
1506 ;; section contains one or more subsections, the section's `Next'
1507 ;; pointer will point to the subsection and not the following section.
1508 ;; (The subsection to which `Next' points will most likely be the first
1509 ;; item on the section's menu.)
1515 This function causes the `Next' or `Previous' pointer to point to the
1517 lower hierarchical level in the document. Continually pressing `n' or
1518 `p' takes you straight through the file.
1520 Without any prefix argument, update the node in which point is located.
1521 Non-nil argument (prefix, if interactive) means update the nodes in the
1526 to be read like a novel rather than a reference, and for which the
1535 (texinfo-sequentially-update-the-node)
1537 "Done...sequentially updated the node . You may save the buffer."))
1551 (texinfo-sequentially-update-the-node))
1553 "Done...updated the nodes in sequence. You may save the buffer.")))))
1555 (defun texinfo-sequentially-update-the-node ()
1556 "Update one node such that the pointers are sequential.
1579 Move point to section associated with the pointer. Find point even if
1584 The first argument is a string specifying the general kind of section
1585 such as \"chapter\" or \"section\". The section found will be at the
1586 same hierarchical level in the Texinfo file, or, in the case of the up
1588 `previous', or `up') specifies whether to find the `Next', `Previous',
1617 "Insert the `Next', `Previous' or `Up' node name at point.
1620 The first argument is the hierarchical level of the Texinfo file, a
1635 ;; before the `@chapter', `@section', and such like lines of a region
1640 Non-nil argument (prefix, if interactive) means also to insert the
1641 section titles as node names; and also to insert the section titles as
1704 "Done inserting node lines and titles. You may save the buffer.")
1705 (message "Done inserting node lines. You may save the buffer."))))
1713 ;; Read the include file list of an outer Texinfo file and
1714 ;; update all highest level nodes in the files listed and insert a
1715 ;; main menu in the outer file after its top node.
1721 ;; so if the menus are wrong, the master menu will be wrong.
1722 ;; Similarly, if the lower level node pointers are wrong, they
1727 ;; Read the include file list of an outer Texinfo file and
1728 ;; update all nodes and menus in the files listed and insert a
1729 ;; master menu in the outer file after its top node.
1742 "Return a list of the included files in OUTER-FILE."
1760 "Return the name of the immediately following section as a string.
1762 Start with point at the beginning of the node line. Leave point at the
1787 Return a list of the node names.
1789 The first file in the list is an outer file; the remaining are
1790 files included in the outer file with `@include' commands.
1793 pointer in each of the included files.
1795 Also update the `Top' level node pointers of the outer file.
1799 * the first file in the FILES list must be the outer file,
1800 * each of the included files must contain exactly one highest
1802 * this node must be the first node in the included file,
1803 * each highest hierarchical level node must be of the same type.
1807 ;; The menu-list has the form:
1814 ;; You would use the title field if you wanted to insert titles in the
1820 ;; Find the name of the first node of the first included file.
1857 ;; find the name of the first node in the next file.
1897 Indents the first line of the description, if any, to the value of
1905 ;; Insert the node name (and menu entry name, if present).
1908 ;; "Double colon" entry line; menu entry and node name are the same,
1913 ;; Insert the description, if present.
1929 The first file in FILES-LIST must be the outer file; the others must
1930 be the files included within it. A main menu must already exist."
1949 create or update the `Top' level node pointers and the main menu in
1950 the outer file that refers to such nodes. This does not create or
1951 update menus or pointers within the included files.
1955 pointers in the first @node line in each included file and creating or
1956 updating the `Top' level node pointers of the outer file. This does
1957 not create or update other menus and pointers within the included
1961 interactive), update all the menus and all the `Next', `Previous', and
1962 `Up' pointers of all the files included in OUTER-FILE before inserting
1963 a master menu in OUTER-FILE. Also, update the `Top' level node
1968 * this command does NOT save any files--you must save the
1971 * except for the `Top' node, this command does NOT handle any
1972 pre-existing nodes in the outer file; hence, indices must be
1977 * each of the included files must contain exactly one highest
1979 * this highest node must be the first node in the included file,
1980 * each highest hierarchical level node must be of the same type.
2004 ;;; Update the pointers
2005 ;;; and collect the names of the nodes and titles
2019 ;; If found, leave point after word `menu' on the `@menu' line.