From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: does customizing a hook "add-to" the hook? Date: Mon, 15 Jul 2013 02:33:46 +0200 Message-ID: <871u703bmd.fsf@web.de> References: <87wqou6tkw.fsf@nyu.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1373848459 15502 80.91.229.3 (15 Jul 2013 00:34:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Jul 2013 00:34:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 15 02:34:20 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UyWk6-000392-Tw for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Jul 2013 02:34:19 +0200 Original-Received: from localhost ([::1]:35210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyWk6-0007EY-Fe for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Jul 2013 20:34:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyWju-0007DV-GP for help-gnu-emacs@gnu.org; Sun, 14 Jul 2013 20:34:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyWjt-0004iD-Cq for help-gnu-emacs@gnu.org; Sun, 14 Jul 2013 20:34:06 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:33197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyWjt-0004gF-65 for help-gnu-emacs@gnu.org; Sun, 14 Jul 2013 20:34:05 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UyWjr-00030o-48 for help-gnu-emacs@gnu.org; Mon, 15 Jul 2013 02:34:03 +0200 Original-Received: from ip-2-201-153-117.web.vodafone.de ([2.201.153.117]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Jul 2013 02:34:03 +0200 Original-Received: from michael_heerdegen by ip-2-201-153-117.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Jul 2013 02:34:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-2-201-153-117.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:oHxNpq8ZOiSwlyIT8SVuRVLg8OY= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92122 Archived-At: gottlieb@nyu.edu writes: > If I use `customize-option' to customize a (normal) hook, > do the functions I add via pushing the `ins' button get added to > the default value for the hook or do they replace the default? > > I wish to achieve the former (add-to) effect and realize that `add-hook' > does this, but would prefer to use customize if possible. Customizing a hook and restoring the saved value later (maybe in a different session!) happen at different moments of time, so your question is somewhat vague. Here is what I think happens: - When you customize the hook, you see all elements of the hook at that moment. You can delete entries or leave them, or add others. - If you have saved it, this is the value that will be restored later (whereby the current value of the hook at that moment is just discarded, I think) when loading `custom-file'. - But of course, after that, lisp code can still modify that value and add stuff to the hook. This doesn't change the value saved by customize. All relevant hooks I know are empty when declared in the sources. So if you load your `custom-file' early enough when starting up Emacs (i.e., before modifying hooks or loading packages), you don't need to worry about your or third party code adding stuff to the hook, that works normally. Is that what you meant? Regards, Michael.