diff lisp/packages/texnfo-upd.el @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children b82b59fe008d
line wrap: on
line diff
--- a/lisp/packages/texnfo-upd.el	Mon Aug 13 08:45:53 2007 +0200
+++ b/lisp/packages/texnfo-upd.el	Mon Aug 13 08:46:35 2007 +0200
@@ -1,150 +1,152 @@
-;;; Texinfo mode utilities for updating nodes and menus in Texinfo files.
-;;; Copyright 1989, 1990, 1991, 1992 Free Software Foundation
+;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files
+
+;; Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
 
 ;; Author: Robert J. Chassell      
 ;; Maintainer: bug-texinfo@prep.ai.mit.edu
 ;; Keywords: maint, tex, docs
 
-;; This file is part of GNU Emacs.
+;; This file is part of XEmacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; XEmacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation; either version 2, or (at your option)
 ;; any later version.
 
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
 
-;;; Synched up with: FSF 19.29.
+;;; Synched up with: FSF 19.34.
 
 ;;; Commentary:
 
-;;; Known bug: update commands fail to ignore @ignore.
+;; Known bug: update commands fail to ignore @ignore.
 
-;;; Summary: how to use the updating commands
+;; Summary: how to use the updating commands
 
-; The node and menu updating functions automatically
+;; The node and menu updating functions automatically
 
-;   * insert missing `@node' lines,
-;   * insert the `Next', `Previous' and `Up' pointers of a node,
-;   * insert or update the menu for a section, 
-;   * create a master menu for a Texinfo source file.
-;
-; Passed an argument, the `texinfo-update-node' and
-; `texinfo-make-menu' functions do their jobs in the region.
-;
-; In brief, the functions for creating or updating nodes and menus, are:
-; 
-;     texinfo-update-node (&optional region-p)            
-;     texinfo-every-node-update ()                        
-;     texinfo-sequential-node-update (&optional region-p)
-; 
-;     texinfo-make-menu (&optional region-p)              
-;     texinfo-all-menus-update ()                         
-;     texinfo-master-menu ()
-;
-;     texinfo-insert-node-lines  (&optional title-p)
-; 
-;     texinfo-indent-menu-description (column &optional region-p)
+;;   * insert missing `@node' lines,
+;;   * insert the `Next', `Previous' and `Up' pointers of a node,
+;;   * insert or update the menu for a section, 
+;;   * create a master menu for a Texinfo source file.
+;;
+;; Passed an argument, the `texinfo-update-node' and
+;; `texinfo-make-menu' functions do their jobs in the region.
+;;
+;; In brief, the functions for creating or updating nodes and menus, are:
+;; 
+;;     texinfo-update-node (&optional region-p)            
+;;     texinfo-every-node-update ()                        
+;;     texinfo-sequential-node-update (&optional region-p)
+;; 
+;;     texinfo-make-menu (&optional region-p)              
+;;     texinfo-all-menus-update ()                         
+;;     texinfo-master-menu ()
+;;
+;;     texinfo-insert-node-lines  (&optional title-p)
+;; 
+;;     texinfo-indent-menu-description (column &optional region-p)
 
-; The `texinfo-column-for-description' variable specifies the column to
-; which menu descriptions are indented. 
+;; The `texinfo-column-for-description' variable specifies the column to
+;; which menu descriptions are indented. 
 
-; Texinfo file structure
-; ----------------------
+;; Texinfo file structure
+;; ----------------------
 
-; To use the updating commands, you must structure your Texinfo file
-; hierarchically.  Each `@node' line, with the exception of the top
-; node, must be accompanied by some kind of section line, such as an
-; `@chapter' or `@section' line.  Each node-line/section-line
-; combination must look like this:
+;; To use the updating commands, you must structure your Texinfo file
+;; hierarchically.  Each `@node' line, with the exception of the top
+;; node, must be accompanied by some kind of section line, such as an
+;; `@chapter' or `@section' line.  Each node-line/section-line
+;; combination must look like this:
 
-;      @node    Lists and Tables, Cross References, Structuring, Top
-;      @comment node-name,        next,             previous,    up
-;      @chapter Making Lists and Tables
+;;      @node    Lists and Tables, Cross References, Structuring, Top
+;;      @comment node-name,        next,             previous,    up
+;;      @chapter Making Lists and Tables
 
-; or like this (without the `@comment' line):
+;; or like this (without the `@comment' line):
 
-;      @node    Lists and Tables, Cross References, Structuring, Top
-;      @chapter Making Lists and Tables
+;;      @node    Lists and Tables, Cross References, Structuring, Top
+;;      @chapter Making Lists and Tables
 
-; If the file has a `top' node, it must be called `top' or `Top' and
-; be the first node in the file.
+;; If the file has a `top' node, it must be called `top' or `Top' and
+;; be the first node in the file.
 
 
 ;;; The update node functions described in detail
 
-; The `texinfo-update-node' function without an argument inserts
-; the correct next, previous and up pointers for the node in which
-; point is located (i.e., for the node preceding point).
+;; The `texinfo-update-node' function without an argument inserts
+;; the correct next, previous and up pointers for the node in which
+;; point is located (i.e., for the node preceding point).
 
-; With an argument, the `texinfo-update-node' function inserts the
-; correct next, previous and up pointers for the nodes inside the
-; region.
+;; With an argument, the `texinfo-update-node' function inserts the
+;; correct next, previous and up pointers for the nodes inside the
+;; region.
 
-; It does not matter whether the  `@node' line has pre-existing
-; `Next', `Previous', or `Up' pointers in it.  They are removed.
+;; It does not matter whether the  `@node' line has pre-existing
+;; `Next', `Previous', or `Up' pointers in it.  They are removed.
 
-; The `texinfo-every-node-update' function runs `texinfo-update-node'
-; on the whole buffer.
+;; The `texinfo-every-node-update' function runs `texinfo-update-node'
+;; on the whole buffer.
 
-; The `texinfo-sequential-node-update' function inserts the
-; immediately following and preceding node into the `Next' or
-; `Previous' pointers regardless of their hierarchical level.  This is
-; only useful for certain kinds of text, like a novel, which you go
-; through sequentially.
+;; The `texinfo-sequential-node-update' function inserts the
+;; immediately following and preceding node into the `Next' or
+;; `Previous' pointers regardless of their hierarchical level.  This is
+;; only useful for certain kinds of text, like a novel, which you go
+;; through sequentially.
 
 
 ;;; The menu making functions described in detail
 
-; The `texinfo-make-menu' function without an argument creates or
-; updates a menu for the section encompassing the node that follows
-; point.  With an argument, it makes or updates menus for the nodes
-; within or part of the marked region.
+;; The `texinfo-make-menu' function without an argument creates or
+;; updates a menu for the section encompassing the node that follows
+;; point.  With an argument, it makes or updates menus for the nodes
+;; within or part of the marked region.
 
-; Whenever an existing menu is updated, the descriptions from
-; that menu are incorporated into the new menu.  This is done by copying
-; descriptions from the existing menu to the entries in the new menu
-; that have the same node names.  If the node names are different, the
-; descriptions are not copied to the new menu.
+;; Whenever an existing menu is updated, the descriptions from
+;; that menu are incorporated into the new menu.  This is done by copying
+;; descriptions from the existing menu to the entries in the new menu
+;; that have the same node names.  If the node names are different, the
+;; descriptions are not copied to the new menu.
 
-; Menu entries that refer to other Info files are removed since they
-; are not a node within current buffer.  This is a deficiency.
+;; Menu entries that refer to other Info files are removed since they
+;; are not a node within current buffer.  This is a deficiency.
 
-; The `texinfo-all-menus-update' function runs `texinfo-make-menu'
-; on the whole buffer.
+;; The `texinfo-all-menus-update' function runs `texinfo-make-menu'
+;; on the whole buffer.
 
-; The `texinfo-master-menu' function creates an extended menu located
-; after the top node.  (The file must have a top node.)  The function
-; first updates all the regular menus in the buffer (incorporating the
-; descriptions from pre-existing menus), and then constructs a master
-; menu that includes every entry from every other menu.  (However, the
-; function cannot update an already existing master menu; if one
-; exists, it must be removed before calling the function.)
+;; The `texinfo-master-menu' function creates an extended menu located
+;; after the top node.  (The file must have a top node.)  The function
+;; first updates all the regular menus in the buffer (incorporating the
+;; descriptions from pre-existing menus), and then constructs a master
+;; menu that includes every entry from every other menu.  (However, the
+;; function cannot update an already existing master menu; if one
+;; exists, it must be removed before calling the function.)
 
-; The `texinfo-indent-menu-description' function indents every
-; description in the menu following point, to the specified column.
-; Non-nil argument (prefix, if interactive) means indent every
-; description in every menu in the region.  This function does not
-; indent second and subsequent lines of a multi-line description.
+;; The `texinfo-indent-menu-description' function indents every
+;; description in the menu following point, to the specified column.
+;; Non-nil argument (prefix, if interactive) means indent every
+;; description in every menu in the region.  This function does not
+;; indent second and subsequent lines of a multi-line description.
 
-; The `texinfo-insert-node-lines' function inserts `@node' before the
-; `@chapter', `@section', and such like lines of a region in a Texinfo
-; file where the `@node' lines are missing.
-; 
-; With a non-nil argument (prefix, if interactive), the function not
-; only inserts `@node' lines but also inserts the chapter or section
-; titles as the names of the corresponding nodes; and inserts titles
-; as node names in pre-existing `@node' lines that lack names.
-; 
-; Since node names should be more concise than section or chapter
-; titles, node names so inserted will need to be edited manually.
+;; The `texinfo-insert-node-lines' function inserts `@node' before the
+;; `@chapter', `@section', and such like lines of a region in a Texinfo
+;; file where the `@node' lines are missing.
+;; 
+;; With a non-nil argument (prefix, if interactive), the function not
+;; only inserts `@node' lines but also inserts the chapter or section
+;; titles as the names of the corresponding nodes; and inserts titles
+;; as node names in pre-existing `@node' lines that lack names.
+;; 
+;; Since node names should be more concise than section or chapter
+;; titles, node names so inserted will need to be edited manually.
 
  
 ;;; Code:
@@ -750,7 +752,7 @@
 menus) before it constructs the master menu.
 
 The function removes the detailed part of an already existing master
-menu.  This action depends on the pre-exisitng master menu using the
+menu.  This action depends on the pre-existing master menu using the
 standard `texinfo-master-menu-header'.
 
 The master menu has the following format, which is adapted from the
@@ -964,11 +966,11 @@
                                           ; last `* ' entry
                       (goto-char end-of-menu)
                       ;; handle multi-line description
-                      (if (not (re-search-backward "^\* " nil t))
+                      (if (not (re-search-backward "^\\* " nil t))
                           (error "No entries in menu."))
                       (point))))
     (while (< (point) last-entry)
-      (if (re-search-forward  "^\* " end-of-menu t)
+      (if (re-search-forward  "^\\* " end-of-menu t)
           (progn
             (setq this-menu-list
                   (cons
@@ -976,7 +978,7 @@
                     (point)
                     ;; copy multi-line descriptions
                     (save-excursion
-                      (re-search-forward "\\(^\* \\|^@e\\)" nil t)
+                      (re-search-forward "\\(^\\* \\|^@e\\)" nil t)
                       (- (point) 3)))
                    this-menu-list)))))
     this-menu-list))
@@ -1003,10 +1005,11 @@
                            t)
         "top")
        ((re-search-forward texinfo-section-types-regexp nil t)
-        (buffer-substring (progn (beginning-of-line) ; copy its name
-                                 (1+ (point)))
-                          (progn (forward-word 1)
-                                 (point))))
+	(buffer-substring-no-properties
+	 (progn (beginning-of-line) ; copy its name
+		(1+ (point)))
+	 (progn (forward-word 1)
+		(point))))
        (t
         (error
          "texinfo-specific-section-type: Chapter or section not found."))))))
@@ -1361,7 +1364,7 @@
 The first and second arguments bound the search for a pointer to the
 beginning and end, respectively, of the enclosing higher level
 section.  The third argument is a string specifying the general kind
-of section such as \"chapter\ or \"section\".  When looking for the
+of section such as \"chapter\" or \"section\".  When looking for the
 `Next' pointer, the section found will be at the same hierarchical
 level in the Texinfo file; when looking for the `Previous' pointer,
 the section found will be at the same or higher hierarchical level in
@@ -1558,7 +1561,7 @@
 Return type of pointer (either 'normal or 'no-pointer).
 
 The first argument is a string specifying the general kind of section
-such as \"chapter\ or \"section\".  The section found will be at the
+such as \"chapter\" or \"section\".  The section found will be at the
 same hierarchical level in the Texinfo file, or, in the case of the up
 pointer, some level higher.  The second argument (one of 'next,
 'previous, or 'up) specifies whether to find the `Next', `Previous',