-;;; 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
(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
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
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."))))))
\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
(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)
(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 ()
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)
; (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.
(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)
"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)