From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: function for inserting a block Date: Fri, 20 Oct 2017 14:13:02 -0700 Message-ID: <871slx4j6p.fsf@ericabrahamsen.net> 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> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5edC-0002zF-Gj for emacs-orgmode@gnu.org; Fri, 20 Oct 2017 17:15:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5ed9-0005cI-AF for emacs-orgmode@gnu.org; Fri, 20 Oct 2017 17:15:02 -0400 Received: from [195.159.176.226] (port=57589 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5ed9-0005ad-2Z for emacs-orgmode@gnu.org; Fri, 20 Oct 2017 17:14:59 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e5ecq-0001H0-Nw for emacs-orgmode@gnu.org; Fri, 20 Oct 2017 23:14:40 +0200 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: emacs-orgmode@gnu.org Kaushal Modi writes: > On Fri, Oct 20, 2017 at 2:07 PM Eric Abrahamsen wrote: > > Okay, here's another version, with a new keybinding and completion. The > completion strings are uppercase, which might not always be the right > thing, but probably more often than not. > > Hi Eric, > > I just tried it out, and it works great! > > I have a comment about > > (when (string-equal (downcase type) "example") > (org-escape-code-in-region s e)) > > I have never needed to escape org in example, blocks, but I *have* needed to do that in org src blocks. > > Should type string be also matched with "src org"? > > Actually should the type string be matched only with "src org"? Because I see the Org example blocks as
  blocks in HTML with no syntax highlighting.. so
> those can contain code from any language.
>
> Also as this is part of org and emacs, org-structure-predefined-blocks deserves "SRC org" and "SRC emacs-lisp" too? :)

The template really only inserts the block type, not anything specific
like the source language or export backend. I think prompting for
"second-level" information like that might be a little overkill.

As for what should be escaped and what shouldn't, I defer to Nicolas,
let's see what he says.

Eric