From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tim O'Callaghan" Subject: Re: Re: R: WISH: separate org-mode customization file Date: Thu, 3 Jul 2008 00:14:44 +0200 Message-ID: <3d6808890807021514s602ad28eg745fab7afa626c4b@mail.gmail.com> References: <1214914777.6519.132.camel@localhost.localdomain> <442673.75750.qm@web28308.mail.ukl.yahoo.com> <873amthd01.fsf@gollum.intra.norang.ca> <1214936469.6519.224.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEAbA-0006HL-Ep for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 18:14:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEAb8-0006H7-VJ for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 18:14:47 -0400 Received: from [199.232.76.173] (port=36354 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEAb8-0006H4-Ph for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 18:14:46 -0400 Received: from fg-out-1718.google.com ([72.14.220.153]:50165) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KEAb8-0004Cg-C0 for emacs-orgmode@gnu.org; Wed, 02 Jul 2008 18:14:46 -0400 Received: by fg-out-1718.google.com with SMTP id l26so210559fgb.30 for ; Wed, 02 Jul 2008 15:14:44 -0700 (PDT) In-Reply-To: Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: org-mode mailing list 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 above: ----- 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 "~/.emacsen_d/configs/machine_configs/" "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 (interactive) (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) (server-start))) ;; 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. (delete-selection-mode) (if (featurep 'xemacs) (setq zmacs-regions t) (transient-mark-mode 1)) ;; set the colors and frame properties (toc:load-config-file '("frames_config" "keymaps_config" "colour-theme_config")) ;; set any platform/(x)emacs specific properties ;; such as executbale paths, env variables and ;; info paths (cond ((eq system-type 'windows-nt) (toc:load-config-file '("win2k_config")) ) ;; otherwise try for maximum screenage (t (toc:load-config-file '("linux_config")) )) ;; load my configuration defaults (toc:load-config-file '( ;; ediff files "ediff_config" ;; set up session and dektop handling "desktop_config" ;; set up remote file handling "backup_config" "modemaps_config" "eshell-dired_config" ;; for ecb and suchlike "ecb_config" "speedbar_config" ;; for Xml & html & other mixed modes "mmm_modes_config" "xml_config" ;; spelling config. "spell_config" ;; bookmarks config. "bookmark_config" ;; XEmacs packages config. "Xpackages_config" ;; pim config ; "personal_muse_settings" ; "elsevier_muse_settings" "diary_config" ;; muse ; "muse_config" ;; planner-muse ; "planner-muse-remember_config" ;; org-remember "org-remember_config" ;; web browser config ;; "w3_config" ;; rolled into org ;; mail user agent. ; "mutt_config" ; "gnus_config" ; "mew_config" ; "wanderlust_config" ;; work/machine specific config. "tramp_efs_angeftp_config" "elsevier_config" ; "lime_config" ; "telfort_config" ;; Java developmetn "jde_config" ;; Perl Development ; "pde_config" ; "perlysense_config" ;; programming specific configs. ; "sqlmode_config" ; "template_config" "doxygen_config" "OOabrevs" ;; thumbs config ; "dired_thumbs_config" ;; final settings "info_config" "fontlock-face_config" ;; filladapt config ; "filladapt_config" ;; symbian programming config "symbian_config" ;; Printing config "printer_config" )) ;; ;; The things to do at the end of the init process.. ;; ;; load machine specific configs (toc:load-machine-config-file) ;; call frame maximuze post init: (toc: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. Tim. 2008/7/2 Eddward DeVilla : > On Tue, Jul 1, 2008 at 1:21 PM, Harri Kiiskinen 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. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode >