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:30:31 +0200 (CEST)

Florent Georges wrote:

>       "Returns all the elements in the ancestor axis of the current
>     element.  If called interactively, show it in the echo area."

  As you did see, the command show nothing.  Here is the
corrected version:

    (defun drkm-nxml:ancestor-axis-path (&optional print-message)
      "Return all the elements in the ancestor axis of the current
    element.  If called interactively, show it in the echo area."
      (interactive "p")
      (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)))
        (when print-message
          (message "%s" path))
        path))

  There could be improvement to take other kinds of node into account
(attributes, etc.), to put the path in the kill ring if C-u, etcetera.

  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]