From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Question about set-variable in .emacs Date: Sat, 18 Feb 2006 08:16:59 -0800 Message-ID: References: <200602181547.k1IFlYi02453@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1140296071 23704 80.91.229.2 (18 Feb 2006 20:54:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 18 Feb 2006 20:54:31 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 18 21:54:29 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FAZ63-0004jK-Kk for ged-emacs-devel@m.gmane.org; Sat, 18 Feb 2006 21:54:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FAZ61-0004FM-Kw for ged-emacs-devel@m.gmane.org; Sat, 18 Feb 2006 15:54:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FAUlk-0006up-1W for emacs-devel@gnu.org; Sat, 18 Feb 2006 11:17:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FAUlf-0006sS-SF for emacs-devel@gnu.org; Sat, 18 Feb 2006 11:17:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FAUld-0006r7-Nc for emacs-devel@gnu.org; Sat, 18 Feb 2006 11:17:06 -0500 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1FAUrE-0006jG-Ha for emacs-devel@gnu.org; Sat, 18 Feb 2006 11:22:52 -0500 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by agminet01.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k1IGH35Z003350 for ; Sat, 18 Feb 2006 10:17:03 -0600 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k1IGH2Pt030904 for ; Sat, 18 Feb 2006 09:17:02 -0700 Original-Received: from dradamslap (dhcp-amer-whq-csvpn-gw3-141-144-80-252.vpn.oracle.com [141.144.80.252]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k1IGH1Ro030893 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Sat, 18 Feb 2006 09:17:02 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 In-Reply-To: <200602181547.k1IFlYi02453@raven.dms.auburn.edu> Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:50712 Archived-At: I just had a user who put (setq foo t) in his .emacs. Option foo is defined with a defcustom that limits its possible values to a :choice that does not include t. I wonder what we recommend people to put in their .emacs in such situations - that is, people who choose not to use Customize (at least for that option). If t is an illegal value for foo, I stated that it was: ":choice that does not include t". then the obvious recommendation would be that the user would not set foo to an illegal value. The fact that the user does not get warned would not seem that much of a problem, since people who do not use Custom presumably do not _want_ this type of hand holding. 1) I wouldn't call what I was asking for hand-holding. 2) I don't agree that people who choose an incorrect value (as defined by Custom) via (setq foo bad-value) in their .emacs are necessarily resisting hand-holding. Proof: In the case in question, the person simply made a mistake. Many people still use .emacs for everything, bypassing Custom. They don't all do this always out of conscious preference; some do it sometimes out of habit or ignorance. In this case, the user had the habit of not using Custom and made a mistake wrt the option value. This happens sometimes. Of course we can recommend that people use Custom to avoid this kind of problem (and for other reasons). That is how I responded to this user, for instance. My point is that perhaps we could also recommend that _if_ you choose not to use Custom _then_ it is generally better to use set-variable than setq in .emacs, because it can sometimes catch type errors. Is there a reason not to make such a general recommendation? My guess is that 90% of the people who set options in .emacs do so with setq, and 90% of those settings would be better made with set-variable. Custom and .emacs are both (still) recommended ways of customizing Emacs, if I'm not mistaken. There is probably some doc (guidelines) on writing a .emacs file. Unless there is some reason not to, I suggest that we mention set-variable (vs setq) in that doc section. If t is a legal value and the problem is that Custom claims it is not, then there is a bug in the defcustom. I was clear that t was not valid in this example.