Function: srecode-dictionary-add-template-table

srecode-dictionary-add-template-table is a byte-compiled function defined in dictionary.el.gz.

Signature

(srecode-dictionary-add-template-table ARG &rest ARGS)

Implementations

(srecode-dictionary-add-template-table (DICT srecode-dictionary) TPL) in `srecode/dictionary.el'.

Insert into DICT the variables found in table TPL. TPL is an object representing a compiled template file.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/dictionary.el.gz
(cl-defmethod srecode-dictionary-add-template-table ((dict srecode-dictionary)
						  tpl)
  "Insert into DICT the variables found in table TPL.
TPL is an object representing a compiled template file."
  (when tpl
    ;; Tables are sorted with highest priority first, useful for looking
    ;; up templates, but this means we need to install the variables in
    ;; reverse order so higher priority variables override lower ones.
    (let ((tabs (reverse (oref tpl tables))))
      (require 'srecode/find) ; For srecode-template-table-in-project-p
      (while tabs
	(when (srecode-template-table-in-project-p (car tabs))
	  (let ((vars (oref (car tabs) variables)))
	    (while vars
	      (srecode-dictionary-set-value
	       dict (car (car vars)) (cdr (car vars)))
	      (setq vars (cdr vars)))))
        (setq tabs (cdr tabs))))))