Closed mhofert closed 11 years ago
Please try upgrading to the latest HEAD version of yasnippet, found on github and check back here. Do not use the workaround described in the thread since it is out of date. I'm away from my computer at the moment but will have a look at this soon. Thanks.
On Sat, Mar 31, 2012 at 7:33 AM, mhofert < reply@reply.github.com
wrote:
Hi,
I have exactly the problem as described here:
http://groups.google.com/group/smart-snippet/browse_thread/thread/8206a23037f598b1/39ed819692df63ad?lnk=gst&q=rnw&pli=1 Unfortunately, the described solution does not work -- TAB does not expand (ya)snippets in my .Rnw files. You can find a detailed description of the problem on:
http://tex.stackexchange.com/questions/49530/yasnippet-sweave-how-to-make-snippets-work-from-rnw-files I work on Mac OS X 10.7.3 with the very latest version of R (and ESS) and yasnippet-0.6.1c.
Cheers,
Marius
Reply to this email directly or view it on GitHub: https://github.com/capitaomorte/yasnippet/issues/231
Joo Tvora
Thanks a lot for your quick response. I'll give it a try and get back to you.
I installed the latest version from https://github.com/capitaomorte/yasnippet/tree/jit-loading. The problem remains. I can use M-x yas/expand to expand a snippet when the point is in the LaTeX part of an .Rnw file, but I can't use TAB to expand a snippet.
Hi, did you have a chance to look at it so far? Can you reproduce the problem?
Hi.
The problem is that noweb-minor-mode-map
already defines [tab]
as a
local keybinding for noweb-indent-line
.
Alternatively you can use
(add-hook 'ess-mode-hook #'(lambda () (local-set-key [tab] 'yas/expand)))
in the normal master branch, and maybe even the older 0.6 version (though I recommend you upgrade to the latest, however poorly documented it is).
Either way, as always, if yasnippet finds nothing to do, it should call the fallback binding.
Hope this works, Joo Tvora
On Wed, Apr 4, 2012 at 12:30 PM, mhofert < reply@reply.github.com
wrote:
Hi, did you have a chance to look at it so far? Can you reproduce the problem?
Reply to this email directly or view it on GitHub: https://github.com/capitaomorte/yasnippet/issues/231#issuecomment-4951569
Joo Tvora
Dear Joo,
cd ~/.emacs.d/plugins git clone https://github.com/capitaomorte/yasnippet
Something I am wondering: That's precisely the same git command as is used for the other branch(es). Is that correct? Because if it is wrong, it might be that I haven't installed the tighter branch correctly.
Cheers,
Marius
On Sun, Apr 8, 2012 at 9:22 AM, mhofert < reply@reply.github.com
wrote:
Dear Joo,
- I tried your first solution. Still, tab-expansion does not work. I am not sure if I installed the tighter branch correctly. I went to the URL you provided and did:
cd ~/.emacs.d/plugins git clone https://github.com/capitaomorte/yasnippet
Something I am wondering: That's precisely the same git command as is used for the other branch(es). Is that correct? Because if it is wrong, it might be that I haven't installed the tighter branch correctly.
- I then tried your second solution. But also here, I can use M-x yas/expand to expand a snippet, but not TAB. Note that I'm using the latest version (12.04) of ESS. Is this a problem? When I start R and check ess-mode-hook (through customization), I see the entry (lambda nil (local-set-key tab)). Still, it does not seem to work.
Cheers,
Marius
Reply to this email directly or view it on GitHub: https://github.com/capitaomorte/yasnippet/issues/231#issuecomment-5014059
- To try out a a specific branch, you have to switch to it after cloning (there are other ways). But basically you have to
git checkout tighter-tab
in the repository dir after cloning, then make sure emacs sees the new yasnippet.el- This should also work, I don't understand why not. I'm not in front of my computer right now, but try this directly in a buffer where you are experiencing the problem
M-x eval-expression RET (local-set-key [tab] 'yas/expand) RET
or maybe try this variation
M-x eval-expression RET (local-set-key (kbd "TAB") 'yas/expand) RET
If the second variation works, use that instead of the one I provided in the previous reply.
Joo Tvora
Thanks very much, Joo. I could switch to the tighter-tab branch and it now works! It would be great if this feature was also in the "standard" branch.
Unfortunately, I was too fast. Switching to the tighter-tab branch interferes with org-mode. It is not possible to expand sections in an org-file anymore with tab....
Concerning your other solution:
1) M-x eval-expression RET (local-set-key [tab] 'yas/expand) RET
=> this works when executed from within the .Rnw file. However, it does not work anymore when I have it in .emacs. How can I make this work from within .emacs?
2) M-x eval-expression RET (local-set-key (kbd "TAB") 'yas/expand) RET
=> this does not work when executed locally in the .Rnw file.
I guess I found something. This code solved it (for now):
(add-hook 'LaTeX-mode-hook '(lambda() (local-set-key [tab] 'yas/expand)))
I was wondering about the ess-mode-hook since at the point where I want to expand snippets the mode of the file is LaTeX and not ESS/R anymore. So simply replace ess-mode-hook by LaTeX-mode-hook and it should work.
I will test that and (if necessary) get back to you (if it doesn't work).
Cheers,
Marius
Closing as solved.
Hi,
I have exactly the problem as described here: http://groups.google.com/group/smart-snippet/browse_thread/thread/8206a23037f598b1/39ed819692df63ad?lnk=gst&q=rnw&pli=1 Unfortunately, the described solution does not work -- TAB does not expand (ya)snippets in my .Rnw files. You can find a detailed description of the problem on: http://tex.stackexchange.com/questions/49530/yasnippet-sweave-how-to-make-snippets-work-from-rnw-files I work on Mac OS X 10.7.3 with the very latest version of R (and ESS) and yasnippet-0.6.1c.
Cheers,
Marius