From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: HELP, PLEASE! Syntax problem! Date: Fri, 27 Nov 2009 10:44:19 +0000 Message-ID: <20091127104419.GB3245@muc.de> References: <20091125125810.GA4734@muc.de> <20091125203039.GA4874@muc.de> <20091125221328.GB4874@muc.de> <87hbsi87pw.fsf@uwakimon.sk.tsukuba.ac.jp> <20091126085334.GA2737@muc.de> <87einl2soe.fsf@uwakimon.sk.tsukuba.ac.jp> <20091127091607.GA3245@muc.de> <87d434qoj1.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1259318496 16550 80.91.229.12 (27 Nov 2009 10:41:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Nov 2009 10:41:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 27 11:41:28 2009 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 1NDyET-0003dx-N4 for ged-emacs-devel@m.gmane.org; Fri, 27 Nov 2009 11:39:21 +0100 Original-Received: from localhost ([127.0.0.1]:40935 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDyET-0007sp-5b for ged-emacs-devel@m.gmane.org; Fri, 27 Nov 2009 05:39:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDyEL-0007ra-F4 for emacs-devel@gnu.org; Fri, 27 Nov 2009 05:39:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDyEE-0007pg-W4 for emacs-devel@gnu.org; Fri, 27 Nov 2009 05:39:11 -0500 Original-Received: from [199.232.76.173] (port=38666 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDyEE-0007pd-Er for emacs-devel@gnu.org; Fri, 27 Nov 2009 05:39:06 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:3495 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NDyED-0004PL-SJ for emacs-devel@gnu.org; Fri, 27 Nov 2009 05:39:06 -0500 Original-Received: (qmail 15371 invoked by uid 3782); 27 Nov 2009 10:39:03 -0000 Original-Received: from acm.muc.de (pD9E500B2.dip.t-dialin.net [217.229.0.178]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 27 Nov 2009 11:39:01 +0100 Original-Received: (qmail 4495 invoked by uid 1000); 27 Nov 2009 10:44:19 -0000 Content-Disposition: inline In-Reply-To: <87d434qoj1.fsf@lola.goethe.zz> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:117865 Archived-At: Morning, David, On Fri, Nov 27, 2009 at 10:56:34AM +0100, David Kastrup wrote: > Alan Mackenzie 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).