From 33c0cd5fe1f6fa0fa81ae82d53923cf59895f4ce Mon Sep 17 00:00:00 2001 From: Zhang Chiyuan Date: Thu, 20 Mar 2008 08:11:39 +0000 Subject: [PATCH] before expansion hook --- yasnippet.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index 5d61135..dd856f4 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -120,9 +120,7 @@ proper values: (defvar yas/before-expand-snippet-hook '() - "Hooks to run after a before expanding a snippet. -If you move the cursor (e.g. call `re-search-forward') in this hook, -please wrap it with `save-excursion', or else yanippet will get confused.") + "Hooks to run after a before expanding a snippet.") (defvar yas/buffer-local-condition t "Condition to yasnippet local to each buffer. @@ -517,6 +515,8 @@ redo-ed." (defun yas/expand-snippet (start end template) "Expand snippet at current point. Text between START and END will be deleted before inserting template." + (run-hooks 'yas/before-expand-snippet-hook) + (goto-char start) (let ((key (buffer-substring-no-properties start end))