From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] Painless integration of source blocks with language Date: Tue, 11 Jan 2011 10:12:43 -0700 Message-ID: <87wrmbwdsm.fsf@gmail.com> References: <87lj2ukfia.fsf@gmail.com> <87k4icegwl.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=38839 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pci17-0008DW-CX for emacs-orgmode@gnu.org; Tue, 11 Jan 2011 12:28:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pci15-0002rJ-Ir for emacs-orgmode@gnu.org; Tue, 11 Jan 2011 12:28:21 -0500 Received: from mail-pw0-f41.google.com ([209.85.160.41]:63789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pci15-0002qy-EC for emacs-orgmode@gnu.org; Tue, 11 Jan 2011 12:28:19 -0500 Received: by pwj8 with SMTP id 8so3936098pwj.0 for ; Tue, 11 Jan 2011 09:28:18 -0800 (PST) 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: Eric S Fraga Cc: emacs-orgmode@gnu.org, Seth Burleigh Eric S Fraga writes: > "Eric Schulte" writes: > > [...] > >> A crude version of the above is already possible using the >> `org-babel-detangle' function. For example, follow the instructions in >> the attached org-mode file (which uses elisp rather than clojure code >> blocks simply for wider portability to non-clojure users). > > Detangling, as currently implemented, doesn't do the job for me as it > doesn't understand noweb. My current mode of operation with org and > babel is to have various snippets of code throughout a file and then > combine these in different ways using noweb syntax which I then tangle > to create different source files (each bringing together different > pieces in different configurations). > I agree, this is an area ripe for improvement. > > In any case, and please excuse me for hijacking this thread a little, > the increasing use of babel (a good thing!) especially with noweb syntax > and tangling (as this thread is about) is bringing up a document > management issue: I find it difficult (a) to remember what all my source > code snippets are called and (b) to navigate to any given snippet. I > would love to see a babel table of contents popup (a la the table of > contents popup with reftex implements for latex files). Is something > like this already available? If not, how difficult would it be to > implement (I'm happy to try given a pointer in the right > direction(s)...). > There was some talk of merging imenu with Babel which would provide the functionality you describe, I don't believe this ever resulting in working code however. There are a couple of options... If you know the name of the code block you want to find you can use `org-babel-goto-named-src-block' (bound to C-c C-v g) to jump to a named code block (=E2=88=83 a similar function for finding named results). This function provides completion on the block names, the function `org-babel-src-block-names' returns a list of all named blocks in the current buffer, so it could be used to built up such a table. In fact the following code block will insert a table of such names in the current buffer. Note: you will need to pull the latest as I had to fix a small bug in `org-babel-src-block-names'. #+begin_src emacs-lisp :results list (mapcar #'list (reverse (org-babel-src-block-names))) #+end_src Hope that helps, Best -- Eric > > Thanks, > eric