From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dave Abrahams Newsgroups: gmane.emacs.devel Subject: Re: Change `customize-save-variable' to work under "emacs -Q"? Date: Fri, 15 Jul 2011 13:01:21 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1310755116 11546 80.91.229.12 (15 Jul 2011 18:38:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 15 Jul 2011 18:38:36 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 15 20:38:29 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QhnHO-0000Y5-HM for ged-emacs-devel@m.gmane.org; Fri, 15 Jul 2011 20:38:26 +0200 Original-Received: from localhost ([::1]:53286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhnHM-0000u8-Jo for ged-emacs-devel@m.gmane.org; Fri, 15 Jul 2011 14:38:25 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhmbW-0004Ph-5f for emacs-devel@gnu.org; Fri, 15 Jul 2011 13:55:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QhmbU-00027g-3A for emacs-devel@gnu.org; Fri, 15 Jul 2011 13:55:09 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:33121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhmbT-00026H-Dr for emacs-devel@gnu.org; Fri, 15 Jul 2011 13:55:07 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QhmbR-00026S-MT for emacs-devel@gnu.org; Fri, 15 Jul 2011 19:55:05 +0200 Original-Received: from 207-172-223-249.c3-0.smr-ubr3.sbo-smr.ma.static.cable.rcn.com ([207.172.223.249]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Jul 2011 19:55:05 +0200 Original-Received: from dave by 207-172-223-249.c3-0.smr-ubr3.sbo-smr.ma.static.cable.rcn.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Jul 2011 19:55:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 207-172-223-249.c3-0.smr-ubr3.sbo-smr.ma.static.cable.rcn.com User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.3 (darwin) Cancel-Lock: sha1:x+WkbdSuM+fzAyIT/D2o9G2AsmA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142033 Archived-At: on Sun Jul 10 2011, Lars Magne Ingebrigtsen wrote: > If you run "emacs -Q", and you have a piece of code that calls > `customize-save-variable', it will error out, saying that it won't > overwrite the conf. > > Would anybody mind if I changed that function to not error out, but > instead just do a `setq' on the variable in question, if we're running > under -Q? > > Otherwise all the callers end up doing this very awkward thing: > > (if (ignore-errors (custom-file)) > (progn > (customize-save-variable 'smtpmail-smtp-server server) > (customize-save-variable 'smtpmail-smtp-service port)) > (setq smtpmail-smtp-server server > smtpmail-smtp-service port)) My usual workaround for that and related issues is never to run emacs with -Q. Instead I create an empty directory in /tmp and set HOME to point there: HOME=/tmp/test emacs I think that *could* be a much better behavior for emacs -Q even if it means you can't access anything you normally reach via ~. Another option of course would be to populate the test directory with symlinks to make it look more like my home directory, but I actually never needed anything like that. -- Dave Abrahams BoostPro Computing http://www.boostpro.com