From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: function for inserting a block Date: Fri, 20 Oct 2017 18:39:57 +0000 Message-ID: References: <877exghblx.fsf@ericabrahamsen.net> <87efromccg.fsf@nicolasgoaziou.fr> <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: multipart/alternative; boundary="001a114f38a05bae25055bfecda3" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5cDK-0000IL-KZ for emacs-orgmode@gnu.org; Fri, 20 Oct 2017 14:40:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5cDJ-0007Gc-Om for emacs-orgmode@gnu.org; Fri, 20 Oct 2017 14:40:10 -0400 Received: from mail-yw0-x22a.google.com ([2607:f8b0:4002:c05::22a]:44870) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5cDJ-0007GT-IZ for emacs-orgmode@gnu.org; Fri, 20 Oct 2017 14:40:09 -0400 Received: by mail-yw0-x22a.google.com with SMTP id k11so7155192ywh.1 for ; Fri, 20 Oct 2017 11:40:09 -0700 (PDT) In-Reply-To: <87k1zp4rxj.fsf@ericabrahamsen.net> 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: Eric Abrahamsen , emacs-orgmode@gnu.org --001a114f38a05bae25055bfecda3 Content-Type: text/plain; charset="UTF-8" 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? :)
-- 

Kaushal Modi

--001a114f38a05bae25055bfecda3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Oct 20= , 2017 at 2:07 PM Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
Okay, here's another version, with a new keybinding and compl= etion. 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")
=C2=A0 = =C2=A0 =C2=A0 (org-escape-code-in-region s e))=C2=A0

I have never needed to escape org in example, blocks, but I *have* neede= d to do that in org src blocks.=C2=A0

Should = type string be also matched with "src org"?

Actually should the type str= ing be matched only with "src org"? Because I see the Org example= blocks as <pre> <code> blocks in HTML with no syntax highlight= ing.. so those can contain code from any language.

Also as this is part of org and emacs, org-structure-predefined-blocks des= erves "SRC org" and "SRC emacs-lisp" too? :)
--

Kaushal Modi

--001a114f38a05bae25055bfecda3--