Function: texinfo-find-higher-level-node

texinfo-find-higher-level-node is a byte-compiled function defined in texnfo-upd.el.gz.

Signature

(texinfo-find-higher-level-node LEVEL REGION-END)

Documentation

Search forward from point for node at any higher level than argument LEVEL.

Search is limited to the end of the marked region, REGION-END.

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.

A @node line starting at point does count as a match; if the match is found there, the value is t and point does not move.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/texnfo-upd.el.gz
(defun texinfo-find-higher-level-node (level region-end)
  "Search forward from point for node at any higher level than argument LEVEL.
Search is limited to the end of the marked region, REGION-END.

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.

A `@node' line starting at point does count as a match;
if the match is found there, the value is t and point does not move."

  (let ((case-fold-search t))
    (cond
     ((< level 3)
      (if (re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" region-end t)
	  (progn (beginning-of-line) t)))
     (t
      (when (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-higher-regexps)) t))
	     region-end t)
	(beginning-of-line) t)))))