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: Feature request: permanent-local values in hooks buffer local values Date: Sun, 09 Dec 2007 15:21:48 +0100 Message-ID: <475BF9FC.4050705@gmail.com> References: <475439BD.7070000@gmail.com> <475598CF.4050200@gmail.com> <47565186.8080909@gmail.com> <4758930F.4060308@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197210151 20639 80.91.229.12 (9 Dec 2007 14:22:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2007 14:22:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 09 15:22:41 2007 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 1J1N3I-0000RC-SO for ged-emacs-devel@m.gmane.org; Sun, 09 Dec 2007 15:22:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1N31-00027r-AB for ged-emacs-devel@m.gmane.org; Sun, 09 Dec 2007 09:22:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1N2g-0001l4-3P for emacs-devel@gnu.org; Sun, 09 Dec 2007 09:22:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1N2d-0001ih-AE for emacs-devel@gnu.org; Sun, 09 Dec 2007 09:22:01 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1N2d-0001iX-2h for emacs-devel@gnu.org; Sun, 09 Dec 2007 09:21:59 -0500 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J1N2Y-0005JQ-VC; Sun, 09 Dec 2007 09:21:55 -0500 Original-Received: from c83-254-148-228.bredband.comhem.se ([83.254.148.228]:60741 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1J1N2W-0000OK-6E; Sun, 09 Dec 2007 15:21:53 +0100 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-Antivirus: avast! (VPS 071208-0, 2007-12-08), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.148.228 X-Scan-Result: No virus found in message 1J1N2W-0000OK-6E. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1J1N2W-0000OK-6E d6a905af996aabb04f072f4f20704df7 X-detected-kernel: by monty-python.gnu.org: 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:84919 Archived-At: Richard Stallman wrote: > Then in `flymake-mode' a call to the functions > `flymake-add-survivor' and `flymake-remove-survivor \(which was defined > by the macro called above) must be done. > > This seems like a very cumbersome interface. I think it is very > unclean to dynamically change `permanent-local' properties. That's > the sort of thing that we are sure to regret. > > We should use my mechanism instead. It is simple and clean. That is very fine with me. I suggest then adding something like this to the end of add-hook: (when (and local (get function 'permanent-local-in-hooks)) (put hook 'permanent-local-hook t) Then in kill-local-variables check for the property 'permanent-local-hook and handle the hook accordingly. I can see no reasonable way to remove the property 'permanent-local-hook from the hook variable. (The problem is that properties do not have buffer local values. It could be simulated by having a buffer local variable carrying the propery, but I see no reason to make it that complicated.)