From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Girard Subject: Re: org-exp-blocks: what about previewing blocks ? Date: Thu, 18 Jun 2009 11:32:36 +0200 Message-ID: <51b0095d0906180232j3489705dndcc7d458d5a078af@mail.gmail.com> References: <51b0095d0906161740n23379dbbtdf919aa3e8a4ea4a@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1899550608==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHDzA-0000E5-2V for emacs-orgmode@gnu.org; Thu, 18 Jun 2009 05:32:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHDz4-00005b-T4 for emacs-orgmode@gnu.org; Thu, 18 Jun 2009 05:32:43 -0400 Received: from [199.232.76.173] (port=41882 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHDz4-00005H-Nb for emacs-orgmode@gnu.org; Thu, 18 Jun 2009 05:32:38 -0400 Received: from mail-fx0-f224.google.com ([209.85.220.224]:51542) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MHDz4-0006Ut-8J for emacs-orgmode@gnu.org; Thu, 18 Jun 2009 05:32:38 -0400 Received: by fxm24 with SMTP id 24so1366729fxm.42 for ; Thu, 18 Jun 2009 02:32:36 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============1899550608== Content-Type: multipart/alternative; boundary=000e0cd28d1494e6e8046c9c16d3 --000e0cd28d1494e6e8046c9c16d3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/6/18 Carsten Dominik > > On Jun 17, 2009, at 2:40 AM, Nicolas Girard wrote: > > Hi all, >> >> currently the code in org-exp-blocks is intended for pre-processing only. >> It seems to me like org-mode would gain a very powerful feature, if >> blocks could also be previewed in their own buffer, using the same >> mechanism as the org-format-latex function. >> What do you think ? >> > > I don't see how this could be done in a general way. I guess you mean in > particular > the graphics blocks like ditaa? > Yes. For any block type bt, if it makes sense, it would be possible to write such org-block--generate-image(body) that takes the block as argument and returns the path of the image it produced. Then: - for exporting: the existing org-export-blocks-format- functions would simply call their respective org-block--generate-image and work the same ; - for previewing a block of type : if such org-block--generate-image exists, call it and display it the same way org-format-latex does Wouldn't it be great ? Nicolas --000e0cd28d1494e6e8046c9c16d3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2009/6/18 Carsten Dominik <= carsten.dominik@gmail.com&= gt;

On Jun 17, 2009, at 2:40 AM, Nicolas Girard wrote:

Hi all,

currently the code in org-exp-blocks is intended for pre-processing only. It seems to me like org-mode would gain a very powerful feature, if
blocks could also be previewed in their own buffer, using the same
mechanism as the org-format-latex function.
What do you think ?

I don't see how this could be done in a general way. =A0I guess you mea= n in particular
the graphics blocks like ditaa?

Yes. For any block type bt, if it makes sense,= it would be possible to write such org-block-<bt>-generate-image(bod= y) that takes the block as argument and returns the path of the image it pr= oduced.

Then:
- for exporting: the existing org-export-blocks-format-<bt&= gt; functions would simply call their respective org-block-<bt>-gener= ate-image and work the same ;
- for previewing a block of type <bt>= ;: if such org-block-<bt>-generate-image exists, call it and display = it the same way org-format-latex does

Wouldn't it be great ?

Nicolas
--000e0cd28d1494e6e8046c9c16d3-- --===============1899550608== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1899550608==--