summaryrefslogtreecommitdiff
path: root/lisp/textmodes/texnfo-upd.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/textmodes/texnfo-upd.el')
-rw-r--r--lisp/textmodes/texnfo-upd.el35
1 files changed, 18 insertions, 17 deletions
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el
index 134f82b14e0..e2a0ed9af6f 100644
--- a/lisp/textmodes/texnfo-upd.el
+++ b/lisp/textmodes/texnfo-upd.el
@@ -410,23 +410,24 @@ and to the end of the menu region for the level.
Return t if the node is found, else nil. Leave point at the beginning
of the node if one is found; else do not move point."
(let ((case-fold-search t))
- (if (and (< (point) region-end)
- (re-search-forward
- (concat
- "\\(^@node\\).*\n" ; match node line
- "\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
- "\\|" ; or
- "\\(^@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
- ;; this position even if region-end is farther off
- (texinfo-update-menu-region-end level)
- t))
- (goto-char (match-beginning 1)))))
+ (when (and (< (point) region-end)
+ (re-search-forward
+ (concat
+ "\\(^@node\\).*\n" ; match node line
+ "\\(\\(\\(^@c\\).*\n\\)" ; match comment line, if any
+ "\\|" ; or
+ "\\(^@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
+ ;; this position even if region-end is farther off
+ (texinfo-update-menu-region-end level)
+ t))
+ (goto-char (match-beginning 1))
+ t)))
(defun texinfo-find-higher-level-node (level region-end)
"Search forward from point for node at any higher level than argument LEVEL.