org-menu icon indicating copy to clipboard operation
org-menu copied to clipboard

Support for alternative template packages

Open minad opened this issue 3 years ago • 2 comments

Hey, I recently developed Tempel, so I wonder if there is interest in supporting different template packages in org-menu in addition to yasnippet? One could either check for the template packages via fbound or introduce an template-expand-function defcustom, which will then take a template key as argument.

Originally posted by @minad in https://github.com/sheijk/org-menu/issues/4#issuecomment-1037965460

minad avatar Feb 13 '22 18:02 minad

Yes, I'm very open to that. When I added yasnippet support I thought it had been moved into Emacs core. Otherwise this would be some form of extension. I'm haven't spent time to consider how to best do this for every use of yasnippet, yet. If you have ideas I'd be happy to hear them. Ideally it would be more or less automatic

Copied from original post

sheijk avatar Feb 13 '22 21:02 sheijk

The simplest solution would be to add a configuration option org-menu-template-expand-function which takes a symbol as argument, the name of the template. Then the templates would have to be made available separately and added to the user configuration. The advantage would be that the user can configure and adjust the snippets, in comparison to the hard-coded snippets you have right now.

minad avatar Feb 13 '22 21:02 minad

@minad I finally got around to implement this. Hope it still will be useful

sheijk avatar Feb 09 '23 22:02 sheijk

Thanks! That's nice. If you are interested you could give my Tempel package a try. :)

minad avatar Feb 09 '23 22:02 minad