From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: Specifying mode in file variables trouble Date: Thu, 25 Sep 2008 13:46:01 -0400 Message-ID: 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> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1222365072 20255 80.91.229.12 (25 Sep 2008 17:51:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2008 17:51:12 +0000 (UTC) Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: "Lennart Borgman (gmail)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 25 19:52:07 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 1Kiv0N-0004bM-A3 for ged-emacs-devel@m.gmane.org; Thu, 25 Sep 2008 19:51:55 +0200 Original-Received: from localhost ([127.0.0.1]:49533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiuzL-00035k-8t for ged-emacs-devel@m.gmane.org; Thu, 25 Sep 2008 13:50:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kiuwj-00026I-4S for emacs-devel@gnu.org; Thu, 25 Sep 2008 13:48:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kiuwi-000266-H4 for emacs-devel@gnu.org; Thu, 25 Sep 2008 13:48:08 -0400 Original-Received: from [199.232.76.173] (port=55512 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kiuwi-000263-Dv for emacs-devel@gnu.org; Thu, 25 Sep 2008 13:48:08 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:45320) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kiuwi-0004Pz-IO for emacs-devel@gnu.org; Thu, 25 Sep 2008 13:48:08 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1Kiuuf-0004MS-HF; Thu, 25 Sep 2008 13:46:01 -0400 In-reply-to: <48DAB149.9060408@gmail.com> (lennart.borgman@gmail.com) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:104152 Archived-At: > If we want all major modes to do something different, we can change > the functions `kill-all-local-variables' and `run-hooks'. Yes, that could be a way, but I think we first have to think about how, when and which buffer local variables should survive moving between chunks with different major modes. Yes, exactly. Before proposing mechanisms, the first step is to look at what the cases are and see what behavior we want. 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. 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. * Any other buffer-local variable should survive through motion between chunks. Can you find any use cases where this would not be right?