Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add yas-oneshot for quick snippet creation #350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lewang
Copy link
Contributor

@lewang lewang commented Dec 23, 2012

I had this laying around in my personal config for a long time, thought others might find it useful.

Documentation included. This does something similar to #309, but allows for the possibility of adding placeholders.

@joaotavora
Copy link
Owner

This is very interesting after playing around with it. I would like to see this integrated in yasnippet.el.

  • I like a lot that yas-oneshot varies behaviour depending on whether there is a region selected or not. Also like the name 👍
  • it is missing more documentation. It should pass the M-x checkdoc command.
  • Need some unit tests for the basic cases. See yasnippet-tests.el
  • invoking yas-oneshot should highlight the symbols selected for placeholders in the active region. If this is difficult to implement, don't worry a lot about it.
  • There should be a yas-offer-to-save-one-shots customization variable (and this would mean integration with New snippet with selected text #309). When set to t and when the user is done, it should pop to a new-snippet buffer, with the snippet neatly setup and ready to press C-c C-c for loading the snippet into whichever mode the user chooses.
  • Also the messages presented to the user should be a little clearer and be preceded by "[yas]". It should be clearer that inputting nothing means "I'm done"
  • Discovered that there was a serious bug in yas-reload-all, where it reset yas-minor-mode-map.I fixed this is 1ef0091, so now you can use eval-after-load. However, if this is to be integrated in yasnippet.el it is not needed.

@lewang
Copy link
Contributor Author

lewang commented Dec 24, 2012

Thanks for checking it out. Yous points all seem valid, I'll make the changes soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants