* started attack on template code as well

* still got indenting to do
This commit is contained in:
capitaomorte 2009-07-11 18:09:25 +00:00
parent ad570bf9e5
commit 01c626efbd

View File

@ -350,6 +350,25 @@ fetch from parent if any."
(yas/snippet-table-parent table)
key)))
templates))
(defun yas/snippet-table-all-templates (table)
(when table
(let ((acc))
(maphash #'(lambda (key templates)
(setq acc (append acc templates)))
(yas/snippet-table-hash table))
(append acc
(yas/snippet-table-all-templates (yas/snippet-table-parent table))))))
(defun yas/snippet-table-all-keys (table)
(when table
(let ((acc))
(maphash #'(lambda (key templates)
(push key acc))
(yas/snippet-table-hash table))
(append acc
(yas/snippet-table-all-templates (yas/snippet-table-parent table))))))
(defun yas/snippet-table-store (table full-key key template)
"Store a snippet template in the table."
(puthash key
@ -792,6 +811,19 @@ when the condition evaluated to non-nil."
(undo 1))
nil))
;; (defun yas/completing-expand ()
;; "Choose a snippet to expand, pop-up a list of choices according
;; to `yas/popup-function'"
;; (let ((keys)
;; (choice))
;; (maphash #'(lambda (key val)
;; (push key keys)) (yas/current-snippet-table))
;; (let ((choice (and keys
;; (ido-completing-read "Choose: " keys nil nil nil nil (car possibilities))))
;; (template (and choice
;; (gethash choice (yas/current-snippet-table)))))
(defun yas/expand ()
"Expand a snippet."
(interactive)