+; -*- emacs-lisp -*-
+;
+
+(message "loading .emacs-standard")
+(load "~/.emacs-standard")
(setq tfheen-color-preference 'light) ; light or dark
-(if (not (string-match "Lucid" emacs-version))
- (setq xemacsp nil))
-
-(if (not xemacsp)
- (save-excursion
- (if (string< "21" emacs-version )
- (set-language-environment "Latin-1")
- (let ()
- (standard-display-european t)
- (if (string< emacs-version "20")
- (load-library "iso-syntax") ; emacs 19.x
- (require 'latin-1)) ; emacs 20.x
- (set-input-mode (car (current-input-mode))
- (nth 1 (current-input-mode))
- 0)))))
+(cw/for-emacs
+ (set-language-environment "Latin-1"))
;(prefer-coding-system "utf-8")
(add-to-list 'Info-default-directory-list (expand-file-name "~/usr/info"))
-;(add-to-list 'Info-default-directory-list
-; (expand-file-name "~/data/emacs/lisp/tramp/texi"))
(add-to-list 'load-path (expand-file-name "~/data/emacs/lisp"))
-;(add-to-list 'load-path (expand-file-name "~/data/emacs/lisp/tramp/lisp"))
-
-(require 'bbdb)
-(setq tramp-default-method "rsync")
+(cw/requiring-package (bbdb)
+ (bbdb-initialize 'gnus 'message 'w3)
+ (setq bbdb-use-pop-up nil
+ bbdb-quiet-about-name-mismatches t
+ bbdb-default-area-code nil
+ bbdb-north-american-phone-numbers-p nil
+ bbdb-user-mail-names "\(tollef|tfheen\)"
+ bbdb-offer-save 1
+ bbdb-use-pop-up nil
+ mail-setup-hook 'bbdb-insinuate-sendmail)
+ (add-hook mail-setup-hook 'bbdb-define-all-aliases))
-(bbdb-initialize 'gnus 'message 'w3)
-
-(setq bbdb-use-pop-up nil
- bbdb-quiet-about-name-mismatches t
- bbdb-default-area-code nil
- bbdb-north-american-phone-numbers-p nil
- bbdb-user-mail-names "\(tollef|tfheen\)"
- bbdb-offer-save 1
- bbdb-use-pop-up nil
- mail-setup-hook 'bbdb-insinuate-sendmail)
-(add-hook mail-setup-hook 'bbdb-define-all-aliases)
(setq default-major-mode 'text-mode)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
-(defun dos-to-unix ()
- (interactive)
- (save-excursion
- (goto-char (point-min))
- (replace-string "\91" "æ")
- (replace-string "\9b" "ø")
- (replace-string "\86" "å")
- (replace-string "\92" "Æ")
- (replace-string "\9d" "Ø")
- (replace-string "\8f" "Å")
- (replace-string "\r" "")
- (replace-string "\1a" "")
- )
- )
-
-
-(defun text-to-html ()
- (interactive)
- (save-excursion
- (goto-char (point-min))
- (replace-string "æ" "æ")
- (replace-string "æ" "ø")
- (replace-string "å" "å")
- (replace-string "Æ" "Æ")
- (replace-string "Ø" "Ø")
- (replace-string "Å" "Å")
- )
- )
-
(fset 'yes-or-no-p 'y-or-n-p)
-(load-library "mailcrypt")
-(mc-setversion "gpg")
-
-(autoload 'mc-install-write-mode "mailcrypt" nil t)
-(autoload 'mc-install-read-mode "mailcrypt" nil t)
-(add-hook 'mail-mode-hook 'mc-install-write-mode)
-(add-hook 'mail-setup-hook 'mc-install-write-mode)
-
-(add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)
-(add-hook 'news-reply-mode-hook 'mc-install-write-mode)
+(cw/requiring-package (mailcrypt)
+ (mc-setversion "gpg")
+ (autoload 'mc-install-write-mode "mailcrypt" nil t)
+ (autoload 'mc-install-read-mode "mailcrypt" nil t)
+ (add-hook 'mail-mode-hook 'mc-install-write-mode)
+ (add-hook 'mail-setup-hook 'mc-install-write-mode)
+ (add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)
+ (add-hook 'news-reply-mode-hook 'mc-install-write-mode)
+ (setq mc-temp-directory (expand-file-name "~/tmp")
+ mc-encrypt-for-me t
+ mc-gpg-user-id "tfheen@opera.no"
+ mc-passwd-timeout 600))
(global-set-key "\M-n" 'browse-url-at-point)
(global-set-key [(control backspace)] 'undo)
(global-set-key [(control return)] 'find-tag)
-;;; Custom stuff.
-(setq load-path (cons "/usr/share/emacs/site-lisp" load-path))
-(condition-case () (require 'w3-auto "w3-auto") (error nil))
-(custom-set-variables
- '(ecb-source-path (quote ("~/data/ntnu/SIF8005/prosjekt/risk/")))
- '(w3-user-fonts-take-precedence t)
- '(browse-url-browser-function (quote browse-url-netscape) t)
- '(browse-url-new-window-p t t)
- '(browse-url-generic-program "opera" t)
- '(browse-url-netscape-program "opera")
- '(gnuserv-program (concat exec-directory "/gnuserv"))
- '(tramp-multi-file-name-structure (quote ("\\`/r:\\(\\([a-z0-9]+\\)\\)?\\(\\(%s\\)+\\):\\(.*\\)\\'" 2 3 -1)))
- '(tramp-make-tramp-file-format "/r:%m/%u@%h:%p")
- '(tramp-file-name-regexp "\\`/r:")
- '(tramp-make-multi-tramp-file-format (quote ("/r:%m" "/%m:%u@%h" ":%p")))
- '(tramp-auto-save-directory "/home/tfheen/tmp")
- '(load-home-init-file t t)
- '(py-beep-if-tab-change nil)
- '(tramp-make-tramp-file-user-nil-format "/r:%m/%h:%p")
- '(tramp-file-name-structure (quote ("\\`/r:\\(\\([a-zA-Z0-9]+\\)/\\)?\\(\\([-a-zA-Z0-9_#/:]+\\)@\\)?\\([-a-zA-Z0-9_#/:@.]+\\):\\(.*\\)\\'" 2 4 5 6)))
- '(browse-url-temp-dir "~/tmp/")
- '(nnmail-prepare-incoming-header-hook (quote (nnmail-fix-eudora-headers)))
- '(jde-bug-vm-includes-jpda-p t)
- '(w3-user-colors-take-precedence t))
-
- (if (eq tfheen-color-preference 'dark)
- (custom-set-faces
- '(w3-style-face-00003 ((t (:foreground "#000000" :background "black"))) t)
- '(w3-style-face-00002 ((t (:background "black"))) t)
- '(w3-style-face-00001 ((t (:background "black"))) t)
- '(custom-set-face ((((class color)) (:foreground "blue" :background "black"))))
- '(font-lock-keyword-face ((((class color) (background dark)) (:foreground "Maroon"))))
- '(show-paren-mismatch-face ((((class color)) (:bold t :foreground "Red"))))
- '(gnus-cite-face-3 ((t (:foreground "Green"))))
- '(gnus-cite-face-2 ((t (:foreground "LightBlue"))))
- '(gnus-cite-face-1 ((t (:foreground "Yellow"))))
- '(show-paren-match-face ((((class color)) (:bold t :foreground "White"))))
- '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "BlueViolet")))))
- (custom-set-faces
- '(w3-style-face-00003 ((t (:foreground "#000000" :background "black"))) t)
- '(w3-style-face-00002 ((t (:background "black"))) t)
- '(w3-style-face-00001 ((t (:background "black"))) t)
-
- '(custom-set-face ((((class color)) (:foreground "blue" :background "black"))))
- '(sh-heredoc-face ((((class color) (background light)) (:foreground "DarkGreen"))))
- '(font-lock-keyword-face ((t (:foreground "DarkBlue"))) t)
- '(font-lock-string-face ((t (:foreground "Blue"))) t)
- '(mmm-default-submode-face ((t (:background "White"))) t)
- '(show-paren-mismatch-face ((((class color)) (:bold t :foreground "Red"))))
- '(gnus-cite-face-3 ((t (:foreground "DarkGreen"))))
- '(gnus-cite-face-2 ((t (:foreground "DarkRed"))))
- '(gnus-cite-face-1 ((t (:foreground "DarkBlue"))))
- '(show-paren-match-face ((((class color)) (:bold t :foreground "White"))))
- '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "BlueViolet"))))))
+(cw/requiring-package (w3-auto))
+
+(setq browse-url-browser-function 'browse-url-netscape
+ browse-url-new-window-p t
+ browse-url-generic-program "opera"
+ browse-url-netscape-program "opera")
+
;; File modes
(autoload 'php-mode "php-mode" "PHP editing mode" t)
perl-continued-brace-offset 0
perl-brace-offset -5
perl-brace-imaginary-offset 0
- perl-label-offset -5
- )
-
-;(if (not xemacsp)
-; (c-set-style "k&r"))
-
+ perl-label-offset -5)
(setq next-line-add-newlines nil
compilation-window-height 10
(setq bar (cdr bar)))
(reverse liste)))
-(defun reverse-nnml-list-in-list (reverse-list)
- (require 'cl)
- (let '(bar (copy-list reverse-list))
- (setq liste (list))
- (while (car bar)
- (let '(elem (car bar))
- (print (car elem))
- (add-to-list 'liste (list (car (cdr elem)) (concat "nnml:" (car elem))))
- (setq bar (cdr bar))))
- (reverse liste)))
(setq py-honor-comment-indentation nil)
(add-hook 'sgml-mode-hook '(lambda()(local-set-key "\C-c>" 'sgml-insert-end-tag)))
(add-hook 'emacs-lisp-mode-hook '(lambda()(local-set-key "\C-j" 'find-function)))
-(setq mc-temp-directory (expand-file-name "~/tmp")
- mc-encrypt-for-me t
- mc-gpg-user-id "tfheen@opera.no")
;(require 'template)
;(add-hook 'c-mode-common-hook 'tmpl-init)
;(add-hook 'c-mode-common-hook 'auto-insert-file-header)
(add-hook 'c-mode-common-hook (lambda() (local-set-key "\M-\C-x" 'compile)))
(add-hook 'c-mode-common-hook (lambda() (local-set-key "\M-\C-z" 'next-error)))
-(require 'auto-header)
+
+(cw/requiring-package (auto-header))
+
(setq header-full-name "Tollef Fog Heen"
header-email-address "tollef@add.no"
add-log-mailing-address "tfheen@debian.org"
debian-changelog-mailing-address "tfheen@debian.org"
tags-table-list (list (expand-file-name "~/usr/include/")))
+
(setq sgml-local-catalogs (list "~/usr/lib/sgml/sgml.catalog"))
;; Find-file hooks
;; Visual fluff.
-(if (not xemacsp)
- (toggle-scroll-bar -1)
- (setq scrollbars-visible-p nil))
+(cw/for-emacs
+ (toggle-scroll-bar -1)
+ (setq scrollbars-visible-p nil))
(setq scroll-bar-mode nil)
+
; show-paren-style 'expression)
; Highlight matching/nonmatching parens
;(if (not xemacsp)
; (show-paren-mode t)) ; show-paren-mode takes too much cpu
-(if (not xemacsp)
- (global-font-lock-mode t)
- (font-lock-mode 1))
-(if (not xemacsp)
- (server-start))
+(cw/for-emacs
+ (global-font-lock-mode t)
+ (font-lock-mode 1)
+ (server-start))
;; Multiple mode
-
-(require 'mmm-auto)
-(setq mmm-global-mode 'maybe)
-(custom-set-faces
- '(w3-style-face-00003 ((t (:foreground "#000000" :background "black"))) t)
- '(w3-style-face-00002 ((t (:background "black"))) t)
- '(w3-style-face-00001 ((t (:background "black"))) t)
- '(font-lock-string-face ((t (:foreground "Blue"))))
- '(custom-set-face ((((class color)) (:foreground "blue" :background "black"))))
- '(font-lock-keyword-face ((t (:foreground "DarkBlue"))))
- '(show-paren-mismatch-face ((((class color)) (:bold t :foreground "Red"))))
- '(gnus-cite-face-3 ((t (:foreground "DarkGreen"))))
- '(gnus-cite-face-2 ((t (:foreground "DarkRed"))))
- '(gnus-cite-face-1 ((t (:foreground "DarkBlue"))))
- '(mmm-default-submode-face ((t (:background "White"))))
- '(show-paren-match-face ((((class color)) (:bold t :foreground "White"))))
- '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "BlueViolet")))))
-(setq mc-passwd-timeout 600)
-
-(if (not xemacsp)
- (require 'tramp))
-
-
-(if (and (not xemacsp) (= emacs-major-version 21))
- (progn
- (blink-cursor-mode 0)
- (tooltip-mode 0)
- (tool-bar-mode 0)
- (global-set-key [home] 'beginning-of-buffer)
- (global-set-key [end] 'end-of-buffer)
- (setq cursor-in-non-selected-windows nil)))
+(cw/requiring-package
+ (mmm-auto)
+ (setq mmm-global-mode 'maybe)
+ (set-face-background 'mmm-default-submode-face "White"))
+
+(cw/requiring-package (tramp)
+ (setq tramp-multi-file-name-structure (quote ("\\`/r:\\(\\([a-z0-9]+\\)\\)?\\(\\(%s\\)+\\):\\(.*\\)\\'" 2 3 -1))
+ tramp-make-tramp-file-format "/r:%m/%u@%h:%p"
+ tramp-file-name-regexp "\\`/r:"
+ tramp-make-multi-tramp-file-format (quote ("/r:%m" "/%m:%u@%h" ":%p"))
+ tramp-auto-save-directory "/home/tfheen/tmp"
+ tramp-make-tramp-file-user-nil-format "/r:%m/%h:%p"
+ tramp-default-method "rsync"))
+
+; '(tramp-file-name-structure (quote ("\\`/r:\\(\\([a-zA-Z0-9]+\\)/\\)?\\(\\([-a-zA-Z0-9_#/:]+\\)@\\)?\\([-a-zA-Z0-9_#/:@.]+\\):\\(.*\\)\\'" 2 4 5 6)))
+
+(cw/for-emacs-21
+ (blink-cursor-mode 0)
+ (tooltip-mode 0)
+ (tool-bar-mode 0)
+ (global-set-key [home] 'beginning-of-buffer)
+ (global-set-key [end] 'end-of-buffer)
+ (setq cursor-in-non-selected-windows nil))
(global-set-key [C-tab] 'dabbrev-expand)
-(setq mail-open-quote "«")
-(setq mail-close-quote "»")
-
-(defun mail-insert-quote (arg)
- "Insert the appropriate quote marks for Norwegian mail.
-Inserts the value of `mail-open-quote' (normally «) or `mail-close-quote'
-\(normally ») depending on the context. With prefix argument, always
-inserts \" characters."
- (interactive "*P")
- (if arg
- (self-insert-command (prefix-numeric-value arg))
- (insert
- (cond ((or (bobp)
- (save-excursion
- (forward-char -1)
- (looking-at "\\s(\\|\\s \\|\\s>")))
- mail-open-quote)
- ((= (preceding-char) ?\\)
- ?\")
- (t
- mail-close-quote)))))
-
-(add-hook 'diary-hook 'appt-make-list)
+
+;(add-hook 'diary-hook 'appt-make-list)
+;(add-hook 'diary-hook 'appt-make-list)
+;(diary 0)
+
+; Mode line
(display-time)
-(add-hook 'diary-hook 'appt-make-list)
-(diary 0)
(display-battery)
+(setq display-time-format "%H:%M"
+ display-time-string-forms '(24-hours ":" minutes))
+
(setq show-trailing-whitespace t)
(setq-default indent-tabs-mode nil)
(define-coding-system-alias 'iso885915 'iso-8859-15)
-(setq display-time-format "%H:%M"
- display-time-string-forms '(24-hours ":" minutes))
\ No newline at end of file
+
+;;; Custom stuff.
+;(custom-set-variables
+; '(ecb-source-path (quote ("~/data/ntnu/SIF8005/prosjekt/risk/")))
+; '(w3-user-fonts-take-precedence t)
+; '(gnuserv-program (concat exec-directory "/gnuserv"))
+; '(load-home-init-file t t)
+; '(py-beep-if-tab-change nil)
+; '(browse-url-temp-dir "~/tmp/")
+; '(jde-bug-vm-includes-jpda-p t)
+; '(w3-user-colors-take-precedence t))
+
+;; (if (eq tfheen-color-preference 'dark)
+;; (custom-set-faces
+;; '(w3-style-face-00003 ((t (:foreground "#000000" :background "black"))) t)
+;; '(w3-style-face-00002 ((t (:background "black"))) t)
+;; '(w3-style-face-00001 ((t (:background "black"))) t)
+;; '(custom-set-face ((((class color)) (:foreground "blue" :background "black"))))
+;; '(font-lock-keyword-face ((((class color) (background dark)) (:foreground "Maroon"))))
+;; '(show-paren-mismatch-face ((((class color)) (:bold t :foreground "Red"))))
+;; '(gnus-cite-face-3 ((t (:foreground "Green"))))
+;; '(gnus-cite-face-2 ((t (:foreground "LightBlue"))))
+;; '(gnus-cite-face-1 ((t (:foreground "Yellow"))))
+;; '(show-paren-match-face ((((class color)) (:bold t :foreground "White"))))
+;; '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "BlueViolet")))))
+;; (custom-set-faces
+;; '(w3-style-face-00003 ((t (:foreground "#000000" :background "black"))) t)
+;; '(w3-style-face-00002 ((t (:background "black"))) t)
+;; '(w3-style-face-00001 ((t (:background "black"))) t)
+
+;; '(custom-set-face ((((class color)) (:foreground "blue" :background "black"))))
+;; '(sh-heredoc-face ((((class color) (background light)) (:foreground "DarkGreen"))))
+;; '(font-lock-keyword-face ((t (:foreground "DarkBlue"))) t)
+;; '(font-lock-string-face ((t (:foreground "Blue"))) t)
+;; '(mmm-default-submode-face ((t (:background "White"))) t)
+;; '(show-paren-mismatch-face ((((class color)) (:bold t :foreground "Red"))))
+;; '(gnus-cite-face-3 ((t (:foreground "DarkGreen"))))
+;; '(gnus-cite-face-2 ((t (:foreground "DarkRed"))))
+;; '(gnus-cite-face-1 ((t (:foreground "DarkBlue"))))
+;; '(show-paren-match-face ((((class color)) (:bold t :foreground "White"))))
+;; '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "BlueViolet"))))))
+
+;; Custom
+
+;; (custom-set-faces
+;; '(font-lock-string-face ((t (:foreground "Blue"))))
+;; '(custom-set-face ((((class color)) (:foreground "blue" :background "black"))))
+;; '(font-lock-keyword-face ((t (:foreground "DarkBlue"))))
+;; '(show-paren-mismatch-face ((((class color)) (:bold t :foreground "Red"))))
+;; '(gnus-cite-face-3 ((t (:foreground "DarkGreen"))))
+;; '(gnus-cite-face-2 ((t (:foreground "DarkRed"))))
+;; '(gnus-cite-face-1 ((t (:foreground "DarkBlue"))))
+;; '(show-paren-match-face ((((class color)) (:bold t :foreground "White"))))
+;; '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "BlueViolet")))))