The very unofficial .emacs home JohnJGlynn.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
;; .emacs
;; 
;; John Glynn

;; General Emacs Options
;; =====================
;;
(setq truncate-partial-width-windows nil)
(setq indent-tabs-mode               nil)
(setq enable-recursive-minibuffers   t)
(setq line-number-mode               t)
(setq column-number-mode             t)
(setq find-file-visit-truename       t)
(setq search-highlight               t)
(setq query-replace-highlight        t)
(auto-compression-mode               1)
(auto-show-mode                      1)
(setq auto-save-list-file-name nil)
(setq cast-fold-search t)
(require 'paren)
(setq byte-compile-verbose           t)
(server-start)
(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(auto-compression-mode t nil (jka-compr))
 '(case-fold-search t)
 '(current-language-environment "English")
 '(default-input-method "latin-1-prefix")
 '(global-font-lock-mode t nil (font-lock))
 '(indent-tabs-mode nil)
 '(save-place t nil (saveplace))
 '(show-paren-mode t nil (paren))
 '(uniquify-buffer-name-style (quote forward) nil (uniquify)))

;; Fonts
;; ============
;;
(setq font-lock-maximum-decoration t)
(add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
(add-hook 'cc-mode-hook 'turn-on-font-lock)
(add-hook 'c-mode-hook 'turn-on-font-lock)
(add-hook 'c++-mode-hook 'turn-on-font-lock)
(add-hook 'java-mode-hook 'turn-on-font-lock)
(add-hook 'sh-mode-hook 'turn-on-font-lock)
(add-hook 'shell-script-mode-hook 'turn-on-font-lock)
(add-hook 'makefile-mode-hook 'turn-on-font-lock)
(add-hook 'perl-mode-hook 'turn-on-font-lock)
(add-hook 'xrdb-mode-hook 'turn-on-font-lock)
(add-hook 'ps-mode-hook '(lambda ()
                           (make-local-variable 'font-lock-support-mode)
                           (make-local-variable 'lazy-lock-defer-on-scrolling)
                           (setq font-lock-support-mode 'lazy-lock-mode
                                 lazy-lock-defer-on-scrolling t)
                           (turn-on-font-lock)))
(add-hook 'ps-run-mode-hook '(lambda () (turn-on-font-lock)))
 
;; Printing Options
;; ================
;;
(setq lpr-command "lpr")
(require 'ps-print)
(setq ps-print-color-p nil)
(setq ps-bold-faces '( 
   font-lock-keyword-face font-lock-function-name-face))
(setq ps-italic-faces '( 
   font-lock-comment-face font-lock-string-face))

;; Window colors
;; =============
;;
(if (eq window-system 'x)
    (if (x-display-color-p)
     (progn
     (set-background-color "#FFFFEEEECCCC")
	  (set-foreground-color "black")
	  (set-face-background 'region "black")
	  (set-face-foreground 'region "#FFFFEEEECCCC")
	  (set-face-background 'highlight "yellow")
	  (set-face-foreground 'highlight "black")
	  (set-face-background 'secondary-selection "#FFFFEEEECCCC")
	  (set-face-foreground 'secondary-selection "black")
	  (set-face-background 'modeline "gold1")
	  (set-face-foreground 'modeline "black")
	  (setq x-pointer-shape x-pointer-left-ptr)
	  (set-cursor-color "red")
	  (set-mouse-color "blue")
	  )))

(setq default-frame-alist
   (append
  '((width             . 81)
	 (height            . 58)
	 (background-color  . "#FFFFEEEECCCC")
	 (foreground-color  . "black")
	 (mouse-color       . "blue")
	 (cursor-color      . "red")
    (face-color        . "black")
    (face-backgound-color        . "#FFFFEEEECCCC")
	 ) default-frame-alist))

(setq pop-up-frame-alist
 '((width             . 81)
	(height            . 58)
	(background-color  . "#FFFFEEEECCCC")
	(foreground-color  . "black")
	(mouse-color       . "blue")
	(cursor-color      . "red")
	))

(set-frame-height (selected-frame) 58)
(set-frame-width (selected-frame) 81)

;; Text Options
;; ============

(setq-default fill-column 70)
(setq-default fill-prefix "    ")

;; Time & Date Options
;; ===================

(setq supress-day-of-week nil)
(setq display-time-day-and-date t)

;; Mode Options
;; ============

(autoload 'c++-mode  "cc-mode" "C++ Editing Mode" t)
(autoload 'c-mode    "cc-mode" "C Editing Mode"   t)
(autoload 'objc-mode "cc-mode" "Objective C Editing Mode" t)
(autoload 'text-mode "indented-text-mode" "Indented Text Editing Mode" t)
(autoload 'xrdb-mode "xrdb-mode" "Mode for editing X resource files" t)
(autoload 'ps-mode "ps-mode" "Major mode for editing PostScript" t)
(setq auto-mode-alist
      (append '(("\\.C$"       . c++-mode)
		("\\.cc$"      . c++-mode)
		("\\.c$"       . c-mode)
		("\\.h$"       . c++-mode)
		("\\.i$"       . c++-mode)
		("\\.ii$"      . c++-mode)
		("\\.m$"       . objc-mode)
		("\\.pl$"      . perl-mode)
		("\\.sql$"     . c-mode)
		("\\.sh$"      . shell-script-mode)
		("\\.mak$"     . makefile-mode)
		("\\.GNU$"     . makefile-mode)
		("makefile$"   . makefile-mode)
		("Imakefile$"  . makefile-mode)
		("\\.Xdefaults$"    . xrdb-mode)
		("\\.Xenvironment$" . xrdb-mode)
		("\\.Xresources$"   . xrdb-mode)
		("*.\\.ad$"         . xrdb-mode)
      ("\\.[eE]?[pP][sS]$" . ps-mode)
		) auto-mode-alist))

(setq default-tab-width 3)
(setq initial-major-mode 'text-mode)
(setq default-major-mode 'text-mode)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(global-unset-key "\M-[")
(global-unset-key "\M-O")
(setq default-auto-fill-hook 'do-auto-fill)
(add-hook 'c-mode-common-hook
          '(lambda () (c-toggle-auto-hungry-state 1)))
(add-hook 'c-mode-common-hook '(lambda () (c-set-style "Ellemtel")))

;; Remote Login Options
;; ====================

(setq rlogin-password-paranoia       t)
(setq rlogin-process-connection-type t)


;; Command Interpreter Options
;; ===========================
;;
(setq comint-input-ignoredups t)
(setq comint-scroll-show-maximum-output t)
(add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt)

;; Ediff Options
;; =============
;;
(setq ediff-window-setup-function 'ediff-setup-windows-plain)

;; Dired Options
;; =============
;;
(add-hook 'dired-load-hook
	  (function (lambda  ()
		      (load "dired-x")
		      (define-key dired-mode-map "a"      'dired-mark-extension)
		      (define-key dired-mode-map "b"      'dired-flag-extension)
		      (define-key dired-mode-map "E"      'dired-unmark-all-files-no-query)
		      (define-key dired-mode-map "\M-!"   'background)
		      (setq  dired-listing-switches       "-alF"
			     dired-ls-F-marks-symlinks    t
			     dired-bind-vm                t
			     dired-dwim-target            t
			     dired-guess-shell-gnutar     "gnutar"
			     dired-guess-shell-alist-user '(("\\.tgz$" "gnutar zxvf"))
			     )
		      )))

(setq dired-enable-local-variables nil)
(setq dired-local-variables-file   nil)

;; Full ISO Latin-1 Character Set
;; ==============================

(standard-display-european 1)
(load "iso-insert")

;; Move date and time to frame-status line 
;; =======================================

(display-time)
(setq global-mode-string '("" vip-mode string))
(setq frame-title-format
      '(multiple-frames
	"%b" ("" invocation-name "@" system-name "  ::  " display-time-string)))

(if (not (fboundp 'display-time)) (load "time"))

;; Key Bindings
;; ============

(define-key global-map "\C-h"   'delete-backward-char)
(define-key global-map "\C-[[H" 'beginning-of-line)
(define-key global-map "\M-[K"  'end-of-line)
(define-key global-map "\M-OL"  'backward-word)
(define-key global-map "\M-OR"  'forward-word)
(define-key global-map "\M-On"  'overwrite-mode)
(define-key global-map "\M-Op"  'delete-char)
(define-key global-map "\M-OA"  'previous-line)
(define-key global-map "\M-OB"  'next-line)
(define-key global-map "\M-OD"  'backward-char)
(define-key global-map "\M-OC"  'forward-char)
(define-key global-map "\M-O1"  'scroll-down)
(define-key global-map "\M-O2"  'scroll-up)
(define-key global-map "\M-O3"  'beginning-of-buffer)
(define-key global-map "\M-O4"  'end-of-buffer)
(define-key global-map "\M-OP"  'describe-bindings)

(global-set-key [kp-f1] 'kill-compilation)
(global-set-key [S-f9]  'kill-compilation)
(global-set-key [C-f9]  'remote-compile)
(global-set-key [S-f12] 'mail)
(global-set-key [S-f10] 'ps-print-buffer-with-faces)
(global-set-key [f2]    'man)
(global-set-key [f3]    'ispell-buffer)
(global-set-key [f4]    'imenu)
(global-set-key [f5]    'copy-file)
(global-set-key [f6]    'delete-file)
(global-set-key [f7]    'rename-file)
(global-set-key [f8]    'tags-search)
(global-set-key [f9]    'compile)
(global-set-key [f11]   'calander)
(global-set-key [f12]   'vm)
(global-set-key "\C-x\C-b" 'electric-buffer-list)
(global-set-key [pause] '[?\C-x ?\C-f ?/ ?t ?m ?p ?/ ?s ?t ?e ?p ?h return])

(defalias 'switch-to-next-buffer 'bury-buffer)
(defun switch-to-previous-buffer ()
  "Switches to previous buffer"
  (interactive)
  (switch-to-buffer (nth (- (length (buffer-list)) 1) (buffer-list)))
)

(global-set-key [C-tab] 'switch-to-previous-buffer)
(global-set-key [-backtab] 'switch-to-next-buffer)

;; Desktop
;; =======

(load "desktop")
(desktop-load-default)
(desktop-read)

;; Man Page Options
;; ================

(setq Man-notify            'bully
      Man-overstrike-face   'blue-bold
      Man-underline-face    'red-bold
      Man-see-also-regexp   "SEE ALSO\\|RELATED INFORMATION")

;; FTP Options
;; ===========

(setq ange-ftp-generate-anonymous-password t
      ange-ftp-retry-time                  60
      ange-ftp-smart-gateway               t
      ange-ftp-binary-file-name-regexp     ".")

;; Makefile Options
;; ================

(setq makefile-electric-keys t)

;; Compilation Options
;; ===================

(setq compile-command "make -k")
(setq compilation-window-height 20)
(defadvice compile-internal (after my-scroll act comp)
  "Forces compile buffer to scroll "
  (let* ((ob (current-buffer))
	 (obw  (get-buffer-window ob t))
	 win
	 )
    (save-excursion
      (if (or (null (setq win (get-buffer-window ad-return-value t)))
	      (null obw))
	  nil
	(select-window win)
	(goto-char (point-max))
	(select-window obw)
	))))
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