From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Florent Georges Newsgroups: gmane.emacs.nxml.general,gmane.emacs.help Subject: RE: Re: Command in nxml-mode to show the current place in the structure (path)? Date: Thu, 18 May 2006 10:30:31 +0200 (CEST) Message-ID: <20060518083031.93305.qmail@web25801.mail.ukl.yahoo.com> References: <20060518081653.68924.qmail@web25810.mail.ukl.yahoo.com> Reply-To: emacs-nxml-mode@yahoogroups.com NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1147941254 4936 80.91.229.2 (18 May 2006 08:34:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 May 2006 08:34:14 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: sentto-10952198-1346-1147941243-geng-emacs-nxml-mode=m.gmane.org@returns.groups.yahoo.com Thu May 18 10:34:12 2006 Return-path: Envelope-to: geng-emacs-nxml-mode@m.gmane.org Original-Received: from n27.bullet.scd.yahoo.com ([66.94.237.56]) by ciao.gmane.org with smtp (Exim 4.43) id 1FgdxR-0007vy-DI for geng-emacs-nxml-mode@m.gmane.org; Thu, 18 May 2006 10:34:09 +0200 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lima; d=yahoogroups.com; b=bhQn0wOqvNBPxeTagcEszJYMUDaGB29zCZ0n4uGpjvx7cH+gq31A4MvHZHnsHFNJj36nhuwrlpcjQUJsp+lGrnpnc2JnY+txypedDsWVv10MVIr1ULDQk1s5YeAM1eRK; Original-Received: from [66.218.69.5] by n27.bullet.scd.yahoo.com with NNFMP; 18 May 2006 08:34:06 -0000 Original-Received: from [66.218.66.93] by t5.bullet.scd.yahoo.com with NNFMP; 18 May 2006 08:34:06 -0000 X-Yahoo-Newman-Property: groups-email X-Yahoo-Newman-Id: 10952198-m1346 X-Sender: darkman_spam@yahoo.fr X-Apparently-To: emacs-nxml-mode@yahoogroups.com Original-Received: (qmail 44989 invoked from network); 18 May 2006 08:30:33 -0000 Original-Received: from unknown (66.218.67.36) by m33.grp.scd.yahoo.com with QMQP; 18 May 2006 08:30:33 -0000 Original-Received: from unknown (HELO web25801.mail.ukl.yahoo.com) (217.12.10.186) by mta10.grp.scd.yahoo.com with SMTP; 18 May 2006 08:30:33 -0000 Original-Received: (qmail 93307 invoked by uid 60001); 18 May 2006 08:30:31 -0000 Original-Received: from [193.178.209.194] by web25801.mail.ukl.yahoo.com via HTTP; Thu, 18 May 2006 10:30:31 CEST Original-To: emacs-nxml-mode@yahoogroups.com, arndt.jonasson@gmail.com In-Reply-To: <20060518081653.68924.qmail@web25810.mail.ukl.yahoo.com> X-Originating-IP: 217.12.10.186 X-eGroups-Msg-Info: 1:12:0:0 X-Yahoo-Profile: darkman_spam Original-Sender: emacs-nxml-mode@yahoogroups.com Mailing-List: list emacs-nxml-mode@yahoogroups.com; contact emacs-nxml-mode-owner@yahoogroups.com List-Id: Precedence: bulk List-Unsubscribe: Xref: news.gmane.org gmane.emacs.nxml.general:1233 gmane.emacs.help:35130 Archived-At: 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 ------------------------ Yahoo! Groups Sponsor --------------------~--> Home is just a click away.  Make Yahoo! your home page now. http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/2U_rlB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/emacs-nxml-mode/ <*> To unsubscribe from this group, send an email to: emacs-nxml-mode-unsubscribe@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/