The very unofficial .emacs home JasonRumney.emacs
emacs
Sections
home
what is this all about ?
customization basics
special topics
local dotfiles
dotfiles on the web
new and updated pages
useful sites and pages
search locally
EMacro
OS/2 Emacs
Latest Additions
local files:
John J. Glynn
David Jolley

linked files:


articles:


links:
The Emacs wiki
ODP search for Emacs


dmoz.org
;; jasonr.emacs  Edit in -*-Emacs-Lisp-*- mode
;;
;; This file contains some of the more useful customisations in my
;; .emacs. I have left out a lot that depends on external packages
;; that are not supplied with Emacs. My site-lisp directory is
;; currently 18.3Mb in size, so it was not practical to include
;; everything.
;;
;; This will work best if you have ispell-3.1, GhostView, gnuserv and
;; cua-mode.el installed. If so, set the appropriate "have-..."
;; variables before loading this file, or if you intend to use this as
;; your .emacs, change them below.
;;
;; Recommended installation:
;;
;; Put this in your HOME directory (where your .emacs goes).
;; Your .emacs should consist of the following lines:
;;
;; (setq have-ispell-3.1 t)
;; (setq have-cua-mode t)
;; (setq have-gnuserv t)
;; (setq have-ghostview t)
;; (load-file "~/jasonr.emacs")
;;
;; If you don't have one or more of those packages, or don't want to
;; use them, then remove the setq line for it.
;;
;; As for the rest of the elisp in my site-lisp directory, feel free
;; to contact me if you are having trouble installing any of the
;; following, as I can probably help.
;;
;; bbdb    : The Insidious Big Brother Database (automated address book)
;; dismal  : Excel for Emacs
;; edict   : English <-> Japanese dictionary
;; pcl-cvs : CVS frontend
;; pGnus   : alpha version of Gnus
;; w3      : Gnuscape WWW browser
;; ctypes  : Learns new types for font-lock in C/C++ code
;; skk     : Japanese input system (still on my todo list to install)
;;
;;
;; Jason Rumney <jasonr@altavista.net>            1999-07-27
;;=====================================================================

;; optional packages you have to install first. Default is not to use them.
(defvar have-gnuserv nil "Set to non-nil if you have gnuserv")
(defvar have-cua-mode nil "Set to non-nil if you have cua-mode")
(defvar have-ispell-3.1 nil "Set to non-nil if you have ispell 3.1")
(defvar have-ghostview nil "Set to non-nil to print via GhostView")
(defvar ghostview-program "gsview32.exe"
  "Location of Ghostview Executable. Default assumes it is in your path.")

;;=====================================================================
;; Gnuserv: requires optional gnuserv package. This should be done as
;; early as possible to make sure gnuserv starts up before gnuclient
;; times out.
(if have-gnuserv
    (progn
      (require 'gnuserv)
      (gnuserv-start)
      ;; Reuse an existing frame when loading files externally
      (setq gnuserv-frame (car (frame-list)))))

;; Use CUA keybindings
(if have-cua-mode
    (progn
      (load "cua-mode")
      (CUA-mode t)))

;; Use a more familiar menu layout
(setq menu-bar-final-items '(tools buffer help-menu))

;; Override the unfamiliar yank on button-2 with the more specific
;; context sensitive menu.
(define-key global-map [mouse-2] 'mouse-major-mode-menu)

;; Favorite colours and icon/frame naming
(if window-system
    (progn
      (setq default-frame-alist
            (append
             '((background-color . "floral white")
               (cursor-color . "grey")
               (vertical-scroll-bars . 'right)
               (horizontal-scroll-bars . nil)
               (scroll-bar-width . 10)
               (width . 80 ) (height . 40))
             default-frame-alist))
      (set-face-background 'modeline "red")
      (set-face-foreground 'modeline "yellow")
      (setq frame-title-format "Emacs: %b")
      (setq icon-title-format "Emacs: %b")))

(if (eq system-type 'windows-nt)
    (progn
      ;;===============================================================
      ;;  W32 specific section

      ;; Use an X style font menu instead of the Windows dialog
      (setq w32-use-w32-font-dialog nil)
      ;; Add Andale Mono fonts to the font menu
      (if window-system
          (progn
            (setq w32-fixed-font-alist
                  (append w32-fixed-font-alist
                          '(("Andale Mono"
                ("8" "-*-Andale Mono-normal-r-*-*-11-*-*-*-c-*-iso8859-1")
                ("9" "-*-Andale Mono-normal-r-*-*-12-*-*-*-c-*-iso8859-1")
                ("10" "-*-Andale Mono-normal-r-*-*-13-*-*-*-c-*-iso8859-1")
                ("11" "-*-Andale Mono-normal-r-*-*-15-*-*-*-c-*-iso8859-1")))))
;; Enable synthesized italic fonts
            (setq w32-enable-italics t)
            (create-fontset-from-fontset-spec
 "-*-Andale Mono-normal-r-*-*-12-*-*-*-c-*-fontset-favorites,
  latin-iso8859-2:-*-Andale Mono-normal-r-*-*-12-*-*-*-c-*-iso8859-2,
  latin-iso8859-3:-*-Andale Mono-normal-r-*-*-12-*-*-*-c-*-iso8859-3,
  latin-iso8859-4:-*-Andale Mono-normal-r-*-*-12-*-*-*-c-*-iso8859-4,
  cyrillic-iso8859-5:-*-Andale Mono-normal-r-*-*-12-*-*-*-c-*-iso8859-5,
  greek-iso8859-7:-*-Andale Mono-normal-r-*-*-12-*-*-*-c-*-iso8859-7,
  japanese-jisx0208:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
  katakana-jisx0201:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
  latin-jisx0201:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
  japanese-jisx0208-1978:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis")

            (setq default-frame-alist
                  (append
                   '((font .
             "-*-Andale Mono-normal-r-*-*-12-*-*-*-c-*-fontset-favorites"))
                   default-frame-alist))))

      (set-message-beep 'ok)  ;; Use "default" sound

      ;; Reorder the mouse buttons if there are only two buttons, as mouse-2
      ;; is bound to more useful things by default.
      (if (equal w32-num-mouse-buttons 2)
          (setq w32-swap-mouse-buttons t))

      ;; Grab the Windows keys for ourselves
      (setq w32-pass-lwindow-to-system nil)
      (setq w32-pass-rwindow-to-system nil)
      (setq w32-lwindow-modifier 'meta)
      (setq w32-rwindow-modifier 'hyper)
      (setq w32-apps-modifier 'super)
      (setq w32-scroll-lock-modifier nil)

      (setq backup-by-copying t)
      ) ;; End of Windows specific section
  (progn

      ;;==============================================================
      ;;  Linux specific section
    (if window-system
        (setq default-frame-alist
              (append
               '((font
          . "-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1"))
               default-frame-alist)))
    )) ;; End of Linux specific section

;;=====================================================================
;; General changes to the defaults.

;; Add ISO format to date formats allowed in diary
(load "diary-lib")
(setq diary-date-forms (append '((year "-" month "-" day "[^0-9]"))
                               diary-date-forms))

;; Make C-q <number> use decimals (as shown by Character Map)
(setq read-quoted-char-radix 10)

;; Make all yes/no prompts into y/n prompts
(fset 'yes-or-no-p 'y-or-n-p)

;; Use Cperl mode instead of Perl mode
(add-to-list 'auto-mode-alist
             '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))

(display-time)
(setq auto-save-interval 0)
(show-paren-mode t)

;; Hooks to turn on auto-fill and flyspell.
(add-hook 'first-change-hook 'turn-on-auto-fill)
(if have-ispell-3.1
    (add-hook 'text-mode-hook 'flyspell-mode))


;;====================================================================
;; postscript printing

(require 'ps-print)
(setq ps-paper-type 'a4)
(setq ps-print-color-p t)
(set-default 'ps-header-lines 1)
(setq ps-print-header-frame nil)
(setq ps-print-only-one-header t)
(if (eq system-type 'windows-nt)
    (progn
      (if have-ghostview
          (progn
            (setq ps-printer-name t)
            (setq ps-lpr-switches '(ghostview-program))
            (setq ps-lpr-command "cmdproxy")))

            ;; "snapshot" is caught by the system by default,
            ;; so need to register
      ;; it as a hotkey.
      (w32-register-hot-key [snapshot])
      (define-key global-map [snapshot] 'ps-print-buffer-with-faces)
      ;; BDF font locations for ps-bdf (printing) and w32bdf (display)
      (setq bdf-directory-list
            '("c:/fonts/Asian" "c:/fonts/Chinese" "c:/fonts/Chinese-X"
              "c:/fonts/Ethiopic" "c:/fonts/European" "c:/fonts/Japanese-X"
              "c:/fonts/Japanese" "c:/fonts/Korean-X" "c:/fonts/Misc"))))

(add-hook 'gnus-article-prepare-hook 'ps-gnus-article-prepare-hook)
(add-hook 'gnus-summary-mode-hook 'ps-gnus-summary-setup)
(add-hook 'Info-mode-hook 'ps-info-mode-hook)
(add-hook 'rmail-mode-hook 'ps-vm-mode-hook)


;;===================================================================
;;; Do not add non-custom definitions below here!
;;===================================================================

(custom-set-variables
 '(gnus-auto-select-same t)
 '(gnus-simplify-subject-functions (quote (gnus-simplify-subject-fuzzy)))
 '(gnus-use-adaptive-scoring (quote (word line)))
 '(gnus-summary-gather-subject-limit (quote fuzzy))
 '(gnus-read-active-file (quote some))
 '(gnus-keep-same-level (quote best))
 '(gnus-decay-scores t)
 '(gnus-group-use-permanent-levels t)
 '(gnus-article-sort-functions (quote (gnus-article-sort-by-score)))
 '(gnus-article-display-hook (quote (gnus-article-add-buttons-to-head gnus-article-de-quoted-unreadable gnus-article-hide-headers gnus-article-hide-pgp gnus-article-hide-pem gnus-article-highlight gnus-article-remove-trailing-blank-lines gnus-article-treat-overstrike)))
 '(gnus-auto-center-summary nil)
 '(gnus-thread-sort-functions (quote (gnus-thread-sort-by-score)))
 '(gnus-summary-thread-gathering-function (quote gnus-gather-threads-by-references))
 '(gnus-summary-zcore-fuzz 10)
 '(gnus-thread-ignore-subject t)
 '(gnus-signature-limit 10.0)
 '(gnus-score-find-score-files-function (quote gnus-score-find-hierarchical))
 '(gnus-cite-always-check t)
 '(gnus-score-thread-simplify t)
 '(gnus-group-sort-function (quote gnus-group-sort-by-level))
 '(gnus-subscribe-options-newsgroup-method (quote gnus-subscribe-hierarchically))
 '(gnus-novice-user nil)
 '(gnus-check-new-newsgroups (quote ask-server))
 '(gnus-boring-article-headers (quote (empty newsgroups followup-to reply-to long-to)))
 '(gnus-save-score t)
 '(gnus-verbose 5)
 '(gnus-auto-expirable-newsgroups ".*")
 '(gnus-auto-select-first nil)
 '(gnus-check-bogus-newsgroups t)
 '(gnus-thread-operation-ignore-subject (quote fuzzy))
 '(gnus-save-killed-list nil)
 '(gnus-subscribe-newsgroup-method (quote gnus-subscribe-zombies))
 '(gnus-thread-score-function (quote max))
 '(nnmail-prepare-incoming-header-hook (quote (nnmail-remove-list-identifiers nnmail-remove-leading-whitespace)))
 '(nnmail-delete-incoming t)
 '(nnmail-crosspost nil)
 '(nnmail-split-methods (quote nnmail-split-fancy))
 '(nnmail-pop-password-required t)
 '(mail-abbrevs-mode t nil (mailabbrev))
 '(mail-passwd-files nil)
 '(mail-user-agent (quote message-user-agent))
 '(message-ignored-resent-headers "^\\\\(Return-receipt\\\\|X-POP3-Rcpt\\\\|Xref\\\\)")
 '(message-wash-forwarded-subjects t)
 '(message-indentation-spaces 0)
 '(message-syntax-checks (quote ((sender . disabled))))
 '(message-cite-function (quote message-cite-original-without-signature))
 '(message-send-mail-function (quote smtpmail-send-it))
 '(flyspell-sort-corrections nil)
 '(sentence-end-double-space nil)
 '(ffap-dired-wildcards "[*?][^/]*\\'")
 '(c-electric-pound-behavior (quote (alignleft)))
 '(c-cleanup-list (quote (empty-defun-braces list-close-comma defun-close-semi scope-operator)))
 '(c-hanging-braces-alist (quote ((brace-list-open after) (substatement-open before after) (block-close . c-snug-do-while) (extern-lang-open after))))
 '(c-echo-syntactic-information-p t)
 '(european-calendar-style t)
 '(calendar-date-display-form (quote (year "-" month "-" day)))
 '(calendar-today-marker (quote calendar-today-face))
 '(today-visible-calendar-hook (quote (calendar-mark-today)))
 '(mark-holidays-in-calendar t)
 '(mark-diary-entries-in-calendar t)
 '(print-diary-entries-hook (quote (ps-print-buffer)))
 '(ps-right-header (quote ("/pagenumberstring load" time-stamp-dd-mon-yyyy time-stamp-hh:mm:ss)))
 '(ps-font-size 10)
 '(ps-multibyte-buffer (quote bdf-font-except-latin) t)
 '(ps-bottom-margin 72)
 '(list-matching-lines-default-context-lines 2)
 '(imenu-auto-rescan t)
 '(global-font-lock-mode t nil (font-lock))
 '(font-lock-maximum-size nil)
 '(font-lock-verbose nil)
 '(font-lock-support-mode (quote lazy-lock-mode))
 '(lazy-lock-stealth-time 10)
 '(lazy-lock-minimum-size 0)
 '(lazy-lock-defer-on-scrolling t)
 '(ediff-diff-options "-w")
 '(ediff-grab-mouse nil)
 '(browse-url-save-file t)
 '(mouse-avoidance-mode (quote jump) nil (avoid))
 '(speedbar-use-imenu-flag nil)
 '(hscroll-mode-name " nil")
 '(scroll-preserve-screen-position t)
 '(hexl-iso "-iso")
 '(vc-initial-comment t)
 '(vc-default-back-end (quote RCS))
 '(default-look-and-feel (quote mswindows-look-and-feel))
 '(widget-use-overlay-change t)
 '(widget-choice-toggle t)
 '(abbrev-mode t)
 '(save-abbrevs t)
 '(focus-follows-mouse nil)
 '(fill-individual-varying-indent nil)
 '(indent-tabs-mode nil)
 '(archive-zip-use-pkzip nil t)
 '(blink-matching-paren-on-screen nil)
 '(show-paren-style (quote mixed))
 '(auto-insert-mode t nil (autoinsert)))
(custom-set-faces
 '(gnus-signature-face ((((type x)) (:italic t :foreground "grey"))))
 '(calendar-today-face ((t (:background "sandy brown"))))
 '(show-paren-mismatch-face ((((class color)) (:foreground "white" :background "red"))))
 '(show-paren-match-face ((((class color)) (:background "light green")))))


All content copyright by the contributors. Website maintained with Emacs , wsmake and html-helper-mode
Emacs community logo by Daniel Lundin Last updated on Sat Jan 22 14:49:24 2005 by Ingo Koch