Function: semantic-up-context-texinfo-mode

semantic-up-context-texinfo-mode is a byte-compiled function defined in texi.el.gz.

Signature

(semantic-up-context-texinfo-mode)

Documentation

Handle texinfo constructs which do not use parenthetical nesting.

Override semantic-up-context in texinfo-mode buffers.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/texi.el.gz
(define-mode-local-override semantic-up-context texinfo-mode ()
  "Handle texinfo constructs which do not use parenthetical nesting."
  (let ((done nil))
    (save-excursion
      (let ((parenthetical (semantic-up-context-default))
	    )
	(when (not parenthetical)
	  ;; We are in parentheses.  Are they the types of parens
	  ;; belonging to a texinfo construct?
	  (forward-word-strictly -1)
	  (when (looking-at "@\\w+{")
	    (setq done (point))))))
    ;; If we are not in a parenthetical node, then find a block instead.
    ;; Use the texinfo support to find block start/end constructs.
    (save-excursion
      (while (and (not done)
		  (re-search-backward  semantic-texi-environment-regexp nil t))
	;; For any hit, if we find an @end foo, then jump to the
	;; matching @foo.  If it is not an end, then we win!
	(if (not (looking-at "@end\\s-+\\(\\w+\\)"))
	    (setq done (point))
	  ;; Skip over this block
	  (let ((env (match-string 1)))
	    (re-search-backward (concat "@" env))))
	))
    ;; All over, post what we find.
    (if done
	;; We found something, so use it.
	(progn (goto-char done)
	       nil)
      t)))