Function: srecode-load-tables-for-mode

srecode-load-tables-for-mode is a byte-compiled function defined in find.el.gz.

Signature

(srecode-load-tables-for-mode MMODE &optional APPNAME)

Documentation

Load all the template files for MMODE.

Templates are found in the SRecode Template Map. See srecode-get-maps for more. APPNAME is the name of an application. In this case, all template files for that application will be loaded.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/find.el.gz
;;; TRACKER
;;
;; Template file tracker for between sessions.
;;
(defun srecode-load-tables-for-mode (mmode &optional appname)
  "Load all the template files for MMODE.
Templates are found in the SRecode Template Map.
See `srecode-get-maps' for more.
APPNAME is the name of an application.  In this case,
all template files for that application will be loaded."
  (dolist (mmode (cons 'default (reverse (derived-mode-all-parents mmode))))
    (let ((files
	   (apply #'append
		  (mapcar
		   (if appname
		       (lambda (map)
                         (srecode-map-entries-for-app-and-mode map appname mmode))
		     (lambda (map)
		       (srecode-map-entries-for-mode map mmode)))
		   (srecode-get-maps)))))

      ;; Load in templates for our major mode.
      (when files
	(let ((mt (srecode-get-mode-table mmode)))
	  (dolist (f files)
	    (when (not (and mt (srecode-mode-table-find mt (car f))))
	      (srecode-compile-file (car f)))))))))