;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files
-;; Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
;; Author: Robert J. Chassell
;; Maintainer: bug-texinfo@gnu.org
"\\(^@node\\).*\n" ; match node line
"\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
"\\|" ; or
- "\\(^@ifinfo[ ]*\n\\)\\)?" ; ifinfo line, if any
+ "\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
+ "\\|" ; or
+ "\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
+ "\\)?" ; end of expression
(eval (cdr (assoc level texinfo-update-menu-lower-regexps))))
;; the next higher level node marks the end of this
;; section, and no lower level node will be found beyond
"\\(^@node\\).*\n" ; match node line
"\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
"\\|" ; or
- "\\(^@ifinfo[ ]*\n\\)\\)?" ; ifinfo line, if any
+ "\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
+ "\\|" ; or
+ "\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
+ "\\)?" ; end of expression
(eval (cdr (assoc level texinfo-update-menu-higher-regexps))))
region-end t)
(progn (beginning-of-line) t))))))
"\\(^@node\\).*\n" ; match node line
"\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
"\\|" ; or
- "\\(^@ifinfo[ ]*\n\\)\\)?" ; ifinfo line, if any
+ "\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
+ "\\|" ; or
+ "\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
+ "\\)?" ; end of expression
(eval
(cdr (assoc level texinfo-update-menu-same-level-regexps))))
search-end
(save-excursion
(if (re-search-forward "^@end menu" nil t)
(point)
- (error "Menu does not have an end"))))
+ (error "Menu does not have an end."))))
(defun texinfo-delete-old-menu (beginning first)
"Delete the old menu. Point must be in or after menu.
;; "Double colon" entry line; menu entry and node name are the same,
((search-forward "::" (save-excursion (end-of-line) (point)) t)
(if (looking-at "[ \t]*[^ \t\n]+")
- (error "Descriptive text already exists"))
+ (error "Descriptive text already exists."))
(skip-chars-backward ": \t")
(setq node-name (buffer-substring beginning (point))))
(save-excursion (forward-line 1) (point)) t)
(progn
(if (looking-at "[ \t]*[^ \t\n]+")
- (error "Descriptive text already exists"))
+ (error "Descriptive text already exists."))
(skip-chars-backward "., \t")
(setq node-name (buffer-substring beginning (point))))
;; Menu entry line ends in a return.
(skip-chars-backward " \t\n")
(setq node-name (buffer-substring beginning (point)))
(if (= 0 (length node-name))
- (error "No node name on this line")
+ (error "No node name on this line.")
(insert "."))))
- (t (error "No node name on this line")))
+ (t (error "No node name on this line.")))
;; Search for node that matches node name, and copy the section title.
(if (re-search-forward
(concat
"\\(\\(^@c \\|^@comment\\).*\n\\)" ; match comment line, if any
"\\|" ; or
"\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
+ "\\|" ; or
+ "\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
+ "\\)?" ; end of expression
"\\)?")
nil t)
(progn
(progn (end-of-line)
(skip-chars-backward " \t")
(point)))))
- (error "Cannot find node to match node name in menu entry")))
+ (error "Cannot find node to match node name in menu entry.")))
;; Return point to the menu and insert the title.
(end-of-line)
(delete-region
(goto-char end-of-menu)
;; handle multi-line description
(if (not (re-search-backward "^\\* " nil t))
- (error "No entries in menu"))
+ (error "No entries in menu."))
(point))))
(while (< (point) last-entry)
(if (re-search-forward "^\\* " end-of-menu t)
"\\(^@node\\).*\n" ; match node line
"\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
"\\|" ; or
- "\\(^@ifinfo[ ]*\n\\)\\)?" ; ifinfo line, if any
+ "\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
+ "\\|" ; or
+ "\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
+ "\\)?" ; end of expression
(eval
(cdr (assoc level texinfo-update-menu-higher-regexps))))
nil
"\\(^@node\\).*\n" ; match node line
"\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
"\\|" ; or
- "\\(^@ifinfo[ ]*\n\\)\\)?" ; ifinfo line, if any
+ "\\(^@ifinfo[ ]*\n\\)" ; ifinfo line, if any
+ "\\|" ; or
+ "\\(^@ifnottex[ ]*\n\\)" ; ifnottex line, if any
+ "\\)?" ; end of expression
(eval
;; Never finds end of level above chapter so goes to end.
(cdr (assoc level texinfo-update-menu-higher-regexps))))
;; Search for section commands accompanied by node lines;
;; ignore section commands in the middle of nodes.
(if (re-search-forward
- ;; A `Top' node is never a next pointer, so won't find it.
+ ;; A `Top' node is never a next pointer, so won't find it.
(concat
;; Match node line.
"\\(^@node\\).*\n"
- ;; Match comment or ifinfo line, if any
- "\\(\\(\\(^@c\\).*\n\\)\\|\\(^@ifinfo[ ]*\n\\)\\)?"
+ ;; Match comment, ifinfo, ifnottex line, if any
+ (concat
+ "\\(\\("
+ "\\(^@c\\).*\n\\)"
+ "\\|"
+ "\\(^@ifinfo[ ]*\n\\)"
+ "\\|"
+ "\\(^@ifnottex[ ]*\n\\)"
+ "\\)?")
(eval
(cdr (assoc level texinfo-update-menu-same-level-regexps))))
end
"\\("
;; Match node line.
"\\(^@node\\).*\n"
- ;; Match comment or ifinfo line, if any
- "\\(\\(\\(^@c\\).*\n\\)\\|\\(^@ifinfo[ ]*\n\\)\\)?"
+ ;; Match comment, ifinfo, ifnottex line, if any
+ (concat
+ "\\(\\("
+ "\\(^@c\\).*\n\\)"
+ "\\|"
+ "\\(^@ifinfo[ ]*\n\\)"
+ "\\|"
+ "\\(^@ifnottex[ ]*\n\\)"
+ "\\)?")
(eval
(cdr (assoc level texinfo-update-menu-same-level-regexps)))
"\\|"
;; Match node line.
"\\(^@node\\).*\n"
- ;; Match comment or ifinfo line, if any
- "\\(\\(\\(^@c\\).*\n\\)\\|\\(^@ifinfo[ ]*\n\\)\\)?"
+ ;; Match comment, ifinfo, ifnottex line, if any
+ (concat
+ "\\(\\("
+ "\\(^@c\\).*\n\\)"
+ "\\|"
+ "\\(^@ifinfo[ ]*\n\\)"
+ "\\|"
+ "\\(^@ifnottex[ ]*\n\\)"
+ "\\)?")
(eval
(cdr (assoc level texinfo-update-menu-higher-regexps)))
"\\|"
"\\("
;; Match node line.
"\\(^@node\\).*\n"
- ;; Match comment or ifinfo line, if any
- "\\(\\(\\(^@c\\).*\n\\)\\|\\(^@ifinfo[ ]*\n\\)\\)?"
+ ;; Match comment, ifinfo, ifnottex line, if any
+ (concat
+ "\\(\\("
+ "\\(^@c\\).*\n\\)"
+ "\\|"
+ "\\(^@ifinfo[ ]*\n\\)"
+ "\\|"
+ "\\(^@ifnottex[ ]*\n\\)"
+ "\\)?")
(eval (cdr (assoc level texinfo-update-menu-higher-regexps)))
"\\|"
;; Handle `Top' node specially.
;; 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"))
+ (error "Node line not found before this position."))
(texinfo-sequentially-update-the-node)
(message
"Done...sequentially updated the node . You may save the buffer."))