From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Patrick Drechsler Newsgroups: gmane.emacs.devel Subject: single init file/directory for windows and linux using version control svn or cvs Date: Wed, 20 Sep 2006 01:09:10 +0200 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1158708353 11990 80.91.229.2 (19 Sep 2006 23:25:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2006 23:25:53 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 20 01:25:45 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GPoy3-0001Qo-TW for ged-emacs-devel@m.gmane.org; Wed, 20 Sep 2006 01:25:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GPoy3-0002k7-6C for ged-emacs-devel@m.gmane.org; Tue, 19 Sep 2006 19:25:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GPoxq-0002hY-MD for emacs-devel@gnu.org; Tue, 19 Sep 2006 19:25:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GPoxp-0002fv-5D for emacs-devel@gnu.org; Tue, 19 Sep 2006 19:25:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GPoxp-0002fk-06 for emacs-devel@gnu.org; Tue, 19 Sep 2006 19:25:17 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GPp0y-0002jY-Pf for emacs-devel@gnu.org; Tue, 19 Sep 2006 19:28:33 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1GPoxa-0001La-St for emacs-devel@gnu.org; Wed, 20 Sep 2006 01:25:02 +0200 Original-Received: from dslb-084-057-075-135.pools.arcor-ip.net ([84.57.75.135]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Sep 2006 01:25:02 +0200 Original-Received: from patrick by dslb-084-057-075-135.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Sep 2006 01:25:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 390 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dslb-084-057-075-135.pools.arcor-ip.net User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:60024 Archived-At: Hi, I'm trying to conceive a single repository for my personal configurations using SVN. To keep everything in one folder I have deleted "~/.emacs" and started using "~/.emacs.d/init.el". Furthermore I have put all my external lisp files in "~/.emacs.d/mysitelisp", which are included correctly by init.el. This works fine with Linux, WindowsXP and Cygwin. BUT I had to repeat this procedure in each corresponding home directories. Can I put a directory ".emacs.d" including an init.el somewhere under Windows/Cygwin so that it will be recognized by a default Emacs installation (C:\.emacs.d\init.el is ignored when there is no C:\.emacs or C:\_emacs)? Furthermore: What would be the current Emacs variable to tweak for using an IF windows use this path ELSEIF Cygwin use another path ELSE ;; linux use yet another path construct? My Windows version of Emacs is (which is also used by cygwin): GNU Emacs 22.0.50.1 (i386-mingw-nt5.1.2600) of 2006-06-24 on NEUTRINO My Linux version is (from Ubuntu Dapper: Emacs Snapshot): GNU Emacs 22.0.50.1 (i486-pc-linux-gnu, GTK+ Version 2.8.17) of 2006-08-24 on vernadsky, modified by Debian Since both versions are not stable I am wondering if they are compatible or if I should chose another combination... If they are compatible: What is the best approach for a multi-platform install file? I am sorry if I missed something obvious in the Emacs manual or in the archives. This is also the reason for the lengthy subject line (other people might find it useful). TIA, Patrick Here is my init file (for windows, as an example): ;; PDTODO: ;; is it good to replace all "~/" paths with "C:/" ? ;; set default Gnus init file: (setq gnus-init-file "~/.emacs.d/.gnus") ;; ============================================================ ;; FRAME TITLE: ================================================ ;; ============================================================ (setq frame-title-format "%b") ;; ============================================================ ;; ANSWER Y INSTEAD OF YES ON PROMPTS. ========================= ;; ============================================================ (defalias 'yes-or-no-p 'y-or-n-p) ;; ============================================================ ;; SKELETON PAIR MODE ========================================== ;; ============================================================ (setq skeleton-pair t) (global-set-key "(" 'skeleton-pair-insert-maybe) (global-set-key "[" 'skeleton-pair-insert-maybe) (global-set-key "\"" 'skeleton-pair-insert-maybe) (global-set-key "'" 'skeleton-pair-insert-maybe) (global-set-key "{" 'skeleton-pair-insert-maybe) ;; ============================================================ ;; COMMENT ===================================================== ;; ============================================================ (defun insert-comment-heading (comment) "Insert COMMENT, followed by \" ---...\". The line will be ;; commented based on which mode you are in." (interactive "sComment: ") (insert comment " " (make-string (- 75 (+ (length comment) 5) 10) ?=)) (comment-region (point-at-bol) (point-at-eol)) (newline)) (global-set-key [f7] 'insert-comment-heading) ;; ============================================================ ;; INDENT REGION GLOBALLY ====================================== ;; ============================================================ (global-set-key [f12] 'indent-region) ;; ============================================================ ;; ORG MODE ==================================================== ;; ============================================================ (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) (define-key global-map "\C-cl" 'org-store-link) (define-key global-map "\C-ca" 'org-agenda) ;; activate progress logging: (setq org-log-done t) ;; activate org-mode for all README-files: (add-to-list 'auto-mode-alist '("README.*$" . org-mode)) ;; packages along with Org-mode, configure the variable ;; `org-CUA-compatible'. When set, Org-mode will move the following ;; keybindings in org-mode files, and in the agenda buffer (but not ;; during date selection). ;; S-UP -> M-p S-DOWN -> M-n ;; S-LEFT -> M-- S-RIGHT -> M-+ ;; S-RET -> C-S-RET ;; including remember mode in org mode: (add-to-list 'load-path "~/.emacs.d/mysitelisp/planner-mode/remember/") (require 'remember) (setq org-directory "F:\org-stuff") (setq org-default-notes-file "~/.notes") (setq remember-annotation-functions '(org-remember-annotation)) (setq remember-handler-functions '(org-remember-handler)) (add-hook 'remember-mode-hook 'org-remember-apply-template) (setq org-remember-templates '((?t "* TODO %?\n %i\n %a" "F:\org-stuff\TODO.org") (?j "* %U %?\n\n %i\n %a" "F:\org-stuff\JOURNAL.org"))) (setq org-agenda-include-diary t) ;; ============================================================ ;; SYNONYM ===================================================== ;; ============================================================ (add-to-list 'load-path "~/.emacs.d/mysitelisp/") (setq synonyms-file "~/.emacs.d/mysitelisp/thesaurus/mthesaur.txt") (setq synonyms-cache-file "~/.emacs.d/mysitelisp/thesaurus/pd-synonym-cache-file.txt") (require 'synonyms) ;; ============================================================ ;; THESAURUS: ================================================== ;; ============================================================ (add-to-list 'load-path "~/.emacs.d/mysitelisp/thesaurus/") ;; (require 'mthesaur) ; Thesaurus (autoload 'mthesaur-search "mthesaur" "Thesaurus lookup of a word or phrase." t) (autoload 'mthesaur-search-append "mthesaur" "Thesaurus lookup of a word or phrase, append results." t) (global-set-key "\C-ct" 'mthesaur-search) (global-set-key "\C-c\C-t" 'mthesaur-search-append) ;; ============================================================ ;; ISPELL AND CO =============================================== ;; ============================================================ ;; ============================================================ ;; AUCTEX ====================================================== ;; ============================================================ ;;; this is needed because otherwise auctex will not be loaded: ;;; pdtodo: is this needed for windows? ;; (load "auctex.el" nil t t) ;; (load "preview-latex.el" nil t t) ;;; pdtodo: or this? ;; (require 'tex-site) (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) ;; active folding: (add-hook 'LaTeX-mode-hook (lambda () (TeX-fold-mode 1) (TeX-fold-buffer))) ;; ALIGN TABLES: =============================================== (add-hook 'LaTeX-mode-hook (function (lambda () (define-key LaTeX-mode-map "\C-c\C-a" ;; "^C^A" 'align-current)))) ;; PSTRICKS ==================================================== (add-hook 'LaTeX-mode-hook '(lambda nil (LaTeX-add-environments '("pspicture" (lambda (env &rest ignore) (LaTeX-insert-environment env (let ((lower-left (read-input "(Optional) Lower left corner (x0,y0): ")) (upper-right (read-input "Upper right corner (x1,y1): "))) (concat (unless (zerop (length lower-left)) (format "(%s)" lower-left)) (format "(%s)" upper-right))))))))) ;; ============================================================ ;; REFTEX ====================================================== ;; ============================================================ (setq reftex-plug-into-AUCTeX t) (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode ;; from the RefTeX manual: (setq reftex-use-external-file-finders t) (setq reftex-external-file-finders '(("tex" . "kpsewhich -format=.tex %f") ("bib" . "kpsewhich -format=.bib %f"))) ;; As a summary, here are the settings I recommend for heavy use of ;; RefTeX with large documents: (setq reftex-enable-partial-scans t reftex-save-parse-info t reftex-use-multiple-selection-buffers t) ;; (setq reftex-bibpath-environment-variables ;; '("/home/patrick/data/uni/literature/bibtex-files/")) ;;; done in section sweave below: ;; ;; Reftex and Noweb files: ;; (setq reftex-file-extensions ;; '(("Rnw" ".Rnw" "nw" "tex" ".tex" ".ltx") ("bib" ".bib"))) ;; (setq TeX-file-extensions ;; '("Rnw" "nw" "tex" "sty" "cls" "ltx" "texi" "texinfo")) (eval-after-load "ispell" '(let ((list (car ispell-tex-skip-alists))) (add-to-list 'list '("\\\\cite[tpk]" ispell-tex-arg-end)) (setcar ispell-tex-skip-alists list))) (eval-after-load "ispell" '(let ((list (car ispell-tex-skip-alists))) (add-to-list 'list '("\\\\citeal[tp]" ispell-tex-arg-end)) (setcar ispell-tex-skip-alists list))) ;; ============================================================ ;; ESS ========================================================= ;; ============================================================ ;; this is windows specific: (setq-default inferior-R-program-name "C:/Programme/R/R-2.3.1/bin/Rterm") (load "C:/Programme/emacs/site-lisp/ess/lisp/ess-site") ;; ============================================================ ;; MATLAB ====================================================== ;; ============================================================ ;;; i think i'll use the windows IDE -> comment following code for ;;; Windows ;; ;;; here are my linux configs for matlab: ;; (setq matlab-shell-command "bash" ;; matlab-shell-command-switches '("-c" "( unset LANG ; /usr/local/bin/matlab -nodesktop)")) ;; (add-to-list 'load-path "/usr/local/matlab/matlab72/java/extern/EmacsLink/lisp")(autoload 'matlab-eei-connect "matlab-eei" ;; "Connects Emacs to MATLAB's external editor interface.") ;; (autoload 'matlab-mode "matlab" "Enter Matlab mode." t) ;; (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) ;; (autoload 'matlab-shell "matlab" "Interactive Matlab mode." t) ;; (setq matlab-indent-function t) ; if you want function bodies indented ;; (setq matlab-verify-on-save-flag nil) ; turn off auto-verify on save ;; ;; (setq matlab-shell-command-switches '("-nojvm")) ;; '(matlab-shell-command-switches (quote ("-nodesktop -nosplash"))) ;; (defun pd-matlab-mode-hook () ;; ;(setq fill-column 76) ; where auto-fill should wrap ;; (imenu-add-to-menubar "Find")) ;; (add-hook 'matlab-mode-hook 'pd-matlab-mode-hook) ;; ============================================================ ;; ECB ========================================================= ;; ============================================================ ;;; done via customize... ;; ============================================================ ;; GDB STUFF (GNU DEBUGGER): =================================== ;; ============================================================ (setq gdb-many-windows 1) ;; ============================================================ ;; GRAPHVIZ / DOT ============================================== ;; ============================================================ (load-file "~/.emacs.d/mysitelisp/graphviz-dot-mode.el") ;; ============================================================ ;; BBDB ======================================================== ;; ============================================================ (setq bbdb-file "~/.emacs.d/.bbdb") ;; other bbdb configurations in .gnus ;; ============================================================ ;; PSVN ======================================================== ;; ============================================================ ;; To use psvn.el put the following line in your .emacs: (require 'psvn) ;; Start the svn interface with M-x svn-status ;; ============================================================ ;; ============================================================ ;; ============================================================ (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(LaTeX-math-menu-unicode t) '(TeX-DVI-via-PDFTeX t) '(TeX-PDF-mode t) '(TeX-fold-env-spec-list (quote (("[noweb]" ("noweb")) ("[comment]" ("comment")) ("[figure]" ("figure")) ("[table]" ("table"))))) '(TeX-fold-macro-spec-list (quote (("[f]" ("footnote")) (1 ("cite" "citep" "citet" "citealp" "citealt")) ("[l]" ("label")) (1 ("ref" "pageref" "fref" "Fref" "vref" "Vref" "vpageref")) ("[i]" ("index")) ("*" ("item")) ("..." ("dots")) (1 ("part" "chapter" "section" "subsection" "subsubsection" "paragraph" "subparagraph" "part*" "chapter*" "section*" "subsection*" "subsubsection*" "paragraph*" "subparagraph*" "emph" "textit" "textsl" "textmd" "textrm" "textsf" "texttt" "textbf" "textsc" "textup")) (2 ("vrefrange"))))) '(TeX-one-master "\\.\\(texi?\\|dtx\\|Rnw\\)$") '(all-christian-calendar-holidays t) '(browse-url-browser-function (quote browse-url-firefox)) '(browse-url-firefox-new-window-is-tab t) '(calendar-week-start-day 1) '(column-number-mode t) '(cua-mode nil nil (cua-base)) '(diary-file "~/.emacs.d/diary") '(display-time-24hr-format t) '(display-time-mode t) '(european-calendar-style t) '(global-font-lock-mode t nil (font-core)) '(graphviz-dot-preview-extension "png") '(holidays-in-diary-buffer t) '(inhibit-splash-screen t) '(iswitchb-mode t) '(org-agenda-files (quote ("f:/org-stuff/computerstuff.org" "f:/org-stuff/heinzerling.org" "f:/org-stuff/THESIS.org" "f:/org-stuff/privat.org" "f:/org-stuff/TODO.org" "f:/org-stuff/JOURNAL.org"))) '(pc-selection-mode t nil (pc-select)) '(show-paren-mode t) '(transient-mark-mode t) '(view-diary-entries-initially t)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. )