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: Wed, 24 Sep 2008 23:21:04 +0200 Message-ID: <48DAAF40.9030704@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> <48D950F9.6030401@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 1222291349 5166 80.91.229.12 (24 Sep 2008 21:22:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Sep 2008 21:22:29 +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 Wed Sep 24 23:23:26 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 1KiboW-0000sZ-Gm for ged-emacs-devel@m.gmane.org; Wed, 24 Sep 2008 23:22:24 +0200 Original-Received: from localhost ([127.0.0.1]:36238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KibnU-0007Jp-5r for ged-emacs-devel@m.gmane.org; Wed, 24 Sep 2008 17:21:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KibnP-0007Ja-KC for emacs-devel@gnu.org; Wed, 24 Sep 2008 17:21:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KibnO-0007JO-2P for emacs-devel@gnu.org; Wed, 24 Sep 2008 17:21:15 -0400 Original-Received: from [199.232.76.173] (port=53113 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KibnO-0007JL-0D for emacs-devel@gnu.org; Wed, 24 Sep 2008 17:21:14 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]:60514) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KibnM-0002FJ-4M; Wed, 24 Sep 2008 17:21:12 -0400 Original-Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:63847 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KibnK-0005nv-4e; Wed, 24 Sep 2008 23:21:10 +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 080924-0, 2008-09-24), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KibnK-0005nv-4e. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1KibnK-0005nv-4e 6b5972b839ae22d6de9fc5e3891257c4 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:104122 Archived-At: Richard M. Stallman wrote: > There are three main scopes (maybe there are more) for minor modes: > > - Global > - Per buffer > > I think I know what those two mean. > > - Per major mode > > What does that mean? I don't know of that. I mean minor modes that are used with specific major modes. Or any minor mode that is turned on in a major mode hook. > Global minor modes are not a problem here. > > Usually they are not; but if a minor mode is itself global, > you can make a buffer-local binding for the variable. > > Perhaps when you speak of "global" and "per buffer" > you mean how the variable is bound, rather than how the mode > normally works. In this case, yes. > I have suggested long ago using the existing mechanism for > distinguishing between local variables that are per buffer and those > that are per major mode. > > I don't understand that distinction, but I know that just about any > variable in Emacs _can_ be given a buffer-local binding by a major > mode command. So is the distinction meaningful? I think so. For example flymake works on the file regardless of the major mode. If mumamo is used in the buffer then flymake should still work on the file - which is in a sense the same as the whole buffer here. > In other words: the minor modes that are per > buffer should use > > (put 'PER-BUFFER-VARIABLE 'permanent-local t) > > on their buffer local variables. (I do that now in mumamo.el for some of > the most important.) > > I am not sure that change is correct. When the variable is not marked > as permanent-local, that could mean we want major mode commands to > reset this minor mode. Of course, moving between chunks in mumamo > should not reset it. For cases like flymake we know that the minor mode is per buffer/file. I think that will be true for many parsers (but we will have to help them over "bad" chunks, ie chunks they do not expect to see). The same is also true for emulators like viper. For the cases above I think using (put 'PER-BUF-VAR 'permanent-local t) is the right thing. In other cases we can't do even if we want the minor modes (buffer local variables) to survive when point is moved to a new chunk. For that case I have implemented mumamo-survive, a list of variable symbols that should survive when moving between chunks. Of course that is a rather rough approximation. To refine it a bit I have now also added save/restore of buffer local variables per major modes (see earlier messages in this thread). > Can you tell us some of the variables for which you added that property? > > Perhaps we want to have a different value for the `permanent-local' property > that applies only to mumamo. Yes, perhaps. I think however we should first consider the structures above and see if they are enough. (Then we can maybe implement them using specific properties instead.)