[Top][All Lists]

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

Re: xml-parse-file and text properties

From: Kevin Rodgers
Subject: Re: xml-parse-file and text properties
Date: Fri, 21 Jul 2006 10:13:32 -0600
User-agent: Thunderbird (Windows/20060516)

Richard Stallman wrote:
    ;; Note that {buffer-substring,match-string}-no-properties were
    ;; formerly used in several places, but that removes composition info.

    but neither of us were clear on the meaning of the statement, or why
retaining text properties in any XML parsed data would be desirable.
I think I see why.  Losing the composition info could mean that the
composed characters turn into other sequences of characters.  It
literally would change the text!

This is an ugly problem.  Many things want to get rid of most text
properties, but they don't want to forget about composition.
Logically speaking, composition is really part of the characters in
the text.  Using text properties to encode it is fundamentally

We have been lucky so far, in that this inconsistency has not caused a
lot of problems -- but now our luck is running out.

I can see only two kinds of approaches:

1. Distinguish composition properties from others, and make functions
like buffer-substring-no-properties preserve composition properties,
even as they discard all other properties.

2. Change the representation of composition so it uses something other
than text properties.

#2 would be a big maintenance trouble.  It would take us a long time
to get everything working again after such a change.  We certainly
should not install such a change now, and I hope we won't need to do
it ever.

Can #1 work?

How about extending buffer-substring-no-properties with an optional
KEEP-PROPERTIES argument, a list of text properties to preserve in
the returned string?  Then xml-parse-file could call it with the
list of composition properties (whatever they are).


reply via email to

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