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: Re: custom: how do I augment an option? Date: Wed, 05 Sep 2012 16:45:08 -0400 Message-ID: <87ehmgnqqz.fsf@gnu.org> References: <87zk5473qz.fsf@gnu.org> <87ehmgcm8k.fsf@gnu.org> <92BD2872D2E546BA94A3CAE398693C26@us.oracle.com> Reply-To: sds@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1346878122 31643 80.91.229.3 (5 Sep 2012 20:48:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Sep 2012 20:48:42 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Drew Adams" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 05 22:48:40 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 1T9MWd-0000sa-CD for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Sep 2012 22:48:39 +0200 Original-Received: from localhost ([::1]:51546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9MWa-0002by-G5 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Sep 2012 16:48:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9MTM-0000Vi-Qw for help-gnu-emacs@gnu.org; Wed, 05 Sep 2012 16:45:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9MTL-0003G8-IN for help-gnu-emacs@gnu.org; Wed, 05 Sep 2012 16:45:16 -0400 Original-Received: from mail-pb0-f41.google.com ([209.85.160.41]:43659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9MTJ-0003CE-FN; Wed, 05 Sep 2012 16:45:13 -0400 Original-Received: by pbbro12 with SMTP id ro12so1704635pbb.0 for ; Wed, 05 Sep 2012 13:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:references:user-agent :return-receipt-to:reply-to:x-attribution:x-disclaimer:date :message-id:mime-version:content-type; bh=V40pX1pJ/TQ37rKBkzlFd/o0hsUnBKlVMSNEWplTy0Y=; b=M87/Pz5Aopial46i7c2zHpusFwnR+rBw0mFf4UoC67Zb2Q/rTMafTa+fJHt5DEjyZW Pe2iHI/dfQd/v9pSDZXTj6tZrk35Wq32dUxv5Sa98ieK5mjJeIaEUfyN4lgkThzR0R3Y E4aP/vi1bbu2GWQOIw+lYnlUyZpfuPo+XzF9SAYjcRdZ+EEci0MTKha1+NHIg9ujKIsU +OCWeS4mx6wSpxSnM6p6oHnrOOm7EiP2oMlQg9wdtGfe6XYlPoBkY1c4m7irnKnxERYW 09aT+u3cOjUdCcTXmkVM2iGUzoGy+IHdm/cuVJLIwveo84fcW7meohM6oktE0xb8VBhH MF6g== Original-Received: by 10.66.79.38 with SMTP id g6mr51360691pax.40.1346877912450; Wed, 05 Sep 2012 13:45:12 -0700 (PDT) Original-Received: from t520sds ([74.113.160.197]) by mx.google.com with ESMTPS id qb2sm122146pbb.15.2012.09.05.13.45.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 05 Sep 2012 13:45:11 -0700 (PDT) In-Reply-To: <92BD2872D2E546BA94A3CAE398693C26@us.oracle.com> (Drew Adams's message of "Wed, 5 Sep 2012 13:04:36 -0700") 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. X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.41 X-Mailman-Approved-At: Wed, 05 Sep 2012 16:48:32 -0400 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:86664 Archived-At: > * Drew Adams [2012-09-05 13:04:36 -0700]: > >>> If I want to set a custom variable, I can do >>> >>> (custom-set-variables '(foo 42)) >>> >>> in my .emacs. However, if I want to modify the custom variable, >>> I have to resort to something like >>> >>> (add-hook 'message-load-hook >>> (lambda () >>> (add-to-list 'message-syntax-checks '(long-lines . disabled)))) > > No, you do not have to resort to doing that. > >> The "solution" is >> >> (custom-set-variables >> '(message-syntax-checks >> (adjoin '(long-lines . disabled) >> (eval (car (get 'message-syntax-checks 'standard-value))) >> :test 'equal))) >> >> which uses `eval' on top of `adjoin'. >> So, what is the official method? > > Sorry, but I don't see what the problem is. Why not just use Customize? I don't like the gui; also see below (sneak preview: customize is broken :-). > At the very least you could use Customize to see what it writes out. If you > start with Emacs -Q and add (long-lines . disabled) to the default value then it > writes this: > > '(message-syntax-checks > (quote ((sender . disabled) (long-lines . disabled)))) Hah, but this is wrong! The correct value of message-syntax-checks depends on message-insert-canlock: (get 'message-syntax-checks 'standard-value) ==> ((if message-insert-canlock (quote ((sender . disabled))) nil)) While if I go your way, then message-syntax-checks will not depend on message-insert-canlock! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://openvotingconsortium.org http://ffii.org http://thereligionofpeace.com http://honestreporting.com Beliefs divide, doubts unite.