From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@gmx.net (Kai =?iso-8859-1?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.devel Subject: Re: eval-after-load as a macro (and eval-next-after-load) Date: Tue, 08 Apr 2003 12:21:33 +0200 Organization: University of Duisburg, Germany Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <84vfxps30y.fsf@lucy.is.informatik.uni-duisburg.de> References: <200304042030.h34KUEQL008262@rum.cs.yale.edu> <200304062105.h36L55Jn019873@rum.cs.yale.edu> <84y92mslqe.fsf@lucy.is.informatik.uni-duisburg.de> <84brziwhsi.fsf@lucy.is.informatik.uni-duisburg.de> <5xhe99z2q8.fsf@kfs2.cua.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1049798202 17502 80.91.224.249 (8 Apr 2003 10:36:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2003 10:36:42 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Apr 08 12:36:40 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 192qT2-0004Xp-00 for ; Tue, 08 Apr 2003 12:36:40 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 192qWz-0004A7-00 for ; Tue, 08 Apr 2003 12:40:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192qQW-0001zE-04 for emacs-devel@quimby.gnus.org; Tue, 08 Apr 2003 06:34:04 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 192qJc-0000o4-00 for emacs-devel@gnu.org; Tue, 08 Apr 2003 06:26:56 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 192qHx-0000Ok-00 for emacs-devel@gnu.org; Tue, 08 Apr 2003 06:25:14 -0400 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192qGK-0008S1-00 for emacs-devel@gnu.org; Tue, 08 Apr 2003 06:23:32 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 192qFq-0003me-00 for ; Tue, 08 Apr 2003 12:23:02 +0200 Mail-Followup-To: emacs-devel@gnu.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 192qFp-0003mC-00 for ; Tue, 08 Apr 2003 12:23:01 +0200 Original-Lines: 26 Original-X-Complaints-To: usenet@main.gmane.org Mail-Copies-To: never User-Agent: Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:6Ger8ot/VaTryEGoA2DUvK6KYmc= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13022 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13022 storm@cua.dk (Kim F. Storm) writes: > However, such hooks (e.g. cua-mode-hook) are normally for users to > set, so if a package like crisp modifies it (too), Customize will > report "this variable is set outside custom" -- and saving it will > cause the crisp addition to be saved as well (potentially adding to > the hook a reference to a function which isn't defined on next emacs > startup). > > Doing this via a hook would require having two hooks -- one for emacs > internal use and another for the user... That's right, but it's a general problem. So I think it makes no sense to try to solve it in this specific case only. run-hooks could be extended to run two hooks, a "public" hook and a "private" hook. The arg would be the name of the public hook, and the name of the corresponding private hook could be derived from the name of the public hook. (Running the private hook would be skipped if it doesn't exist.) What do people think? Does one normally use defvar or defcustom to define the hook variables? If so, it might be useful to create a define-hook macro that creates both variables. -- A preposition is not a good thing to end a sentence with.