From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: xml-parse-file and text properties
Date: Fri, 21 Jul 2006 16:22:22 -0400 [thread overview]
Message-ID: <jwv1wse1zje.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <pan.2006.07.21.17.34.25.210891@as.arizona.edu> (JD Smith's message of "Fri, 21 Jul 2006 10:34:25 -0700")
>>> xml-parse-file now includes text properties in its returned list, ala:
>>
>>> ((name . #("WV_APPLET" 0 9 (fontified nil))) (link . #("WV_APPLET.html"
>>> 0 14 (fontified nil))))
>>
>>> when global-font-lock-mode is on, whereas before it did not. Was this
>>> intended? Any way to temporarily avoid fontification on loaded buffers
>>> (aside from turning global-font-lock-mode off prior to xml-parse-file)?
>>
>> Could you explain why the text properties cause problems?
> I'm parsing a very large XML file (a document link and calling syntax
> catalog for IDLWAVE), trimming it and making slight modifications, and
> then writing it out to file as a big set of sexp's for later recovery,
> primarily for reasons of speed. This file is read whenever IDLWAVE
> mode is first entered.
> With text properties (amounting simply to #(" " 0 5 (fontified nil))'
> constructs), the file is almost three times as large, erasing much of
> the speed advantage of translating to a LISP form in the first place.
> I use `prin1' to write the lists. I suppose I could spin through the
> list first and remove any text properties on strings, but it seems
> silly that parsing an XML file never loaded into an active buffer
> should be laden with inert properties like '(fontified nil). If there
> were a simple way to prevent that (other than turning global-font-lock
> off), that would suffice for my purposes, though not of course address the
> larger issue of text properties in XML parsed lists in general.
Clearly, in the case of xml-parse-file, I see no reason why we shouldn't
strip all properties. After all, it's supposed to parse the *file*, not the
buffer, and files don't have those text properties.
The argument that we need to preserve the `composition' property doesn't
seem valid: this property can be computed from the sequence of chars.
Stefan
next prev parent reply other threads:[~2006-07-21 20:22 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-18 21:35 xml-parse-file and text properties JD Smith
2006-07-20 21:46 ` Richard Stallman
2006-07-20 22:11 ` JD Smith
2006-07-21 4:46 ` Richard Stallman
2006-07-21 6:35 ` Kenichi Handa
2006-07-21 7:24 ` Eli Zaretskii
2006-07-21 8:14 ` Kenichi Handa
2006-07-22 4:39 ` Richard Stallman
2006-07-21 16:13 ` Kevin Rodgers
2006-07-21 23:33 ` Kevin Rodgers
2006-07-20 21:46 ` Richard Stallman
2006-07-20 22:40 ` JD Smith
2006-07-21 12:55 ` Stefan Monnier
2006-07-21 17:34 ` JD Smith
2006-07-21 20:22 ` Stefan Monnier [this message]
2006-07-21 21:50 ` JD Smith
2006-07-22 15:49 ` Richard Stallman
2006-07-24 1:51 ` Kenichi Handa
2006-07-24 3:17 ` Stefan Monnier
2006-07-24 4:36 ` Kenichi Handa
2006-07-24 18:22 ` Richard Stallman
2006-07-24 20:38 ` Stuart D. Herring
2006-07-25 3:09 ` Richard Stallman
2006-07-25 14:00 ` Stefan Monnier
2006-07-25 22:15 ` Richard Stallman
2006-07-24 20:51 ` Stefan Monnier
2006-07-25 3:09 ` Richard Stallman
2006-07-21 20:52 ` Thien-Thi Nguyen
2006-07-21 21:45 ` JD Smith
2006-07-22 9:15 ` Eli Zaretskii
2006-07-24 16:44 ` JD Smith
2006-07-25 16:05 ` JD Smith
2006-07-25 16:27 ` Stefan Monnier
2006-07-25 19:16 ` JD Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv1wse1zje.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).