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 16:24:56 +0100 Message-ID: <475C08C8.4090003@gmail.com> References: <475439BD.7070000@gmail.com> <475598CF.4050200@gmail.com> <47565186.8080909@gmail.com> <4758930F.4060308@gmail.com> <475BF9FC.4050705@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 1197213943 31134 80.91.229.12 (9 Dec 2007 15:25:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2007 15:25:43 +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 16:25:53 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 1J1O2I-0002ul-8p for ged-emacs-devel@m.gmane.org; Sun, 09 Dec 2007 16:25:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1O20-0005Ba-NS for ged-emacs-devel@m.gmane.org; Sun, 09 Dec 2007 10:25:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1O1w-0005Al-FN for emacs-devel@gnu.org; Sun, 09 Dec 2007 10:25:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1O1u-00059a-LN for emacs-devel@gnu.org; Sun, 09 Dec 2007 10:25:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1O1u-00059S-Dk for emacs-devel@gnu.org; Sun, 09 Dec 2007 10:25:18 -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 1J1O1p-00015k-FC; Sun, 09 Dec 2007 10:25:13 -0500 Original-Received: from c83-254-148-228.bredband.comhem.se ([83.254.148.228]:59541 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1J1O1m-00005k-4d; Sun, 09 Dec 2007 16:25:10 +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: <475BF9FC.4050705@gmail.com> 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 1J1O1m-00005k-4d. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1J1O1m-00005k-4d 560861ae01745dcbba17f70a2708ad16 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:84922 Archived-At: Lennart Borgman (gmail) wrote: > 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.) (when (and local (and (symbolp function)) (get function 'permanent-local-in-hooks)) (put hook 'permanent-local-hook t)