Watched the video tutorial for yasnippet, way cool.
I've made some changes, please feel free to incorporate them if you think
them appropriate:
added: yas-mode
yas is now a minor mode, not a global override of the yas/trigger-key
(this enables it to co-exist with other packages that use TAB,
e.g. pabbrev, there are still order dependencies, but they can both work
now)
this also allows user to turn it off easily (as opposed to restarting emacs)
changed: TAB
there was some hard-coding of the <TAB> key, so fixed that place to use
the variable yas/trigger-key
obsoleted: yas/trigger-fallback
this is no longer needed as yas is a minor mode, the 'fallback' can be
computed on the fly and called with 2 lines, also this will work in modes
that have different bindings for whatever the trigger-key is.
mode-hooks:
yas/define-snippets updated to add the function 'yas-mode-on to all the
mode-hooks for modes that have snippets defined
yas/initialize:
no longer does a global binding (i left the menu stuff alone)
I verified this works for me, and I have the yas/trigger-key defined as SPC.
TJ
--
Trey Jackson
bigfa...@gmail.com
"It is not the answer that enlightens, but the question."
-- Decouvertes
I come along with the fall-back solution but don't know the minor-mode
version. Maybe yours is a good idea. I'll try it! :)
As with the mode-hook. Have you encountered some mode without a hook?
The early days when I written smart-snippet(which use abbrev-table). I
found some mode without abbrev-table. So I'm afraid to encounter some
mode without hook.
Also, the hierarchy has changed to allow user to define some "virtual
mode" as the parent mode (or common mode). For example: a
common-c-mode for c-mode, c++-mode and java-mode. There should be any
hook for those "virtual mode". So I need to re-consider this.
Anyway, Thanks for your patch!
2008/3/14, Trey Jackson <bigfa...@gmail.com>:
> Errr....
>
> helps if I attach the diff.
>
>
>
> >
>
2008/3/14, Trey Jackson <bigfa...@gmail.com>:
>