Function: semantic-texi-recursive-combobulate-list
semantic-texi-recursive-combobulate-list is a byte-compiled function
defined in texi.el.gz.
Signature
(semantic-texi-recursive-combobulate-list SECTIONLIST LEVEL)
Documentation
Rearrange SECTIONLIST to be a hierarchical tag list starting at LEVEL.
Return the rearranged new list, with all remaining tags from SECTIONLIST starting at ELT 2. Sections not are not dealt with as soon as a tag with greater section value than LEVEL is found.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/texi.el.gz
(defun semantic-texi-recursive-combobulate-list (sectionlist level)
"Rearrange SECTIONLIST to be a hierarchical tag list starting at LEVEL.
Return the rearranged new list, with all remaining tags from
SECTIONLIST starting at ELT 2. Sections not are not dealt with as soon as a
tag with greater section value than LEVEL is found."
(let ((newl nil)
(oldl sectionlist)
tag
)
(save-excursion
(catch 'level-jump
(while oldl
(goto-char (car oldl))
(if (looking-at "@\\(\\w+\\)")
(let* ((word (match-string 1))
(levelmatch (assoc word texinfo-section-list))
text begin tmp
)
;; Set begin to the right location
(setq begin (point))
;; Get out of here if there if we made it that far.
(if (and levelmatch (<= (car (cdr levelmatch)) level))
(progn
(when newl
(semantic-texi-set-endpoint newl begin))
(throw 'level-jump t)))
;; Recombobulate
(if levelmatch
(let ((end (match-end 1)))
;; Levels sometimes have a @node just in front.
;; That node statement should be included in the space
;; for this entry.
(save-excursion
(skip-chars-backward "\n \t")
(beginning-of-line)
(when (looking-at "@node\\>")
(setq begin (point))))
;; When there is a match, the descriptive text
;; consists of the rest of the line.
(goto-char end)
(skip-chars-forward " \t")
(setq text (buffer-substring-no-properties
(point)
(progn (end-of-line) (point))))
;; Next, recurse into the body to find the end.
(setq tmp (semantic-texi-recursive-combobulate-list
(cdr oldl) (car (cdr levelmatch))))
;; Build a tag
(setq tag (semantic-texi-new-section-tag
text (car tmp) begin (point)))
;; Before appending the newtag, update the previous tag
;; if it is a section tag.
(when newl
(semantic-texi-set-endpoint newl begin))
;; Append new tag to our master list.
(setq newl (cons tag newl))
;; continue
(setq oldl (cdr tmp))
)
;; No match means we have a def*, so get the name from
;; it based on the type of thingy we found.
(setq levelmatch (assoc word semantic-texi-name-field-list)
tmp (or (cdr levelmatch) 1))
(forward-sexp tmp)
(skip-chars-forward " \t")
(setq text (buffer-substring-no-properties
(point)
(progn (forward-sexp 1) (point))))
;; Seek the end of this definition
(goto-char begin)
(semantic-texi-forward-deffn)
(setq tag (semantic-texi-new-def-tag text begin (point))
newl (cons tag newl))
;; continue
(setq oldl (cdr oldl)))
)
(error "Problem finding section in semantic/texi parser"))
;; (setq oldl (cdr oldl))
)
;; When oldl runs out, force a new endpoint as point-max
(when (not oldl)
(semantic-texi-set-endpoint newl (point-max)))
))
(cons (nreverse newl) oldl)))