Function: semantic-get-local-variables-srecode-template-mode
semantic-get-local-variables-srecode-template-mode is a byte-compiled
function defined in srt-mode.el.gz.
Signature
(semantic-get-local-variables-srecode-template-mode &optional POINT)
Documentation
Get local variables from an SRecode template.
Override semantic-get-local-variables in srecode-template-mode
buffers.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/srecode/srt-mode.el.gz
(define-mode-local-override semantic-get-local-variables
srecode-template-mode (&optional point)
"Get local variables from an SRecode template."
(save-excursion
(when point (goto-char (point)))
(let* ((tag (semantic-current-tag))
(name (save-excursion
(srecode-up-context-get-name (point))))
(subdicts (semantic-tag-get-attribute tag :dictionaries))
(global nil)
)
(dolist (D subdicts)
(setq global (cons (semantic-tag-new-variable (car D) nil)
global)))
(if name
;; Lookup any subdictionaries in TAG.
(let ((res nil))
(while (and (not res) subdicts)
;; Find the subdictionary with the same name. Those variables
;; are now local to this section.
(when (string= (car (car subdicts)) name)
(setq res (cdr (car subdicts))))
(setq subdicts (cdr subdicts)))
;; Pre-pend our global vars.
(append global res))
;; If we aren't in a subsection, just do the global variables
global
))))