Function: srecode-all-template-hash
srecode-all-template-hash is a byte-compiled function defined in
find.el.gz.
Signature
(srecode-all-template-hash &optional MODE HASH PREDICATE)
Documentation
Create a hash table of all the currently available templates.
Optional argument MODE is the major mode to look for. Optional argument HASH is the hash table to fill in. Optional argument PREDICATE can be used to filter the returned templates.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/srecode/find.el.gz
(defun srecode-all-template-hash (&optional mode hash predicate)
"Create a hash table of all the currently available templates.
Optional argument MODE is the major mode to look for.
Optional argument HASH is the hash table to fill in.
Optional argument PREDICATE can be used to filter the returned
templates."
(let* ((mhash (or hash (make-hash-table :test 'equal))))
(dolist (mmode (cons 'default
;; Get the parent hash table filled into our
;; current hash.
(reverse (derived-mode-all-parents
(or mode major-mode)))))
;; Load up the hash table for our current mode.
(let* ((mt (srecode-get-mode-table mmode))
(tabs (when mt (oref mt tables))))
(dolist (tab tabs)
;; Exclude templates for a particular application.
(when (and (not (oref tab application))
(srecode-template-table-in-project-p tab))
(maphash (lambda (key temp)
(when (or (not predicate)
(funcall predicate temp))
(puthash key temp mhash)))
(oref tab namehash))))))
mhash))