From 1073189b7bf0d32ec3def0a9516b5933c2e2e3be Mon Sep 17 00:00:00 2001 From: Zhang Chiyuan Date: Thu, 6 Mar 2008 10:23:00 +0000 Subject: [PATCH] I didn't realized that filter is a function from rst.el instead of Emacs build-in -.-bb --- snippets/css-mode/background | 3 +++ yasnippet.el | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 snippets/css-mode/background diff --git a/snippets/css-mode/background b/snippets/css-mode/background new file mode 100644 index 0000000..d731807 --- /dev/null +++ b/snippets/css-mode/background @@ -0,0 +1,3 @@ +#name : background-color: ... +# -- +background-color: #${1:DDD}; \ No newline at end of file diff --git a/yasnippet.el b/yasnippet.el index 1fa0beb..75653af 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -52,7 +52,8 @@ current column if this variable is non-`nil'.") (defvar yas/use-menu t "If this is set to `t', all snippet template of the current mode will be listed under the menu \"yasnippet\".") - +(defvar yas/trigger-symbol " =>" + "The text that will be used in menu to represent the trigger.") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Internal variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -521,12 +522,12 @@ an example: (defun yas/directory-files (directory file?) "Return directory files or subdirectories in full path." - (filter (lambda (file) - (and (not (string-match "/\\.[^/]*$" file)) - (if file? - (not (file-directory-p file)) - (file-directory-p file)))) - (directory-files directory t))) + (remove-if (lambda (file) + (and (not (string-match "/\\.[^/]*$" file)) + (if file? + (not (file-directory-p file)) + (file-directory-p file)))) + (directory-files directory t))) (defun yas/make-menu-binding (template) (lexical-let ((template template)) @@ -568,7 +569,7 @@ the menu if `yas/use-menu' is `t'." (define-key keymap (vector (make-symbol key)) `(menu-item ,(yas/template-name template) ,(yas/make-menu-binding (yas/template-content template)) - :keys ,(concat key " ->"))))))) + :keys ,(concat key yas/trigger-symbol))))))) (defun yas/expand () "Expand a snippet. When a snippet is expanded, t is returned, @@ -666,6 +667,6 @@ content of the file is the template." (define-key keymap (vector (make-symbol key)) `(menu-item ,(or name key) ,(yas/make-menu-binding template) - :keys ,(concat key " ->"))))))))))) + :keys ,(concat key yas/trigger-symbol))))))))))) (provide 'yasnippet)