From 5c7e870891ed0b4d8a79a104ecb08a24dedd00e8 Mon Sep 17 00:00:00 2001 From: capitaomorte Date: Wed, 15 Jul 2009 16:18:44 +0000 Subject: [PATCH] Got to: * get fixed indentation working * merge from trunk * try to implement snippet-local vars * implement a command `find-snippet-file' that defaults to the dir and sets `yas/snippet-editing-mode' --- yasnippet.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/yasnippet.el b/yasnippet.el index 54011ee..d1ae558 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -1893,6 +1893,28 @@ When multiple expressions are found, only the last one counts." (set-marker (yas/field-end field) (point))) t)))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Major mode stuff +;; +(defvar yas/font-lock-keywords + (append '(("^#.*$" . font-lock-comment-face)) + lisp-font-lock-keywords + lisp-font-lock-keywords-1 + lisp-font-lock-keywords-2 + '(("$\\([0-9]+\\)" + (0 font-lock-keyword-face) + (1 font-lock-string-face t)) + ("${\\([0-9]+\\):?" + (0 font-lock-keyword-face) + (1 font-lock-warning-face t)) + ("\\(\\$\\)(" 1 font-lock-preprocessor-face) + ("}" + (0 font-lock-keyword-face))))) + +(define-derived-mode yas/snippet-editing-mode emacs-lisp-mode "YASnippet" + "A mode for editing yasnippets" + (setq font-lock-defaults '(yas/font-lock-keywords))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Debug functions. Use (or change) at will whenever needed. ;;