From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: C Mode: acceleration in brace deserts. Date: Fri, 4 Dec 2009 13:18:25 +0100 Message-ID: References: <20091203162129.GA1942@muc.de> <20091203165937.GB1942@muc.de> <20091203193918.GC1942@muc.de> <20091204115605.GB1456@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1259929150 2217 80.91.229.12 (4 Dec 2009 12:19:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Dec 2009 12:19:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 04 13:19:03 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 1NGX7n-0000oV-6c for ged-emacs-devel@m.gmane.org; Fri, 04 Dec 2009 13:19:03 +0100 Original-Received: from localhost ([127.0.0.1]:60112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGX7m-0005QR-1g for ged-emacs-devel@m.gmane.org; Fri, 04 Dec 2009 07:19:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGX7b-0005QD-HA for emacs-devel@gnu.org; Fri, 04 Dec 2009 07:18:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGX7W-0005Og-D6 for emacs-devel@gnu.org; Fri, 04 Dec 2009 07:18:50 -0500 Original-Received: from [199.232.76.173] (port=44729 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGX7W-0005Oa-40 for emacs-devel@gnu.org; Fri, 04 Dec 2009 07:18:46 -0500 Original-Received: from mail-yw0-f196.google.com ([209.85.211.196]:44931) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGX7V-00006a-VS for emacs-devel@gnu.org; Fri, 04 Dec 2009 07:18:46 -0500 Original-Received: by ywh34 with SMTP id 34so2167540ywh.1 for ; Fri, 04 Dec 2009 04:18:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=hvkeV+uIA+SDRppBPY5O47YLYZ9Qy7mEWMY9g+AzV4Q=; b=klEmh3zDapOdcV27raj9kjTdSBEYp/ej5cTTnRzdNjL2WknOwfSQNjLDXI6vF3WBJm Q8MMsCoJyg3S5pNsxVhjY9My4hZFc/JKScOMGTgLKe9k+YHVHawA7oUTHtv5l0rbLlXu Lgt6TBMwYOTtswAIkKMTsQBWGp3zi2LKSM7jY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=MFQS9seXJoxpuPZ08P9WRgVT5F1+LV5gYkAsJc+vRSyytX5MMOWDPMefzFhr1GJjMR /bqF+zM9ZFZBQPd+NLTwm5iaC1RPIXaPCX5MSsl4MfrpEDclnxl7m0q7hymgblFYSsEd acRkN2sCAjt8yt2Z49L5APDkeZwg35E4nx7Fc= Original-Received: by 10.100.235.38 with SMTP id i38mr3550159anh.51.1259929125108; Fri, 04 Dec 2009 04:18:45 -0800 (PST) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:118251 Archived-At: On Fri, Dec 4, 2009 at 1:03 PM, Lennart Borgman wrote: > On Fri, Dec 4, 2009 at 12:56 PM, Alan Mackenzie wrote: >> On Fri, Dec 04, 2009 at 12:03:27PM +0100, Lennart Borgman wrote: >>> On Fri, Dec 4, 2009 at 11:34 AM, Lennart Borgman >> >>> Just a question I forgot: Why are you not using syntax-ppss here >>> [keeping track of comments/strings in c-parse-state's supporting >>> functions]? =C2=A0Are you not looking for the same thing (ie inside com= ment >>> or string). >> >> I think at the time I did it, it was just less work to write it from >> scratch. =C2=A0syntax-ppss isn't a well encapsulated system, and it almo= st >> requires its users to read its source code to see exactly what it does. >> Also, c-parse-state (in effect) changes the syntax table in use by >> setting category properties. =C2=A0At the time, I was considering actual= ly >> changing the syntax table (for reasons I'm not entirely clear about any >> more). =C2=A0Does syntax-ppss exist in XEmacs, and if so, since when? = =C2=A0Some of >> syntax-ppss's supporting infrastructure only came into existence after >> syntax-ppss itself. >> >>> If you did it that way then it would already be supported by MuMaMo. >> >> Ah. =C2=A0That sounds like a good reason to change my new code to use >> syntax-ppss. =C2=A0:-( =C2=A0But not before the first pretest release ne= xt week. > > Thanks. ;-) > > Would it be enough to change c-state-literal-at? Perhaps you could > send me a new version of that so I could test it in that case. I could > just defadvice c-state-literal-at. Just to show how little I understand of this: Would this do the c-state-literal-at ob? (defun mumamo-c-state-literal-at (here) ;; If position HERE is inside a literal, return (START . END), the ;; boundaries of the literal (which may be outside the accessible bit of = the ;; buffer). Otherwise, return nil. ;; ;; This function is almost the same as `c-literal-limits'. It differs in ;; that it is a lower level function, and that it rigourously follows the ;; syntax from BOB, whereas `c-literal-limits' uses a "local" safe positi= on. (let* ((is-here (point)) (s (syntax-ppss here)) (ret (when (or (nth 3 s) (nth 4 s)) ; in a string or comment (parse-partial-sexp (point) (point-max) nil ; TARGETDEPTH nil ; STOPBEFORE s ; OLDSTATE 'syntax-table) ; stop at end of litera= l (cons (nth 8 s) (point))))) (goto-char is-here) ret))