(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.
(if (search-forward "* " (save-excursion (end-of-line) (point)) t)
(progn (skip-chars-forward " \t")
(setq beginning (point)))
- (error "This is not a line in a menu!"))
+ (error "This is not a line in a menu"))
(cond
;; "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
(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
;; Move point to location after `top'.
(if (not (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t))
- (error "This buffer needs a Top node!"))
+ (error "This buffer needs a Top node"))
(let ((first-chapter
(save-excursion
(or (re-search-forward "^@node" nil t)
- (error "Too few nodes for a master menu!"))
+ (error "Too few nodes for a master menu"))
(point))))
(if (search-forward texinfo-master-menu-header first-chapter t)
(progn
;; Insert a master menu only after `Top' node and before next node
;; \(or include file if there is no next node\).
(if (not (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t))
- (error "This buffer needs a Top node!"))
+ (error "This buffer needs a Top node"))
(let ((first-chapter
(save-excursion (re-search-forward "^@node\\|^@include") (point))))
(if (not (re-search-forward "^@menu" first-chapter t))
(error
- "Buffer lacks ordinary `Top' menu in which to insert master.")))
+ "Buffer lacks ordinary `Top' menu in which to insert master")))
(beginning-of-line)
(delete-region ; buffer must have ordinary top menu
(point)
(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)
(point))))
(t
(error
- "texinfo-specific-section-type: Chapter or section not found."))))))
+ "texinfo-specific-section-type: Chapter or section not found"))))))
(defun texinfo-hierarchic-level ()
"Return the general hierarchal level of the next node in a texinfo file.
;; 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."))
(beginning (region-beginning))
(end (region-end)))
(if (= end beginning)
- (error "Please mark a region!"))
+ (error "Please mark a region"))
(save-restriction
(narrow-to-region beginning end)
(goto-char beginning)
(widen)
(goto-char (point-min))
(if (not (re-search-forward "^@node" nil t))
- (error "No `@node' line found in %s !" (buffer-name)))
+ (error "No `@node' line found in %s" (buffer-name)))
(beginning-of-line)
(texinfo-check-for-node-name)
(setq next-node-name (texinfo-copy-node-name))
(switch-to-buffer (find-file-noselect (car files)))
(goto-char (point-min))
(if (not (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t))
- (error "This buffer needs a Top node!"))
+ (error "This buffer needs a Top node"))
(beginning-of-line)
(texinfo-delete-existing-pointers)
(end-of-line)
(widen)
(goto-char (point-min))
(if (not (re-search-forward "^@node" nil t))
- (error "No `@node' line found in %s !" (buffer-name)))
+ (error "No `@node' line found in %s" (buffer-name)))
(beginning-of-line)
(texinfo-check-for-node-name)
(setq next-node-name (texinfo-copy-node-name))
(switch-to-buffer (find-file-noselect (car files)))
(goto-char (point-min))
(if (not (re-search-forward "^@node" nil t))
- (error "No `@node' line found in %s !" (buffer-name)))
+ (error "No `@node' line found in %s" (buffer-name)))
(beginning-of-line)
;; Update other menus and nodes if requested.