Skip to main content
21 events
when toggle format what by license comment
Aug 31, 2021 at 16:28 history edited Xaldew CC BY-SA 4.0
Add link to package for this code.
Sep 13, 2020 at 11:59 comment added Boson Bear I'll check on both. Thanks Xaldew!
Sep 12, 2020 at 13:32 comment added Xaldew @BosonBear: Not entirely sure what the problem is in your case. It seems like the custom snippet code isn't being run in the snippet, so make sure that .yas-setup.el has been properly installed. Additionally, you can set the variable yas-verbosity to a higher value (3 or 4) to get more debug output.
Sep 12, 2020 at 3:52 comment added Boson Bear Sorry I thought the problem still persisted but maybe I'm having a different problem. In my case when I follow the steps to create the snippet, defg <TAB> gives me the basic structure but they are not 'dynamic' in the sense all the text is fixed and static. Neither does pressing TAB again put me into the param list or editing the parameters updates the docstring. For example if I do the same thing as in your gif above, those "a:..." "b:..." do not show up in the docstring section. Any idea what I should look at?
Sep 11, 2020 at 20:56 comment added Xaldew @BosonBear, not sure what you're referring to, the snippet works just fine as far as I can tell. If you're referring to it being available on Melpa, well, not yet. I added a RFC quite a while ago now, but I haven't gotten a reply, so might be worth poking around there instead.
Sep 10, 2020 at 16:14 comment added Boson Bear Any way to fix this by now?
Mar 24, 2020 at 16:40 comment added tigerjack Have you considered to make it available as a package on melpa? Thanks for the good work by the way :)
Oct 8, 2019 at 8:20 comment added Xaldew @AstroFloyd That is correct, the code for .yas-setup.el should end up in the same directory as the snippet directory for the currently active mode. Which is ~/.emacs.d/snippets/python-mode/.yas-setup.el for python-mode as you pointed out.
Oct 7, 2019 at 16:26 comment added AstroFloyd I'd like to ask a stupid question as well (two as it happens). I suppose that "the code for the .yas-setup.el" goes into a file called .yas-setup.el. I'll assume that that file might not be found wherever I put it, so in which directory should it go? Is that ~/.emacs.d/snippets/python-mode? Also, the "code for the snippet" should probably be saved in a file too. What file name should I use and in which directory should I put it?
May 17, 2018 at 16:29 comment added Translunar Just now got around to trying again and it still doesn't seem to work for me as shown in the video. It creates the docstring for me but then doesn't update it. I don't see anything that looks unusual in my Messages buffer.
Jan 29, 2018 at 12:16 comment added Xaldew Apologies for the long delay with this but I think I finally figured it out. Try to replace incf with cl-incf in the code. It seems like yasnippet temporarily rebinds incf for some other purpose. You can also copy the code above directly, I've updated it with the fix.
Jan 29, 2018 at 12:14 history edited Xaldew CC BY-SA 3.0
incf -> cl-incf
Nov 17, 2017 at 18:55 comment added Translunar Yeah, It's still problematic. I'm using emacs 24.5.1 (the latest Ubuntu version) and the latest version of yasnippet.
Nov 16, 2017 at 10:33 comment added Xaldew Is this still an issue? I'm no longer able to replicate the above error using the latest Emacs/yasnippet.
Oct 13, 2017 at 16:04 comment added Xaldew I actually encountered this today as well in another of my snippets, I think it may be a bug in yasnippet. I'll have to create a minimal example to properly report it though. It may also be that chaining snippets in this fashion isn't supported anymore, but I hope that's not it.
Oct 12, 2017 at 14:48 comment added Translunar Stupid question, but how do I actually make this work on an existing function? I type defg and it gives me a new function named name with no arguments, and I can't see any way to automate it updating the docstring as I change that function. When I look at my Messages buffer, I see yas--update-mirrors: Wrong type argument: stringp, (python-args-to-google-docstring).
Feb 21, 2016 at 20:20 history edited Xaldew CC BY-SA 3.0
Updated snippet code with 'nesting' capabilities.
Feb 21, 2016 at 19:43 history edited Xaldew CC BY-SA 3.0
Added image, reduced the amount of text.
Jan 16, 2016 at 8:42 vote accept sy2
Jan 12, 2016 at 13:38 history edited Xaldew CC BY-SA 3.0
Clarified which package was used.
Jan 12, 2016 at 10:33 history answered Xaldew CC BY-SA 3.0