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: Using the same custom file in two different OSes Date: Mon, 14 Jan 2013 11:13:25 -0800 Message-ID: <3F565B0F873C4BCCAA938FB0B136521E@us.oracle.com> References: <419D9CDD3C2740E3B0E0CDE556F7BD12@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1358190841 1718 80.91.229.3 (14 Jan 2013 19:14:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Jan 2013 19:14:01 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "'Dani Moncayo'" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 14 20:14:19 2013 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 1TupU9-0006PT-PR for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Jan 2013 20:14:17 +0100 Original-Received: from localhost ([::1]:54007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TupTt-0006cD-F0 for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Jan 2013 14:14:01 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TupTU-0005kt-GC for help-gnu-emacs@gnu.org; Mon, 14 Jan 2013 14:13:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TupTO-0004X9-4L for help-gnu-emacs@gnu.org; Mon, 14 Jan 2013 14:13:36 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:39730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TupTN-0004Wt-US for help-gnu-emacs@gnu.org; Mon, 14 Jan 2013 14:13:30 -0500 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id r0EJDQg1020462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Jan 2013 19:13:27 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r0EJDQnm012745 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Jan 2013 19:13:26 GMT Original-Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r0EJDQXh022790; Mon, 14 Jan 2013 13:13:26 -0600 Original-Received: from dradamslap1 (/130.35.178.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 14 Jan 2013 11:13:26 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac3yh2c6NrbdVAz4Rv+p+lqN7vkxtAAAImpQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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:88614 Archived-At: > That works, but I've observed that each time I save any customization, > my custom file is regenerated with _all_ the customization loaded at > that time, and the platform-specific stuff that I removed from my > custom file is then reinserted. That should not happen. If that is the case then it is likely because your custom file was restored to its original state after the session where you modified it. Try modifying it in a separate session - even an emacs -Q session. Check your custom file after you have quit the Emacs session where you modified it. You need to have it be as you wanted it: without the stuff you removed. You might need to fiddle a bit, to ensure that. Once that is the case, the stuff you removed will never be added again. > Therefore, in my init file I must put the platform-specific customization > _after_ the loading of the custom file: > > (setq custom-file "my-custom-file.el") > (load custom-file) > (if (eq system-type 'windows-nt) > (custom-set-faces ) > (custom-set-faces ) That's OK, but you should not need that workaround. See above. > Thank you so much for your help. You're welcome. Keeping Customize stuff relegated to a separate file (`custom-file') is something that I think everyone should consider doing. It's asking for trouble to mix code that you write with code that is automatically written by Customize. After separating out the Customize stuff, the question arises as when to load `custom-file' in one's init file. Often it is appropriate to load it at or near the end, but it really depends on the libraries that your init file loads. For instance, I load Icicles at the very end, just after loading `custom-file', so that Icicles picks up certain option values and current key definitions.