From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Restore old easy template feature (Re: function for inserting a block) Date: Wed, 08 Nov 2017 12:43:41 +0000 Message-ID: References: <877exghblx.fsf@ericabrahamsen.net> <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> <87376btslq.fsf@nicolasgoaziou.fr> <87vaj7oyxb.fsf@ericabrahamsen.net> <871sl9ow44.fsf@gnu.org> <87fu9pgfkj.fsf@nicolasgoaziou.fr> <87tvy5nf0q.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114d7df8342554055d780a0e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCPhz-0006jD-OB for emacs-orgmode@gnu.org; Wed, 08 Nov 2017 07:43:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCPhy-0007Cc-Uc for emacs-orgmode@gnu.org; Wed, 08 Nov 2017 07:43:55 -0500 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: Bastien Guerry Cc: Eric Abrahamsen , emacs-orgmode@gnu.org, Nicolas Goaziou --001a114d7df8342554055d780a0e Content-Type: text/plain; charset="UTF-8" On Wed, Nov 8, 2017, 7:27 AM Kaushal Modi wrote: > On Wed, Nov 8, 2017, 7:16 AM Bastien wrote: > >> >> is there a simple mechanism in Emacs core to restore the same >> functionnality? >> > > +1 > To clarify, I am not suggesting to blindly restore the old easy template system, and then have 2 sets of code doing similar things. I am suggesting to have a minor mode that simply binds "<" to do the template insertion (only when that is typed at BOL with optional leading whitespace, or if a region is selected). If they want to literally type "<" in those cases, they can either type "<<" or the old "C-q <". That minor mode will reuse the code that Eric added, so that typing " -- Kaushal Modi --001a114d7df8342554055d780a0e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Nov 8, 2017, 7:27 AM Ka= ushal Modi <kaushal.modi@gmail= .com> wrote:
On Wed, Nov 8, 2017, 7:16 AM Bastien <bzg@gnu.org> wrote:
<= /div>

is there a simple mechanism in Emacs core to restore the same
functionnality?

+1=C2=A0

To clarify, I am not suggesting to blin= dly restore the old easy template system, and then have 2 sets of code doin= g similar things.=C2=A0

I am suggesting to have a = minor mode that simply binds "<" to do the template insertion = (only when that is typed at BOL with optional leading whitespace, or if a r= egion is selected). If they want to literally type "<" in thos= e cases, they can either type "<<" or the old "C-q <= ;".=C2=A0

That minor mode will reuse the code= that Eric added, so that typing "<s" will insert the BEGIN_SR= C block, etc.=C2=A0

I can work on getting a patch = ready if people are fine with this idea (I effectively do the same in my co= nfig, but with the old template system. So while the heuristics work great,= I'll need to adjust that code to fit the easy template replacement.)
--

Kaushal Modi

--001a114d7df8342554055d780a0e--