From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: find-file-hook as illustration of Custom problems Date: Sat, 05 Feb 2005 12:38:33 -0500 Message-ID: References: <200502040036.j140atb03430@raven.dms.auburn.edu> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1107625638 8240 80.91.229.2 (5 Feb 2005 17:47:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 5 Feb 2005 17:47:18 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 05 18:47:17 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1CxU1Y-0007sd-Nn for ged-emacs-devel@m.gmane.org; Sat, 05 Feb 2005 18:47:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CxUFK-00074b-1U for ged-emacs-devel@m.gmane.org; Sat, 05 Feb 2005 13:01:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CxUEC-0006VI-TG for emacs-devel@gnu.org; Sat, 05 Feb 2005 13:00:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CxUE8-0006SX-6d for emacs-devel@gnu.org; Sat, 05 Feb 2005 13:00:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CxUE8-0006QM-1g for emacs-devel@gnu.org; Sat, 05 Feb 2005 13:00:12 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CxTwE-0007r2-9i for emacs-devel@gnu.org; Sat, 05 Feb 2005 12:41:42 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1CxTtB-0001SP-3a; Sat, 05 Feb 2005 12:38:33 -0500 Original-To: Luc Teirlinck In-reply-to: <200502040036.j140atb03430@raven.dms.auburn.edu> (message from Luc Teirlinck on Thu, 3 Feb 2005 18:36:55 -0600 (CST)) 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:32909 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32909 The problem is that vc-hooks.el contains: (add-hook 'find-file-hook 'vc-find-file-hook) and autorevert.el contains: (add-hook 'find-file-hook (lambda () (set (make-local-variable 'auto-revert-tail-pos) (save-restriction (widen) (1- (point-max)))))) Such code is legitimate, and it would be absurd to call it broken. The hook in vc-hooks.el could be replaced with explicit code inside after-find-file, and that might be an improvement. But we can't do that for other uses of the hook. This is what the hook is meant for. For the case of hooks, we could imagine changing cus-edit.el so that edits made using Custom only affect elements that were installed using Custom. Any other elements could be invisible and untouchable; or they might be displayed in a separate way as "program-added hooks" and untouchable through the usual Custom features. In effect, this means treating a single list as if it were the combination of too list values, one to be edited through Custom and one to be updated by programs. I don't know how hard this would be.