all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: HELP, PLEASE! Syntax problem!
Date: Fri, 27 Nov 2009 10:44:19 +0000	[thread overview]
Message-ID: <20091127104419.GB3245@muc.de> (raw)
In-Reply-To: <87d434qoj1.fsf@lola.goethe.zz>

Morning, David,

On Fri, Nov 27, 2009 at 10:56:34AM +0100, David Kastrup wrote:
> Alan Mackenzie <acm@muc.de> 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.

> >> 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)

Yes, I've underestimated XEmacs.  But that map-extents is still
hopelessly slow by 2(?) orders of magnitude.  I need to "switch off
macros" each time I call `c-parse-state'.  In Emacs, I comment them out
with exactly this form:

   (put 'c-cpp-delimiter 'syntax-table '(14)) ; 14 is "generic comment".

The rogue file I'm making this change for has 4131 #defines in it.
map-extents would be hopeless for this out-commenting.

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

No.  Not for this application.  Typically, `c-parse-state' is called 5
times on a `scroll-down' invocation when the text it's scrolling into
isn't yet fontified.  5 x 4131 = 20656.  You can double that, since these
map-extent change need to be undone at the end of each parse-state.

I'm not even going to bother implementing this for profiling.  I might as
well just check each paren/brace/bracket individually for being inside a
macro, and ignore it when it is.

> 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.

But this one it would do too slowly.

> -- 
> David Kastrup

-- 
Alan Mackenzie (Nuremberg, Germany).




  reply	other threads:[~2009-11-27 10:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 12:58 HELP, PLEASE! Syntax problem! Alan Mackenzie
2009-11-25 14:43 ` Stefan Monnier
2009-11-25 20:30   ` Alan Mackenzie
2009-11-25 21:45     ` Stefan Monnier
2009-11-25 22:13       ` Alan Mackenzie
2009-11-26  0:12         ` Stephen J. Turnbull
2009-11-26  8:53           ` Alan Mackenzie
2009-11-26 15:48             ` Stephen J. Turnbull
2009-11-27  9:16               ` Alan Mackenzie
2009-11-27  9:56                 ` David Kastrup
2009-11-27 10:44                   ` Alan Mackenzie [this message]
2009-11-27  8:16 ` A Soare

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091127104419.GB3245@muc.de \
    --to=acm@muc.de \
    --cc=dak@gnu.org \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.