From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: Specifying mode in file variables trouble Date: Thu, 25 Sep 2008 23:34:50 +0200 Message-ID: <48DC03FA.7010509@gmail.com> References: <48D44761.6000809@gmail.com> <87ljxny6n8.fsf@catnip.gol.com> <48D44C79.9020004@gmail.com> <48D63F30.8060102@gmail.com> <48D6E8FB.4070108@gmail.com> <48D79A25.7050000@gmail.com> <48D8BD92.5080403@gmail.com> <48D925EA.3030703@gmail.com> <48D95601.8010703@gmail.com> <48D95FE7.7040807@gmail.com> <48DAB149.9060408@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1222378526 615 80.91.229.12 (25 Sep 2008 21:35:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2008 21:35:26 +0000 (UTC) Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 25 23:36:22 2008 connect(): Connection refused 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 1KiyVT-0000Cy-TU for ged-emacs-devel@m.gmane.org; Thu, 25 Sep 2008 23:36:16 +0200 Original-Received: from localhost ([127.0.0.1]:46936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiyUR-0006pm-9O for ged-emacs-devel@m.gmane.org; Thu, 25 Sep 2008 17:35:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiyUM-0006pR-Cw for emacs-devel@gnu.org; Thu, 25 Sep 2008 17:35:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiyUJ-0006oV-SY for emacs-devel@gnu.org; Thu, 25 Sep 2008 17:35:06 -0400 Original-Received: from [199.232.76.173] (port=54241 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiyUJ-0006oL-Kb for emacs-devel@gnu.org; Thu, 25 Sep 2008 17:35:03 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]:49125) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KiyUF-00086K-Qh; Thu, 25 Sep 2008 17:35:01 -0400 Original-Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:60163 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KiyUD-0007h6-68; Thu, 25 Sep 2008 23:34:58 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-Enigmail-Version: 0.95.7 X-Antivirus: avast! (VPS 080925-0, 2008-09-25), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KiyUD-0007h6-68. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1KiyUD-0007h6-68 e07f3e694d5992ac50713bcd5c542840 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6? (barebone, rare!) 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:104158 Archived-At: Richard M. Stallman wrote: > I have thought about three different > cases: > > - Buffer local variables that should never survive moving between chunks > with different major modes. > > - Those that always should survive (but be killed when switching major > modes when mumamo is not used). > > - Those that will be killed when moving to a chunk with a different > major mode, but will be resurrected when point again reaches a chunk > with the same major mode. (They are what I call "per major mode".) > > I agree that these three behaviors should suffice. (We also want > variables that survive all changes in major mode, and that's what > `permanent-local' does now.) > > Do we need all these behaviors? > > I doubt that the first behavior is needed, except for a few variables > used specially in the implementation of mumamo. Mumamo can easily > implement that behavior for those few variables. Maybe it would be meaningful for a parser that is supporting completion in the chunk? > Can you find any other use cases for which the first behavior is needed? > If not, let's forget it. > > I think the second and third behaviors are both useful. So the next step > is to design conditions under which each one should happen. > > To do that, we need to see the _pattern_ of when each behavior is > desired. So please collect use cases for them. > > Here's a proposal that came to me, suggested by what I know about > use-case patterns. > > * If a variable is bound locally by one of the major modes used within > mumamo, or by the mode hooks it runs, then kill it when moving to a > chunk in another major mode. Do you mean the third case aboove here? I think this is a good idea. This is what I have implemented now in the latest sources (and that I sent here). > * Any other buffer-local variable should survive through motion between > chunks. I am not sure about this one, but I think it would be better to use the third case for these variables too (and that is what I do now) if not their 'permanent-buffer local property is non-nil. > Can you find any use cases where this would not be right? Let say that the user for example want to use another indentation step for a specific chunk type. Then my comment above would perhaps apply. But you may of course say instead that such cases should be handled by adding this to the major mode hook. --- I am a bit worried by this complexity for the users. One way to avoid it would perhaps to introduce the concept of a new "persistent level" between 'permanent-local=t and 'permanent-local=nil. A level that would be like 'permanent-local=t but just for the current buffer. Maybe permanent-local could take the current buffer as a value for this level?