From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: function for inserting a block Date: Mon, 23 Oct 2017 16:00:16 +0200 Message-ID: References: <877exghblx.fsf@ericabrahamsen.net> <87ziabepxt.fsf@ericabrahamsen.net> <87bmml2fb0.fsf@ericabrahamsen.net> <87fubuzpsa.fsf@nicolasgoaziou.fr> <874lsabdop.fsf@ericabrahamsen.net> <87vak1l11m.fsf@nicolasgoaziou.fr> <87r2uoc4q7.fsf@ericabrahamsen.net> <87bmllk5xy.fsf@nicolasgoaziou.fr> <878tgmwwsa.fsf@ericabrahamsen.net> <87po9q2e8k.fsf@nicolasgoaziou.fr> <87tvyyvpst.fsf@ericabrahamsen.net> <87fuaiz069.fsf@nicolasgoaziou.fr> <87lgk9eo4d.fsf@ericabrahamsen.net> <87fuahxxvs.fsf@nicolasgoaziou.fr> <87r2u1cuwj.fsf@ericabrahamsen.net> <87infdctzq.fsf@ericabrahamsen.net> <87k1zsbizs.fsf@ericabrahamsen.net> <87k1zp4rxj.fsf@ericabrahamsen.net> <871slx4j6p.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1b398e3b1223055c373f6e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6dHY-0005nj-L6 for emacs-orgmode@gnu.org; Mon, 23 Oct 2017 10:00:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6dHU-00071T-6V for emacs-orgmode@gnu.org; Mon, 23 Oct 2017 10:00:44 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:56392) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6dHT-00070P-TF for emacs-orgmode@gnu.org; Mon, 23 Oct 2017 10:00:40 -0400 Received: by mail-wm0-x229.google.com with SMTP id z3so3073500wme.5 for ; Mon, 23 Oct 2017 07:00:38 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Kaushal Modi Cc: Eric Abrahamsen , emacs-org list , Nicolas Goaziou --94eb2c1b398e3b1223055c373f6e Content-Type: text/plain; charset="UTF-8" On Mon, Oct 23, 2017 at 12:52 PM, Kaushal Modi wrote: > On Fri, Oct 20, 2017, 5:43 PM Kaushal Modi wrote: > >> On Fri, Oct 20, 2017 at 5:15 PM Eric Abrahamsen >> 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 "> (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: " Will wrap that region with that template. > I Kaustal, I am not sure I understand, at least with transient-region turned on. Typing > 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 > --94eb2c1b398e3b1223055c373f6e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Oct 23, 2017 at 12:52 PM, Kaushal Modi <kaushal.modi@gmai= l.com> wrote:
On Fri, Oct 20, 2017, 5:4= 3 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:
On F= ri, Oct 20, 2017 at 5:15 PM Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
The template really only inserts the = block type, not anything specific
like the source language or export backend.

Right, but based o= n the code you have, you can easily add "SRC org", "SRC emac= s-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 to= o.
=C2=A0=
I think prompting for
"second-level" information like that might be a little overkill.<= br>

I second that. The first-level prompt also feels a bit slo= w, 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 animatio= n):

I use hydra to provide those awesome hints.. but the same can = be done without hydras too.

Hello all,

Above, I suggested merg= ing the template insertion function with the current easy template code.=C2= =A0

With that, the easy template behavior will rem= ain unchanged if no region is selected. But if a region is selected, the sa= me template (example: "<e") Will wrap that region with that te= mplate.=C2=A0

I Kaustal,
I am not sure I understand, at least with transient-region tur= ned on.=C2=A0 Typing <e will deactivate the region, so there is no effec= t.

Or do you mean to actually put "<"= into a keymap?

Carsten
=C2=A0

I also have a GIF showing th= at behavior in action (linked in my previous reply).=C2=A0

Benefits:
- Quicker as there are no prompts.. the user s= imply types the template string as configured by them.=C2=A0
- Al= so one doesn't need to do a context switch to use a different binding b= ased on if region is selected or not.=C2=A0

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

= So, checking with Nicolas, and the thread if the proposed behavior change w= ith easy templates (only when region is selected) would be accepted.=C2=A0<= /div>
--

Kaushal Modi


--94eb2c1b398e3b1223055c373f6e--