From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Dyballa Newsgroups: gmane.emacs.help Subject: Re: A better way to factor custom-set-faces (per OS) Date: Fri, 28 Jul 2006 11:29:23 +0200 Message-ID: <32C21DCC-B9F1-4EC6-A284-9709EC6338CF@Web.DE> References: <200607251857.55711.sidgmanj1@unlnotes.unl.edu> <44c91426$0$15781$14726298@news.sunsite.dk> <44C95660.3040102@gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1154078991 26541 80.91.229.2 (28 Jul 2006 09:29:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Jul 2006 09:29:51 +0000 (UTC) Cc: emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 28 11:29:47 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G6OfB-000548-UL for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jul 2006 11:29:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G6Of9-0003HL-Fb for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jul 2006 05:29:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G6Oev-0003Go-Tz for help-gnu-emacs@gnu.org; Fri, 28 Jul 2006 05:29:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G6Oev-0003GJ-4A for help-gnu-emacs@gnu.org; Fri, 28 Jul 2006 05:29:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G6Oev-0003GG-0V for help-gnu-emacs@gnu.org; Fri, 28 Jul 2006 05:29:29 -0400 Original-Received: from [217.72.192.221] (helo=fmmailgate01.web.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G6Ogs-0006Sq-1V for help-gnu-emacs@gnu.org; Fri, 28 Jul 2006 05:31:30 -0400 Original-Received: from smtp06.web.de (fmsmtp06.dlan.cinetic.de [172.20.5.172]) by fmmailgate01.web.de (Postfix) with ESMTP id D853ABA1D73; Fri, 28 Jul 2006 11:29:26 +0200 (CEST) Original-Received: from [84.245.175.244] (helo=[192.168.1.2]) by smtp06.web.de with asmtp (TLSv1:RC4-SHA:128) (WEB.DE 4.107 #114) id 1G6Oer-0007WL-00; Fri, 28 Jul 2006 11:29:25 +0200 In-Reply-To: <44C95660.3040102@gmail.com> X-Image-Url: http://homepage.mac.com/sparifankal/.cv/thumbs/me.thumbnail Original-To: Denis Bueno X-Mailer: Apple Mail (2.752.2) X-Sender: Peter_Dyballa@web.de 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:36326 Archived-At: Am 28.07.2006 um 02:12 schrieb Denis Bueno: > My only quibble is that my custom-set-variables form, and not just =20 > custom-set-faces, ends up there, too. Is there a compelling reason =20 > that it should be OS-specific? No, I don't think so. I am living with a few Emacsen on Mac OS X, versions 20...23, and a =20 few window-systems. So I start with: (defconst mEV (emacs-version) "Keep the Emacs version string, that is needed a few times.") (defconst mWS (symbol-value 'window-system) "Running as some windowing system's client, or as slave of a terminal emulator?") and become serious here: (if (not (string-match "XEmacs" mEV)) (if (not (string-match "21.2" mEV)) (progn ;--- (desktop-load-default) (setq history-length 250) (setq desktop-globals-to-save = '(desktop-missing-file-warning)) (setq desktop-dirname (format "~/.emacs.d/PDesktop-%d" = emacs-major-=20 version)) (desktop-save-mode 1) (require 'session) (add-hook 'after-init-hook 'session-initialize) (setq session-save-file-coding-system 'utf-8-unix) (setq session-save-file (format "%s/Psession-%d" = desktop-dirname =20 emacs-major-version)) (setq custom-file (format "~/.emacs-Abrichtung-%d.el" = emacs-major-=20 version)) (if (string-match "Aquamacs" mEV) (progn (setq desktop-dirname = "~/.emacs.d/PDesktop-Aqua") (setq session-save-file (format = "%s/Psession-Aqua" desktop-dirname)) (setq custom-file = "~/.emacs-Abrichtung-AquaMacs.el") )) (if (string-match "Step" mEV) ;; could become the = default GNU Emacs (progn (setq desktop-dirname "~/.emacs.d/PDesktop-NS") (setq session-save-file (format "%s/Psession-NS" = desktop-dirname)) (add-hook 'dired-load-hook (lambda () (load "dired-x") ;; Set dired-x global variables here. = For example: ;; (setq dired-guess-shell-gnutar = "gtar") (setq dired-x-hands-off-my-keys nil) )) (add-hook 'dired-mode-hook (lambda () ;; Set dired-x buffer-local variables = here. For example: (setq dired-omit-files-p t) )) )) (setq desktop-path (list desktop-dirname)) ; (desktop-change-dir desktop-dirname) ; (desktop-read desktop-dirname) (load custom-file) = ;;<<<< (load (format "~/.emacs_%s" mWS)) = ;;<<<< ; (add-hook 'write-file-hooks 'time-stamp) (add-hook 'before-save-hook 'time-stamp) (setq search-whitespace-regexp nil) (desktop-lazy-complete) ; (setq search-spaces-regexp t) ) )) ;; desktop is = read automatically So I have now: -rw-r--r-- 1 pete pete 21464 26 Jul 14:54 .emacs -rw-r--r-- 1 pete pete 175 19 Mai 2005 .emacs_shell -rw-r--r-- 1 pete pete 27 8 M=E4r 13:52 .emacs_tcsh -rw-r--r-- 1 pete pete 211 18 Nov 2005 .emacs_bash -rw-r--r-- 1 pete pete 4988 25 Jun 16:54 .emacs-=20 Abrichtung-20.el -rw-r--r-- 1 pete pete 6243 26 Jun 00:54 .emacs-=20 Abrichtung-21.el -rw-r--r-- 1 pete pete 11362 23 Jul 22:11 .emacs-=20 Abrichtung-22.el -rw-r--r-- 1 pete pete 7422 26 Jul 17:02 .emacs-=20 Abrichtung-23.el -rw-r--r-- 1 pete pete 8913 23 Jul 23:25 .emacs-Abrichtung-=20 AquaMacs.el -rw-r--r-- 2 pete pete 22656 24 Jul 00:53 .emacs_mac -rw-r--r-- 1 pete pete 1939 8 Apr 12:45 .emacs_nil -rw-r--r-- 2 pete pete 6550 23 Jul 21:30 .emacs_ns -rw-r--r-- 2 pete pete 2298 24 Jul 00:02 .emacs_x drwxr-xr-x 2 pete pete 68 25 Jun 16:00 .emacs.d/PDesktop-20 drwxr-xr-x 3 pete pete 102 22 Jul 14:57 .emacs.d/PDesktop-21 drwxr-xr-x 6 pete pete 204 27 Jul 10:37 .emacs.d/PDesktop-22 drwxr-xr-x 6 pete pete 204 26 Jul 23:26 .emacs.d/PDesktop-23 drwxr-xr-x 4 pete pete 136 23 Jul 23:07 .emacs.d/PDesktop-=20 Aqua drwxr-xr-x 5 pete pete 170 25 Jul 13:04 .emacs.d/PDesktop-NS -rw------- 1 pete pete 6277 26 Jul 23:26 .emacs.d/=20 PDesktop-23/.emacs.desktop -rw------- 1 pete pete 457 24 Jul 00:56 .emacs.d/=20 PDesktop-23/.emacs.desktop-Mac -rw------- 1 pete pete 36923 26 Jul 23:26 .emacs.d/=20 PDesktop-23/Psession-23 -rw------- 1 pete pete 170 24 Jul 00:56 .emacs.d/=20 PDesktop-23/Psession-Mac23 I am thinking of putting most of the .emacs files into the .emacs.d =20 directory and of re-organizing the use of desktop and session files. =20 Aquamacs Emacs is a GNU Emacs 22, and Emacs.app, which runs in the NS =20= window-system, is version 23. For me the 'sorting' in versions is the first key, because there are =20 so many differences particularly in using non-ASCII encodings. Then I =20= add support for the different windowing systems and meanings of key =20 events and modifiers. Finally every Emacs has its own "environment" =20 based on session and desktop. This design became necessary when Aquamacs Emacs introduced irregular =20= extensions, so that regular Emacsen would not launch. So I moved the =20 working set of customisations and faces into an external file and =20 copied that to supply a starting point for all. My Emacsen use =20 colours (in fringe, modeline, shell prompt) to distinguish them =20 easily. In tcsh I have an alias grepem that greps for the given =20 argument in the set of "customisation" files to see where differences =20= are. -- Greetings Pete "A designer knows he has arrived at perfection not when there is no =20= longer anything to add, but when there is no longer anything to take =20 away." -- Antoine de Saint-Exup=E9ry