From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Replacing custom-set-variables Date: Sat, 13 Sep 2008 17:53:32 -0700 Message-ID: <002d01c91604$4ff4e6e0$0200a8c0@us.oracle.com> References: <002b01c915ee$e3dab210$0200a8c0@us.oracle.com> <48CC5834.3080903@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1221353628 10609 80.91.229.12 (14 Sep 2008 00:53:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Sep 2008 00:53:48 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, 'Mauricio' To: "'Lennart Borgman \(gmail\)'" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 14 02:54:44 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kefsx-0004Vt-KV for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Sep 2008 02:54:43 +0200 Original-Received: from localhost ([127.0.0.1]:54936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kefrx-0007k5-01 for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Sep 2008 20:53:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kefrf-0007jn-OW for help-gnu-emacs@gnu.org; Sat, 13 Sep 2008 20:53:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kefrf-0007jT-7n for help-gnu-emacs@gnu.org; Sat, 13 Sep 2008 20:53:23 -0400 Original-Received: from [199.232.76.173] (port=47442 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kefrf-0007jK-4f for help-gnu-emacs@gnu.org; Sat, 13 Sep 2008 20:53:23 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]:18361) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kefre-00078l-On for help-gnu-emacs@gnu.org; Sat, 13 Sep 2008 20:53:23 -0400 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m8E0rIYK023336; Sat, 13 Sep 2008 18:53:18 -0600 Original-Received: from acsmt703.oracle.com (acsmt703.oracle.com [141.146.40.81]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m8E0rH1Z007136; Sat, 13 Sep 2008 18:53:17 -0600 Original-Received: from dradamslap1 (/24.23.165.218) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 13 Sep 2008 17:53:17 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AckV/6SmY/b0wLkXSCmVlXFFHThqzwAA/NdA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 In-Reply-To: <48CC5834.3080903@gmail.com> X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57547 Archived-At: > >> In .emacs I have a few variables defined using: > >> (custom-set-variables > >> '(var1 val1) > >> '(var2 val2) > >> '(var3 val3)) > >> > >> How can I define those same variables in .emacs > >> without using custom-set-variables? > > > > Typically: > > (setq var1 val1 > > var2 val2 > > var3 val3) > > > > But see also `setq-default'; it might be more appropriate > > for some variables. > > > > As an alternative to not using `custom-set-variables', > > consider having a separate custom file, the value of > > variable `custom-file', and letting Customize > > manage `custom-set-variables' there. That will keep > > Customize out of your init > > file (~/.emacs). See the Emacs manual, node Saving Customizations. > > I think that is much better since setq/setq-default actually does not > work for all custom variables. (See `defcustom' for details.) Yes. And before you replace `custom-set-variables' for any options, read at least the doc strings for those options to see if they specify any special considerations for customizing. And different libraries treat variables differently, so it's also a good idea to read the library's doc or Commentary section. In sum, `custom-set-variables' is probably what you want, even if you might not think so. If you use something else, inform yourself before making the change.