On date Monday 2007-07-02 22:11:21 +0000, W. Borgert wrote:
> On Mon, Jul 02, 2007 at 02:27:52PM +0200, Stefano Sabatini wrote:
> > Unfortunately both seem to lack tagging feature, to show up the layout
> > of the document displayed, which is fundamental to me while editing a
> > complex document, to understand where I am and to easily jump from one
> > section to another one
>
> One could make use of "imenu" and/or "speedbar". imenu and
> speedbar are parts of Emacs 21 and 22, AFAIK. Try this:
>
> (require 'imenu)
> (require 'speedbar)
> (defvar dbk-imenu-generic-expression nil
> "Imenu generic expression for DocBook. See `imenu-generic-expression'.")
> (add-hook 'nxml-mode-hook
> (lambda ()
> (speedbar-add-supported-extension ".dbk")
> (setq dbk-imenu-generic-expression
> '((nil
> "^[ \t]*<title>\\(.*\\)</title>"
> 1)))
> (setq imenu-generic-expression dbk-imenu-generic-expression
> imenu-case-fold-search nil)
> (imenu-add-to-menubar "DocBook")))
>
> Now call M-x speedbar, when you are in nxml-mode. It does not
> really reflect the document structure, but maybe it helps a bit
> to see all titles in the right order. speedbar lets you jump to
> the right place, as does the menu "DocBook".
Thank you, it helped much :-).
I elaborated a very basic derived mode (attached) with the imenu
tagging for the titles. Then I discovered the function:
nxml-hide-all-text-content
which shows in the editing buffer the outline of the whole document.
My ideal solution would be to find a way to use semantic to analyze
somehow these tags to show up in the speedbar or in the ECB methods
buffer this outline.
Kind regards.
--
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)