haxney / smart-tab

An intelligent tab completion function for Emacs
http://www.emacswiki.org/emacs/TabCompletion
21 stars 28 forks source link

Conflicts with Yasnippet tab functionality (I think) #1

Open mwilliams opened 15 years ago

mwilliams commented 15 years ago

I heavily rely on Yasnippet for working with snippet completion and smart-tab conflicts and removed the Yasnippet tab functionality.

Still very much a novice when it comes to hacking elisp so I can't quite figure out how to work it in.

It appears yas/expand gets called to do the expansion, so I guess that would needed to be added into the chain somewhere?

haxney commented 15 years ago

Thanks for the report! I'll look into it and get back to you.

I don't use YaSnippet (though I have heard good things about it), so could you tell me what command YaSnippet binds to when smart-tab is not activated (C-h k )? Part of what smart-tab does is try to replicate Emacs' keybinding lookup mechanism, so knowing what should be called will help.

Thanks again for the report!

haxney commented 15 years ago

Oh, and I almost forgot, could you give me your Emacs version, what OS you are using, and try using Yasnippet and smart-tab without any other customizations. You can do this by running Emacs with:

$ emacs -Q

and then loading yasnippet and smart-tab manually.

mwilliams commented 15 years ago

I'm running the build from http://emacsformacosx.com/ (in OSX Snow Leopard). The about says 23.1 (9.0).

And actually, I've seen to have done something to completely destroy any tabbing at all! I've commented out Yasnippet so I'm only loading smart-tab with:

(load-file "~/.emacs.d/vendor/smart-tab/smart-tab.el")
(require 'smart-tab)

So I'm really scratching my head right now and I may need to go back a few commits to find where I broke the functionality altogether.

But my .emacs file is here if you want to take a peek: http://github.com/mwilliams/emacs/blob/master/mwilliams.el

It's really nothing special, I started with the emacs-starter-kit but started from scratch and only implemented the functionality I needed. It's been fun and this has been my first week working only in Emacs and not touching TextMate. I'm really beginning to appreciate Emacs a lot, mostly to great additions like yours (when I had it working! haha). And I'm the one you responded to on StackOverflow the other day in regard to the smart-tab question :). So Thanks!

jney commented 13 years ago

Hello, i've got the same problem, i think. I'm using smart-tab and i like it, and i'm using yasnippet that i like too. the problem is, that when i use them together yasnippet doesn't work anymore. any idea how to fix it ?

marciomr commented 13 years ago

Smart-tab + yasnippet would be great. I guess it shouldn't be that hard. Before calling hippie-expand it should call yas/expand in yas/minor-mode. I tryed to change the file, but it didn't work :-(

marciomr commented 13 years ago

I got it. It is much easier to configure hippie-expansion to be compatible with yasnipet and then using hippie-expansion with smart-tab.

in the .emacs file add

(add-to-list 'hippie-expand-try-functions-list 'yas/hippie-try-expand) ;put yasnippet in hippie-expansion list

(setq smart-tab-using-hippie-expand t) (global-smart-tab-mode t)

xumingming commented 11 years ago

+1 for @marciomr 's solution, works for me, thanks!