unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Patrick Drechsler <patrick@pdrechsler.de>
Subject: single init file/directory for windows and linux using version control svn or cvs
Date: Wed, 20 Sep 2006 01:09:10 +0200	[thread overview]
Message-ID: <eeptb6$8tq$1@sea.gmane.org> (raw)

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.
  )

             reply	other threads:[~2006-09-19 23:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-19 23:09 Patrick Drechsler [this message]
2006-09-20  3:24 ` single init file/directory for windows and linux using version control svn or cvs Eli Zaretskii
2006-09-21 10:21   ` Patrick Drechsler
2006-09-20  7:49 ` Stefan Monnier
2006-09-21 10:23   ` Patrick Drechsler
2006-09-21  1:58 ` Richard Stallman
2006-09-21 10:25   ` Patrick Drechsler
2006-09-21 11:53   ` CHENG Gao
2006-09-21 12:15     ` Jason Rumney
2006-09-21 20:15       ` Richard Stallman
2006-09-22 12:39         ` Eli Zaretskii
2006-09-23  3:34           ` Richard Stallman
2006-09-23 10:26             ` Eli Zaretskii
2006-09-22  2:41       ` CHENG Gao
2006-09-22 12:46         ` Eli Zaretskii
2006-09-22 14:31           ` CHENG Gao
2006-09-23  9:57             ` Eli Zaretskii
2006-09-23 10:17         ` Jason Rumney
2006-09-21  2:51 ` Eric Hanchrow
2006-09-21 10:25   ` Patrick Drechsler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='eeptb6$8tq$1@sea.gmane.org' \
    --to=patrick@pdrechsler.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).