From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: imenu support for babel blocks Date: Wed, 01 Dec 2010 17:17:18 +0100 Message-ID: <808w09foxd.fsf@missioncriticalit.com> References: <87wrspu6px.fsf@gmail.com> 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 Eric and David, "Eric Schulte" wrote: > Hi David, > > I've never used imenu myself, but that sounds useful. I'd recommend using > the following rather than building your own regexp > > (push (list "Source code chunks" > org-babel-src-name-w-name-regexp 2) > imenu-generic-expression) > > You're right that the Org-mode imenu setup looks fairly complex, and is > probably overwriting your simple expression above. Unfortunately I don't > know much about imenu and I'm now sure how a code block menu fits into the > existing Org-mode imenu support. I've written the following in my .emacs file: #+begin_src emacs-lisp ;; extension of Imenu (when (and ;; `org-babel' has been loaded (fboundp 'org-babel-execute-src-block) ;; `imenu' has been loaded (fboundp 'try-to-add-imenu)) (setq org-src-blocks-imenu-generic-expression `(("Snippets" ,org-babel-src-name-w-name-regexp 2))) (add-hook 'org-mode-hook (lambda () (setq imenu-generic-expression org-src-blocks-imenu-generic-expression)))) #+end_src ... but I never see any name of code chunk in the "IMenu" menu. I only see the headings of my current Org file. Any idea what I'm doing wrong? 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