]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/texnfo-upd.el
(tmm-menubar-mouse): Add autoload cookie.
[gnu-emacs] / lisp / textmodes / texnfo-upd.el
index 67bd142a4280dd1cf3f45880ca19384e7762be7c..cfd64adce4b1d7355584331b558e7991945923c4 100644 (file)
@@ -1,5 +1,6 @@
-;;; 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
@@ -248,13 +249,19 @@ nodes in the buffer before updating the menus."
             (sleep-for 2)
             (push-mark (point-max) t)
             (goto-char (point-min))
-            (texinfo-update-node t)))
+           ;; Using the mark to pass bounds this way
+           ;; is kludgy, but it's not worth fixing. -- rms.
+           (let ((mark-active t))
+             (texinfo-update-node t))))
       
       (message "Updating all menus in %s ... " (buffer-name))        
       (sleep-for 2)
       (push-mark (point-max) t)
       (goto-char (point-min))
-      (texinfo-make-menu t)
+      ;; Using the mark to pass bounds this way
+      ;; is kludgy, but it's not worth fixing. -- rms.
+      (let ((mark-active t))
+       (texinfo-make-menu t))
       
       (if master-menu-p
           (progn
@@ -742,7 +749,7 @@ menus in the buffer (incorporating descriptions from pre-existing
 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
@@ -995,10 +1002,11 @@ error if the node is not the top node and a section is not found."
                            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."))))))
@@ -1217,6 +1225,7 @@ document; the values are regular expressions.")
 \f
 ;;; Updating a node
 
+;;;###autoload
 (defun texinfo-update-node (&optional region-p)
   "Without any prefix argument, update the node in which point is located.
 Non-nil argument (prefix, if interactive) means update the nodes in the
@@ -1240,13 +1249,15 @@ which menu descriptions are indented. Its default value is 32."
   
   (interactive "P")
   (if (not region-p)
-      (let ((auto-fill-function nil)) ; update a single node
+      ;; update a single node
+      (let ((auto-fill-function nil) (auto-fill-hook nil))
         (if (not (re-search-backward "^@node" (point-min) t))
             (error "Node line not found before this position."))
         (texinfo-update-the-node)
         (message "Done...updated the node.  You may save the buffer."))
     ;; else
     (let ((auto-fill-function nil)
+         (auto-fill-hook nil)
           (beginning (region-beginning))
          (end (region-end)))
       (if (= end beginning)
@@ -1260,13 +1271,17 @@ which menu descriptions are indented. Its default value is 32."
           (texinfo-update-the-node))
         (message "Done...updated nodes in region.  You may save the buffer.")))))
 
+;;;###autoload
 (defun texinfo-every-node-update ()
   "Update every node in a Texinfo file."
   (interactive)
   (save-excursion
     (push-mark (point-max) t)
     (goto-char (point-min))
-    (texinfo-update-node t)
+    ;; Using the mark to pass bounds this way
+    ;; is kludgy, but it's not worth fixing. -- rms.
+    (let ((mark-active t))
+      (texinfo-update-node t))
     (message "Done...updated every node.       You may save the buffer.")))
 
 (defun texinfo-update-the-node ()
@@ -1334,10 +1349,9 @@ Point must be at beginning of node line.  Does not move point."
 Starts from the current position of the cursor, and searches forward
 on the line for a comma and if one is found, deletes the rest of the
 line, including the comma.  Leaves point at beginning of line."
-  (if (search-forward "," (save-excursion (end-of-line) (point)) t)
-      (progn
-        (goto-char (1- (point)))
-        (kill-line nil)))
+  (let ((eol-point (save-excursion (end-of-line) (point))))
+    (if (search-forward "," eol-point t)
+        (delete-region (1- (point)) eol-point)))
   (beginning-of-line))
 
 (defun texinfo-find-pointer (beginning end level direction)
@@ -1470,6 +1484,7 @@ towards which the pointer is directed, one of `next, `previous, or
 ; (The subsection to which `Next' points will most likely be the first
 ; item on the section's menu.)
 
+;;;###autoload
 (defun texinfo-sequential-node-update (&optional region-p)
   "Update one node (or many) in a Texinfo file with sequential pointers.
 
@@ -1489,7 +1504,8 @@ Info `g*' command is inadequate."
   
   (interactive "P")
   (if (not region-p)
-      (let ((auto-fill-function nil))   ; update a single node
+      ;; update a single node
+      (let ((auto-fill-function nil) (auto-fill-hook nil))
         (if (not (re-search-backward "^@node" (point-min) t))
             (error "Node line not found before this position."))
         (texinfo-sequentially-update-the-node)
@@ -1497,6 +1513,7 @@ Info `g*' command is inadequate."
          "Done...sequentially updated the node .  You may save the buffer."))
     ;; else
     (let ((auto-fill-function nil)
+         (auto-fill-hook nil)
           (beginning (region-beginning))
           (end (region-end)))
       (if (= end beginning)