abo-abo / auto-yasnippet

quickly create disposable yasnippets
245 stars 15 forks source link

Add optional args BEG, END to `aya-create` #30

Closed he-la closed 5 years ago

he-la commented 5 years ago

This commit adds optional arguments BEG and END to aya-create. These arguments allow the to explicitly set the region for aya-create to work on.

Since the arguments are optional, and the function took no arguments previously, this change is fully backwards-compatible.

The new arguments give more flexibility to customize auto-yasnippet. Personally, I am using them to integrate with evil-mode by advising evil-yank and evil-paste to create/expand snippets when needed.

I'll note that my experience with elisp is somewhat limited, so if there are better ways of doing this then I'll be happy to change the approach here.

abo-abo commented 5 years ago

Merged, thanks.