From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [org-babel] Idea: Rendering output of code blocks inline (like org links) Date: Thu, 15 Oct 2009 16:42:39 -0600 Message-ID: References: <1e5bcefd0910150808j632a07bcgeb98b9480cb70a28@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MyZ22-0000Ut-QW for emacs-orgmode@gnu.org; Thu, 15 Oct 2009 18:42:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MyZ1x-0000UR-Ba for emacs-orgmode@gnu.org; Thu, 15 Oct 2009 18:42:49 -0400 Received: from [199.232.76.173] (port=33328 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyZ1x-0000UO-6d for emacs-orgmode@gnu.org; Thu, 15 Oct 2009 18:42:45 -0400 Received: from mail-pz0-f192.google.com ([209.85.222.192]:41602) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MyZ1w-00011c-Of for emacs-orgmode@gnu.org; Thu, 15 Oct 2009 18:42:44 -0400 Received: by pzk30 with SMTP id 30so1235517pzk.24 for ; Thu, 15 Oct 2009 15:42:43 -0700 (PDT) In-Reply-To: <1e5bcefd0910150808j632a07bcgeb98b9480cb70a28@mail.gmail.com> (Marcelo de Moraes Serpa's message of "Thu, 15 Oct 2009 10:08:35 -0500") 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: Marcelo de Moraes Serpa Cc: Org Mode Marcelo de Moraes Serpa writes: > Hello list! > > I haven't still managed to get org-babel to work, but I do have a doubt that might turn into a feature > request :) > > Would it be possible to have chunks of code around the buffer get evaluated when you close them with some > kind of token, and them only show the output, *just like links behave*. > > When you create a link, you have the structure: > > [[/location][name]] > > As you know, when you close this string, the rendering changes, and only the name part is shown, styled as > a link. > Hi Marcelo, Thanks for the suggestion. It is currently possible to fold source blocks (just TAB while at the beginning of the #+begin_src line), and in addition it is possible to automatically fold all source blocks when opening an Org-mode file by adding the following to your file header lines #+STARTUP: hideblocks As for automatically hiding blocks, there are a couple of issues which make me warry of going down that path. 1) it would be complicated 2) it could prove annoying in the (in my experience common) case when you *do* want to see and edit the innards of a source-code block 3) the results of a source code block are in no way constrained to be located after the body of the block. In cases where they are not located near each other the body would be invisible (which is not desirable) and when viewing the results there would be no way to tell if there is or isn't a source-block hidden beneath it is it possible that the current folding behavior is sufficient? > > I'm wondering if the same thing would be possible, only that, instead of showing the "name", it would be > the output of a string evalution - which could be a complex table, or a graph (could org buffers have > images embedded inline?) The following allows viewing images inline in Org-mode files using iimage-mode. This may be helpful. --8<---------------cut here---------------start------------->8--- ;; iimage (require 'iimage) (setq iimage-mode-image-search-path (expand-file-name "~/")) ;;Match org file: links (add-to-list 'iimage-mode-image-regex-alist (cons (concat "\\[\\[file:\\(~?" iimage-mode-image-filename-regex "\\)\\]") 1)) (defun org-toggle-iimage-in-org () (interactive) (if (face-underline-p 'org-link) (set-face-underline-p 'org-link nil) (set-face-underline-p 'org-link t)) (iimage-mode)) --8<---------------cut here---------------end--------------->8--- > or any other output, inline, in the buffer (no need to export it). > > Well, just a thought, let me know what you guys think about it. > I see the point of your suggestions, and I don't deny that folded source blocks would be slick, I'm just not sure that they would be worth the additional effort/complexity -- however anyone is encouraged to disagree with me :). Thanks -- Eric > > Att, > > Marcelo. > > _______________________________________________ > 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