From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Texinfo XML support in Emacs Info browser Date: Sun, 03 Jun 2007 12:59:36 +0300 Organization: JURTA Message-ID: <87odjxmk8n.fsf@jurta.org> References: <87r6ouot6c.fsf@jurta.org> <87vee51imv.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1180865019 1735 80.91.229.12 (3 Jun 2007 10:03:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 3 Jun 2007 10:03:39 +0000 (UTC) Cc: karl@gnu.org, emacs-devel@gnu.org To: ttn@gnuvola.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 03 12:03:37 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Humvx-00007y-Az for ged-emacs-devel@m.gmane.org; Sun, 03 Jun 2007 12:03:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Humvw-0001e6-KT for ged-emacs-devel@m.gmane.org; Sun, 03 Jun 2007 06:03:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Humvt-0001ds-Ev for emacs-devel@gnu.org; Sun, 03 Jun 2007 06:03:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Humvr-0001dg-O5 for emacs-devel@gnu.org; Sun, 03 Jun 2007 06:03:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Humvr-0001dd-Ip for emacs-devel@gnu.org; Sun, 03 Jun 2007 06:03:31 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Humvq-0008H8-4t; Sun, 03 Jun 2007 06:03:30 -0400 Original-Received: from schnapps.dreamhost.com (apache2-noxim.schnapps.dreamhost.com [208.113.175.112]) by smarty.dreamhost.com (Postfix) with ESMTP id 49041EE260; Sun, 3 Jun 2007 03:03:29 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by schnapps.dreamhost.com (Postfix) with ESMTP id 4B809A8763; Sun, 3 Jun 2007 03:03:28 -0700 (PDT) In-Reply-To: <87vee51imv.fsf@ambire.localdomain> (Thien-Thi Nguyen's message of "Sun\, 03 Jun 2007 11\:39\:52 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:72108 Archived-At: > () Juri Linkov > () Sun, 03 Jun 2007 02:03:03 +0300 > > [info-xml.el] > > interesting. i had to modify `Info-xml-select-node' like so: > > ;; Add a new unique history item to full history list > (let ((new-history (list Info-current-file Info-current-node))) > (setq Info-history-list > (cons new-history (delete new-history Info-history-list))) > (setq Info-history-forward nil)) Sorry, this part contained function calls for speed optimization of displaying large index nodes. I'll post a separate patch for info.el. > i think ad-hoc regexp-based approach is likely to be troublesome in the long > run. so, question: since we have xml.el, why not build a tree immediately? > one answer is that: well, makeinfo --xml output is not always valid. :-( > > e.g.: makeinfo --xml -o edb.info.xml edb.texi > (xml-parse-file "edb.info.xml") > => error > > (in edb.info.xml, element `detailedmenu' is not properly nested. this is > seen using "makeinfo (GNU texinfo) 4.8".) This is the exact reason why I leaned toward using regexps instead of xml-parse-file. In my first attempt to use xml-parse-file I discovered that `makeinfo --xml' sometimes produces non-wellformed XML, so we can't parse it with xml-parse-file. Even if this will be fixed in the future releases of makeinfo, old versions still produce invalid XML output. With regexp-based approach, the Info browser would be more permissive to invalid XML, in the same way as most HTML browsers are permissive to invalid markup on HTML pages. It can simply ignore invalid elements, either removing them or leaving on display which doesn't make much harm. -- Juri Linkov http://www.jurta.org/emacs/