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
--
Sébastien Vauban
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-orgmode