From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: [babel] Painless integration of source blocks with language Date: Wed, 26 Jan 2011 11:43:24 +0100 Message-ID: <80zkqoq71v.fsf@missioncriticalit.com> References: <87lj2ukfia.fsf@gmail.com> <87k4icegwl.fsf@ucl.ac.uk> <87wrmbwdsm.fsf@gmail.com> <87aaj5tbgl.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Dan, Dan Davison wrote: > Eric S Fraga writes: >> "Eric Schulte" writes: >>> Eric S Fraga writes: >> >>>> management issue: I find it difficult (a) to remember what all my sour= ce >>>> 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 l= ike >>>> 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 work= ing >>> 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). > > Would anyone object if I change that function slightly so that it > doesn't strip text properties, so that the search hits come up in the > minibuffer with the in-context fontification? Not sure either to understand what you mean... >>> 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 > > As a different approach, `occur' is good for doing this (results listed > in a separate buffer with jump-back links). The function below can be > extended in the obvious way. > > #+begin_src emacs-lisp > (defun dan/find-in-buffer () > (interactive) > (let ((targets > `(("" . ,org-babel-src-name-regexp) > ("" . ,org-babel-result-regexp)))) > (occur > (cdr > (assoc > (ido-completing-read "Find: " (mapcar #'car targets)) > targets))) > (other-window 1))) > #+end_src Thanks for sharing this. Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode