From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.help Subject: custom: how do I augment an option? Date: Wed, 05 Sep 2012 13:56:20 -0400 Organization: disorganization Message-ID: <87zk5473qz.fsf@gnu.org> Reply-To: sds@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1346867811 29500 80.91.229.3 (5 Sep 2012 17:56:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Sep 2012 17:56:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 05 19:56:53 2012 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 1T9JqN-0000cJ-A2 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Sep 2012 19:56:51 +0200 Original-Received: from localhost ([::1]:41417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9JqK-0001Tl-GZ for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Sep 2012 13:56:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9JqD-0001Pm-3X for help-gnu-emacs@gnu.org; Wed, 05 Sep 2012 13:56:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9Jq9-0007P6-JE for help-gnu-emacs@gnu.org; Wed, 05 Sep 2012 13:56:41 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:41096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Jq9-0007Ou-CH for help-gnu-emacs@gnu.org; Wed, 05 Sep 2012 13:56:37 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1T9Jq7-0000F4-Cs for help-gnu-emacs@gnu.org; Wed, 05 Sep 2012 19:56:35 +0200 Original-Received: from 74.113.160.197 ([74.113.160.197]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Sep 2012 19:56:35 +0200 Original-Received: from sds by 74.113.160.197 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Sep 2012 19:56:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 74.113.160.197 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Cancel-Lock: sha1:/CxFxmJndSVGd/Mj1akJaMVUS1o= 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:86660 Archived-At: If I want to set a custom variable, I can do --8<---------------cut here---------------start------------->8--- (custom-set-variables '(foo 42)) --8<---------------cut here---------------end--------------->8--- in my .emacs. However, if I want to modify the custom variable, I have to resort to something like --8<---------------cut here---------------start------------->8--- (add-hook 'message-load-hook (lambda () (add-to-list 'message-syntax-checks '(long-lines . disabled)))) --8<---------------cut here---------------end--------------->8--- because --8<---------------cut here---------------start------------->8--- (custom-set-variables '(message-syntax-checks (adjoin '(long-lines . disabled) message-syntax-checks :key 'equal))) --8<---------------cut here---------------end--------------->8--- will evaluate `message-syntax-checks' too early: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (void-variable message-syntax-checks) (adjoin (quote (long-lines . disabled)) message-syntax-checks :key (quote equal)) eval((adjoin (quote (long-lines . disabled)) message-syntax-checks :key (quote equal))) custom-initialize-reset(message-syntax-checks (if message-insert-canlock (quote ((sender . disabled))) nil)) custom-declare-variable(message-syntax-checks... byte-code... require(message) byte-code... gnus-msg-mail(nil nil nil nil nil nil nil nil) compose-mail(nil nil nil nil) call-interactively(compose-mail nil nil) --8<---------------cut here---------------end--------------->8--- (it also uses a CL function which emacs purists frown upon). So, how do I use the custom facility to add something to a custom variable? Thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://americancensorship.org http://jihadwatch.org http://iris.org.il http://think-israel.org http://ffii.org Don't use force -- get a bigger hammer.