[Top][All Lists]

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

Re: [Orgmode] Re: R: WISH: separate org-mode customization file

From: Tim O'Callaghan
Subject: Re: [Orgmode] Re: R: WISH: separate org-mode customization file
Date: Thu, 3 Jul 2008 00:14:44 +0200

Its usable. In fact i'm still using it. I had forgotten i had posted
it into the emacswiki.

Here is my approach. The first thing to do is to consodate your emacs
directories into one place.

my .emacs contains this one instruction:
(load (expand-file-name (concat "~/.emacsen_d/init")))

On linux/unix ~/ is obvious. On Windows (x)emacs interprets the
environmental variable %HOME% as ~.
You can set this under Settings->Control
Panel->System->Advanced(tab)->Environmental Variables (Button)
In the user variables i have HOME set to C:\home\tim.

This load instruction then loads "c:\home\tim\.emacsen_d\init.el" under windows.

It should be noted that cygwin also uses this variable to find your
home directory, so you can have a windows and linux .bashrc too, but
that is another topic.

I use xemacs and emacs, on windows and linux, so my config files can
be a bit crowded. here is a cut down version of the init.el loaded

----- my cut down emacs config -----

;; catch any initial errors
(setq debug-on-error t)

;; do not offer migration to xemacs
(custom-set-variables '(load-home-init-file t t))

;;;;;;;;;;;;;;;;;;;; set globals, and load init util functions

;; to ensure customsation is in one place
(setq custom-file "~/.emacsen_d/custom.el")
;;(load custom-file)

;; default (x)emacs main directory
(defconst toc:emacsen-dir "~/.emacsen_d/" "Path to init.el directory")
(setq user-emacs-directory toc:emacsen-dir)

;; default (x)emacs configuration directory
(defconst toc:emacsen-config-dir "~/.emacsen_d/configs/"
  "Path to emacsen configuration fragments")

;; default machine (x)emacs configuration directory
(defconst toc:emacsen-machine-config-dir
  "Path to emacsen machine specific configuration fragments")

;; default (x)emacs site lisp directory
(defconst toc:emacsen-site-lisp-dir "~/.emacsen_d/site-lisp/" "Path to
emacsen lisp includes")

;; load named+saved keyboard macros
(load (expand-file-name (concat toc:emacsen-dir "toc-macros")))
;; load elisp utility functions
(load (expand-file-name (concat toc:emacsen-dir "toc-util-fns")))
;; snipped from toc-util-fns for context
;; utility finction to auto-load my package configurations
(defun toc:load-config-file (filelist)
  (dolist (file filelist)
    (load (expand-file-name
           (concat toc:emacsen-config-dir file)))
     (message "Loaded config file:%s" file)

;; utility finction to auto-load my package configurations
(defun toc:load-machine-config-file nil
  (setq machine-file (expand-file-name
                      (concat toc:emacsen-machine-config-dir (getenv
"COMPUTERNAME") ".el")))
  (cond ((file-exists-p machine-file)
         (load machine-file)
         (message "Loaded config file:%s" file)))

;;;;;;;;;;;;;;;;;;;; personal usibility customisations   ;;;;;;;;;;;;;;;;;;;;;;;
;; set up initial load path
(toc:add-to-load-path '(""))

;; startup at home
(progn (cd "~"))

;; make the y or n suffice for a yes or no question
(fset 'yes-or-no-p 'y-or-n-p)

;; setting the defualt tab expansion size
(setq default-tab-width 8)

;; ensure that all tabs are created as spaces.
(setq-default indent-tabs-mode nil)

;; loose the startup message
(setq inhibit-startup-message t)

;; ensure messages are kept
(setq message-log-max t)

;; So I always have the proper number of parenthesis
(cond ((featurep 'xemacs)
       (paren-set-mode 'paren))
      ((featurep 'emacs)
       (show-paren-mode 1)))

;; So gnuserv works
(cond ((featurep 'emacs)

;; allow multiple minibuffers
(setq minibuffer-max-depth nil)

;; So we can see pound signs ok
(if (featurep 'xemacs)
    (standard-display-european t))
(if (featurep 'emacs)
    (prefer-coding-system 'utf-8))

;; highlighting regions and delete.

(if (featurep 'xemacs)
    (setq zmacs-regions t)
  (transient-mark-mode 1))

;; set the colors and frame properties
(toc:load-config-file '("frames_config"

;; set any platform/(x)emacs specific properties
;; such as executbale paths, env variables and
;; info paths
 ((eq system-type 'windows-nt)
  (toc:load-config-file '("win2k_config"))
 ;; otherwise try for maximum screenage
  (toc:load-config-file '("linux_config"))

;; load my configuration defaults
(toc:load-config-file '(
;; ediff files
;; set up session and dektop handling

;; set up remote file handling

;; for ecb and suchlike
;; for Xml & html & other mixed modes
;; spelling config.
;; bookmarks config.
;; XEmacs packages config.
;; pim config
;                       "personal_muse_settings"
;                        "elsevier_muse_settings"
;; muse
;                        "muse_config"
;; planner-muse
;                        "planner-muse-remember_config"
;; org-remember

;; web browser config
;;                        "w3_config" ;; rolled into org
;; mail user agent.
;                        "mutt_config"
;                        "gnus_config"
;                        "mew_config"
;                        "wanderlust_config"

;; work/machine specific config.
;                        "lime_config"
;                        "telfort_config"

;; Java developmetn
;; Perl Development
;                        "pde_config"
;                        "perlysense_config"

;; programming specific configs.
;                        "sqlmode_config"
;                        "template_config"
;; thumbs config
;                        "dired_thumbs_config"
;; final settings
;; filladapt config
;                        "filladapt_config"

;; symbian programming config
;; Printing config


;; The things to do at the end of the init process..

;; load machine specific configs

;; call frame maximuze post init:

;; turn off debugging
(setq debug-on-error nil)

----- end of cut down emacs config -----

Feel free to ask questions if you dont get it.


2008/7/2 Eddward DeVilla <address@hidden>:
> On Tue, Jul 1, 2008 at 1:21 PM, Harri Kiiskinen <address@hidden> wrote:
>> Thank you all for the answers, but it seems that I was not quite clear
>> enough. I'm quite able to set the 'custom-file' to whatever I want, and
>> I can (load "myconfig.el") - which is what I currently do. Lets restate
>> the problem:
>> 1. I cannot and do not want to share _all_ customizations, since many of
>> them are system specific - absolute paths, modes which function on Linux
>> but not on XP (e.g. whizzy-tex), face settings etc.
>> 2. I want to share org-mode customization, which is system independent,
>> in my case. This I can do with (load "myconfig.el"), but the file has to
>> be edited by hand, as the Emacs Customize for org-mode saves everything
>> where 'custom-file' points to.
>> 3. If I set 'custom-file' to "myconfig.el", then I contradict no. 1.
> Sorry for not responding sooner.  I've had init split
> (http://www.emacswiki.org/cgi-bin/wiki/InitSplit) suggested to me for
> the same problem.  The thread might be in the archive.  I haven't had
> a chance to set this up yet, so I can say if it is really usable.
> Edd
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

reply via email to

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