emacs-devel
[Top][All Lists]
Advanced

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

Re: HELP, PLEASE! Syntax problem!


From: David Kastrup
Subject: Re: HELP, PLEASE! Syntax problem!
Date: Fri, 27 Nov 2009 10:56:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Alan Mackenzie <address@hidden> writes:

> On Fri, Nov 27, 2009 at 12:48:33AM +0900, Stephen J. Turnbull wrote:
>> Alan Mackenzie writes:
>
>>  > Just as a matter of interest (ha!) Stephen, does XEmacs have an
>>  > equivalent to the 'category text property?
>
>> No.
>
> That's a shame.
>
>> I'm not sure how much farther you can push that kind of thing, but
>> clearly it works for you now.
>
> Well, for one thing, rather than just having the 'category property,
> you could allow any property to be made "categorical".  Then you could
> introduce all sorts of rules as to which "categorical" property
> prevails when several have conflicting settings of a particular
> property. ... ;-)
>
> But, as RMS would undoubtedly say, there doesn't seem to be any need
> for such an "advanced" feature.
>
>> Eventually I guess we'll have to match the Emacs API, but we don't have
>> it now.
>
> It's more than an API: it's a fundamental feature.  Without it, the
> only way to change a text property on ALL characters of some class is
> to scan through the buffer, which would be unacceptably slow for what
> I need to do.
>
> So, yes, please feel free to get it implemented in XEmacs!

You are underestimating XEmacs.  It has a function iterating over all
extents (their equivalent of both overlays and text properties) in a
half-/open/closed range that have a particular set or state of
properties.  So you can say something like "give me all extents for
which the property 'category happens to be 'text".

Something like
(map-extents (lambda (extent) ...) some-flag (point-min)
             (point-max) another-flag and-yet-another 'category 'text)

You'll be brooding two hours over the documentation of this function,
experiment another half an hour, and you are there.

XEmacs calls something "API" comparable to a mathematician calling a
proof "trivial".  Mostly synonymous with "possible".

Just because XEmacs has a single concept and a single work function for
something does not mean that it can't be made to do a hundred things.
You'll be muttering bad things through your teeth whenever you are
reduced to reverting to map-extents.

But it is there.  And it does almost any job.

-- 
David Kastrup





reply via email to

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