Function: srecode-mode-table-new

srecode-mode-table-new is a byte-compiled function defined in table.el.gz.

Signature

(srecode-mode-table-new MODE FILE &rest INIT)

Documentation

Create a new template table for MODE in FILE.

INIT are the initialization parameters for the new template table.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/table.el.gz
(defun srecode-mode-table-new (mode file &rest init)
  "Create a new template table for MODE in FILE.
INIT are the initialization parameters for the new template table."
  (let* ((mt (srecode-make-mode-table mode))
	 (old (srecode-mode-table-find mt file))
	 (attr (file-attributes file))
	 (new (apply #'srecode-template-table
		     :file file
		     :filesize (file-attribute-size attr)
		     :filedate (file-attribute-modification-time attr)
		     :major-mode mode
		     init
		     )))
    ;; Whack the old table.
    (when old (object-remove-from-list mt 'modetables old))
    ;; Add the new table
    (object-add-to-list mt 'modetables new)
    ;; Sort the list in reverse order.  When other routines
    ;; go front-to-back, the highest priority items are put
    ;; into the search table first, allowing lower priority items
    ;; to be the items found in the search table.
    (srecode-object-sort-list mt 'modetables (lambda (a b)
                                               (> (oref a priority)
                                                  (oref b priority))))
    ;; Return it.
    new))