-;;; 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
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
(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.