Function: srecode-template-find-templates-of-context

srecode-template-find-templates-of-context is a byte-compiled function defined in srt-mode.el.gz.

Signature

(srecode-template-find-templates-of-context CONTEXT &optional BUFFER)

Documentation

Find all the templates belonging to a particular CONTEXT.

When optional BUFFER is provided, search that buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/srt-mode.el.gz
(defun srecode-template-find-templates-of-context (context &optional buffer)
  "Find all the templates belonging to a particular CONTEXT.
When optional BUFFER is provided, search that buffer."
  (save-excursion
    (when buffer (set-buffer buffer))
    (let ((tags (semantic-fetch-available-tags))
	  (cc 'declaration)
	  (scan nil)
	  (ans nil))

      (when (eq cc context)
	(setq scan t))

      (dolist (T tags)
	;; Handle contexts
	(when (semantic-tag-of-class-p T 'context)
	  (setq cc (read (semantic-tag-name T)))
	  (when (eq cc context)
	    (setq scan t)))

	;; Scan
	(when (and scan (semantic-tag-of-class-p T 'function))
	  (setq ans (cons T ans)))
	)

      (nreverse ans))))