[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A better way to factor custom-set-faces (per OS)

From: Peter Dyballa
Subject: Re: A better way to factor custom-set-faces (per OS)
Date: Fri, 28 Jul 2006 11:29:23 +0200

Am 28.07.2006 um 02:12 schrieb Denis Bueno:

My only quibble is that my custom-set-variables form, and not just custom-set-faces, ends up there, too. Is there a compelling reason 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 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))
        ;---    (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- 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 emacs-major-version)) (setq custom-file (format "~/.emacs-Abrichtung-%d.el" emacs-major- version))
                (if (string-match "Aquamacs" mEV)
                        (setq desktop-dirname "~/.emacs.d/PDesktop-Aqua")
                        (setq session-save-file (format "%s/Psession-Aqua" 
                        (setq custom-file "~/.emacs-Abrichtung-AquaMacs.el")
                (if (string-match "Step" mEV) ;; could become the default GNU 
                        (setq desktop-dirname "~/.emacs.d/PDesktop-NS")
                        (setq session-save-file (format "%s/Psession-NS" 
                        (add-hook 'dired-load-hook
                             (lambda ()
                                (load "dired-x")
                                ;; Set dired-x global variables here.   For 
                                ;; (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)
        ;       (setq search-spaces-regexp t)
        ))                                              ;; desktop is read 

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är 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- Abrichtung-20.el -rw-r--r-- 1 pete pete 6243 26 Jun 00:54 .emacs- Abrichtung-21.el -rw-r--r-- 1 pete pete 11362 23 Jul 22:11 .emacs- Abrichtung-22.el -rw-r--r-- 1 pete pete 7422 26 Jul 17:02 .emacs- Abrichtung-23.el -rw-r--r-- 1 pete pete 8913 23 Jul 23:25 .emacs-Abrichtung- 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- 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/ PDesktop-23/.emacs.desktop -rw------- 1 pete pete 457 24 Jul 00:56 .emacs.d/ PDesktop-23/.emacs.desktop-Mac -rw------- 1 pete pete 36923 26 Jul 23:26 .emacs.d/ PDesktop-23/Psession-23 -rw------- 1 pete pete 170 24 Jul 00:56 .emacs.d/ PDesktop-23/Psession-Mac23

I am thinking of putting most of the .emacs files into the .emacs.d directory and of re-organizing the use of desktop and session files. Aquamacs Emacs is a GNU Emacs 22, and, which runs in the NS window-system, is version 23.

For me the 'sorting' in versions is the first key, because there are so many differences particularly in using non-ASCII encodings. Then I add support for the different windowing systems and meanings of key events and modifiers. Finally every Emacs has its own "environment" based on session and desktop.

This design became necessary when Aquamacs Emacs introduced irregular extensions, so that regular Emacsen would not launch. So I moved the working set of customisations and faces into an external file and copied that to supply a starting point for all. My Emacsen use colours (in fringe, modeline, shell prompt) to distinguish them easily. In tcsh I have an alias grepem that greps for the given argument in the set of "customisation" files to see where differences are.



"A designer knows he has arrived at perfection not when there is no longer anything to add, but when there is no longer anything to take away."
                                 -- Antoine de Saint-Exupéry

reply via email to

[Prev in Thread] Current Thread [Next in Thread]