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: Sat, 5 Dec 2009 03:11:22 +0100 Message-ID: References: <20091203162129.GA1942@muc.de> <20091203165937.GB1942@muc.de> <20091203193918.GC1942@muc.de> <20091204135444.GC1456@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1259979122 11413 80.91.229.12 (5 Dec 2009 02:12:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Dec 2009 02:12:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 05 03:11:55 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 1NGk7n-0002qY-AU for ged-emacs-devel@m.gmane.org; Sat, 05 Dec 2009 03:11:55 +0100 Original-Received: from localhost ([127.0.0.1]:52883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGk7m-0003Dj-2c for ged-emacs-devel@m.gmane.org; Fri, 04 Dec 2009 21:11:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGk7g-0003Cc-9r for emacs-devel@gnu.org; Fri, 04 Dec 2009 21:11:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGk7b-000330-K2 for emacs-devel@gnu.org; Fri, 04 Dec 2009 21:11:47 -0500 Original-Received: from [199.232.76.173] (port=47352 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGk7b-00032Y-7x for emacs-devel@gnu.org; Fri, 04 Dec 2009 21:11:43 -0500 Original-Received: from mail-gx0-f224.google.com ([209.85.217.224]:51542) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGk7b-0003a6-8R for emacs-devel@gnu.org; Fri, 04 Dec 2009 21:11:43 -0500 Original-Received: by gxk24 with SMTP id 24so2377461gxk.6 for ; Fri, 04 Dec 2009 18:11:42 -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; bh=R6XLPJuNz7/IOOwV1YUCtk72CP7jegkrmHgBlT6Y2fA=; b=n/6+aMST7SFP8zNpWE8rCXkLsvEG/Ip6yT33Kada24NOk5pZ/HZxUY87lb03r/Yobk 88eFY2Wlk7tokhiGWkgZqtH4f+XXkH4G8fn4/U3zjJAu1r7+3IMxwZh83bAuwVzCnsP+ bu2DO1gPF6zA795cYRI0hWO4NucsAPKvLyVrc= 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; b=eNETodDla16VUsRNemAoSqC/5eO4ZIoDtDnIRWEuDooarNHwlTpFcOz5FHUxjziXuL ZKYUY5nzp0Pe6NRBbXp5IqoJb+tkRWUPFJ/3oorRvNQj7QsbKFRwrVSqkv4F34Vf6JXf 913+mtBDrRfY2BV8iOVgnF6IcteotbqVjUx+w= Original-Received: by 10.101.7.33 with SMTP id k33mr4873926ani.131.1259979102073; Fri, 04 Dec 2009 18:11:42 -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:118284 Archived-At: Hi Alan, >> Is there a set of guidelines anywhere as to how to make a mode >> MuMaMoable? > > > For parsers: No. Since we do not have the low level routines now here is an idea to get things working now: - Maybe use syntax-ppss. It will cache the information and MuMaMo has support for making this per chunk + major mode. This is needed instead of directly calling (parse-partial-sexp 0 to). - Instead of just calling (widen) call a function hold in a variable. The inital value for this should of course be the function symbol 'widen. This will allow MuMaMo to restrict (widen) to just the current mumamo chunk and that is probably what you want when parsing. That function will then narrow the buffer instead of widening it most of the time. You could then use it to get the boundaries for the mumamo chunk at point to if you want to. But maybe that restricted (widen) is not sufficient? Maybe you have to somehow jump back to the previous mumamo chunk with your major mode? How would you want to do that in that case? (I suggest just another variable holding a function that will give you the end point of the prev mumamo chunk or nil if there is none. This should variable should of course be nil by default.)