On Fri, Oct 20, 2017, 5:43 PM Kaushal Modi <kaushal.m...@gmail.com> wrote:

> On Fri, Oct 20, 2017 at 5:15 PM Eric Abrahamsen <e...@ericabrahamsen.net>
> wrote:
>
>> The template really only inserts the block type, not anything specific
>> like the source language or export backend.
>
>
> Right, but based on the code you have, you can easily add "SRC org", "SRC
> emacs-lisp" to the default value of that list. Looking at that, users can
> also get an idea that they can add their favorite languages to that list
> too.
>
>
>> I think prompting for
>> "second-level" information like that might be a little overkill.
>>
>
> I second that. The first-level prompt also feels a bit slow, honestly,
> compared to using easy templates like "<e". So in my config, I make "<e"
> (just an example) to insert the, well, EXAMPLE block as usual. But *if
> region is selected*, it does the wrapping as in your code.
>
> This is what I mean (GIF animation):
>
> https://i.imgur.com/201TISW.gifv
>
> I use hydra to provide those awesome hints.. but the same can be done
> without hydras too.
>

Hello all,

Above, I suggested merging the template insertion function with the current
easy template code.

With that, the easy template behavior will remain unchanged if no region is
selected. But if a region is selected, the same template (example: "<e")
Will wrap that region with that template.

I also have a GIF showing that behavior in action (linked in my previous
reply).

Benefits:
- Quicker as there are no prompts.. the user simply types the template
string as configured by them.
- Also one doesn't need to do a context switch to use a different binding
based on if region is selected or not.

@Eric: I believe you were sort of onboard with this suggestion, just gated
by a doubt if this actually can make into master.

So, checking with Nicolas, and the thread if the proposed behavior change
with easy templates (only when region is selected) would be accepted.

> --

Kaushal Modi

Reply via email to