help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [emacs-nxml-mode] Re: Command in nxml-mode to show the current place


From: Florent Georges
Subject: RE: [emacs-nxml-mode] Re: Command in nxml-mode to show the current place in the structure (path)?
Date: Thu, 18 May 2006 10:16:53 +0200 (CEST)

Lennart Borgman wrote:

> arndt.jonasson@gmail.com wrote:

  Hi

> > <e>
> >   <a>
> >      <b>
> >       oh
> >      </b>
> >      <c/>
> >      <d>
> >           point is here
> >      </d>
> >   </a>
> > </e>

> > The command in question should show something like /e/a/d

> Maybe you will have more luck asking this on the nxml-mode
> mailing list?

  I took the code of the OP, and did a few changes, then I
have:

    (defun drkm-nxml:ancestor-axis-path ()
      "Returns all the elements in the ancestor axis of the current
    element.  If called interactively, show it in the echo area."
      (interactive)
      (nxml-ensure-scan-up-to-date)
      (let ((path ""))
        (save-excursion
          (condition-case ()
              (while t
                (nxml-backward-up-element)
                (setq path (concat
                            "/" (xmltok-start-tag-qname) path)))
            (error nil)))
        path))

  This seems to work.  But I didn't check all cases nor
functions used.  There is still the problem of the
namespaces.  And the trick with the CONDITION-CASE is not
satisfactory, IMHO.

  But it could be usable in some cases.

  Regards,

--drkm

























        
        
                
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger. Appelez le monde entier 
à partir de 0,012 €/minute ! 
Téléchargez sur http://fr.messenger.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]