(defvar my-emacs-type
(if (string-match "XEmacs\\|Lucid" (emacs-version))
'xemacs
'fsf_emacs)
"The type of emacs running, either 'fsf_emacs' or 'xemacs'. Uses
'emacs-version' to determine type.")
(defvar my-location
(if (eq system-type 'windows-nt)
(if (string= (downcase (system-name)) "dogbone")
'home 'work) 'work) "My physical location, either 'work' or 'home'. Uses 'system-name' to
determine this.")
(defvar my-gnu-home
(if (eq system-type 'windows-nt)
(if (eq my-location 'home)
"c:/gnu" "d:/gnu") nil) "My root directory for GNU products on this system. Uses 'system-type' to
determine this.")
(defvar my-emacs-home
(if (eq system-type 'windows-nt)
(getenv "emacs_dir") (getenv "EMACS_HOME")) "The root directory for the emacs installation. Uses 'system-type' and
either the environment variable emacs_dir or EMACS_HOME to determine this.")
(defvar my-site-lisp
(concat my-emacs-home "/site-lisp")
"The directory where I add my additional lisp libraries and packages. Uses
'my-emacs-home' to determine this.")
(defvar my-unix-tools
(if (eq system-type 'windows-nt)
(if (eq my-location 'home)
'cygwin 'cygwin) 'unix) "My unix toolset. Either 'mks', 'cygwin' 'uwin', or 'unix'. Uses
'system-type' and 'my-location' to determine this. Note, uwin and unix is
untested.")
(defvar my-unix-bin
(if (eq system-type 'windows-nt)
(if (eq my-location 'home)
(if (eq my-unix-tools 'mks)
"c:/mks/mksnt" (if (eq my-unix-tools 'cygwin)
"c:/gnu/cygwin/bin" "/usr/bin")) (if (eq my-unix-tools 'mks)
"d:/mks/mksnt" (if (eq my-unix-tools 'cygwin)
"d:/gnu/cygwin/bin" "/usr/bin"))) "/usr/bin") "The bin directory for my unix tools. Uses 'system-type', 'my-location', and
'my-unix-tools' to determine this. Note that for cygwin, the path is in the
DOS format. This works because Emacs understands it, obviously, and cygwin
understands it.")
(defvar my-jdk-home
(if (eq my-location 'home)
"c:/java/jdk1.2.2"
"d:/java/jdk1.2.2")
"The root directory for the JDK installation. Uses 'my-location' to
determine this.")
(defvar my-jre-home
(concat my-jdk-home "/jre")
"The root directory for the JRE installation. Uses 'my-jdk-home' to
dtermine this.")
(defvar my-jpda-home
(if (eq my-location 'home)
"c:/java/jpda1.0"
"d:/java/jpda1.0")
"The root directory for the JPDA installation. Uses 'my-location' to
determine this.")
(defvar my-perl-home
(if (eq my-location 'home)
"c:/gnu/perl"
"d:/gnu/perl")
"The root directory for the Perl installation. Uses 'my-location' to
determine this.")
(setq exec-path (append (list (concat my-emacs-home "/bin")
my-unix-bin
(concat my-jdk-home "/bin")
(concat my-jre-home "/bin")
(concat my-jpda-home "/bin")
(concat my-perl-home "/bin")
) exec-path)
)
(setq custom-file (expand-file-name "~/.emacs-custom"))
(put 'narrow-to-region 'disabled nil)
(setq scroll-step 1)
(require 'info)
(load "jka-compr")
(setq font-lock-maximum-decoration '((t . 2)))
(if (eq my-emacs-type 'fsf_emacs)
(global-font-lock-mode t)
)
(autoload 'multi-mode "multi-mode" "Allow multiple major modes in a buffer" t)
(if (eq my-emacs-type 'fsf_emacs)
(progn
(require 'msb)
(setq msb-menu-cond
(cons '((string-match "\\.properties\\(<.*>\\)*$" (buffer-name))
600 "Properties Files (%d)")
msb-menu-cond))
(setq msb-menu-cond
(cons '((eq major-mode 'perl-mode) 590 "Perl Files (%d)")
msb-menu-cond))
(setq msb-menu-cond
(cons '((and (eq major-mode 'html-mode) 'no-multi)
580 "HTML Files (%d)")
msb-menu-cond))
(setq msb-menu-cond
(cons '((string-match "\\.jsp\\(<.*>\\)*$" (buffer-name))
570 "JSP Files (%d)")
msb-menu-cond))
(setq msb-menu-cond
(cons '((and (memq major-mode '(jde-mode java-mode)) 'no-multi)
500 "Java Files (%d)")
msb-menu-cond))
(setq msb-menu-cond
(cons '((memq major-mode '(c-mode c++-mode))
520 "C++ Source Files (%d)")
msb-menu-cond))
(setq msb-menu-cond
(cons '((string-match "\\.h\\(<.*>\\)*$" (buffer-name))
510 "C++ Header Files (%d)")
msb-menu-cond))
(setq msb-menu-cond
(cons '((eq major-mode 'idl-mode) 530 "IDL Files (%d)")
msb-menu-cond))
(setq msb-menu-cond
(cons '((and
(string-match "\\.\\(ini\\|cfg\\)\\(<.*>\\)*$"
(buffer-name))
'no-multi)
540 "Config Files (%d)")
msb-menu-cond))
(setq msb-menu-cond
(cons '((eq major-mode 'makefile-mode) 550 "Makefiles (%d)")
msb-menu-cond))
(setq msb-menu-cond
(cons '((eq major-mode 'sh-mode) 560 "Shell Scripts (%d)")
msb-menu-cond))
(msb-mode 1))
)
(add-to-list 'load-path (concat my-site-lisp "/cc-mode-5.26"))
(add-to-list 'Info-directory-list (concat my-site-lisp "/cc-mode-5.26"))
(require 'cc-mode)
(add-to-list 'auto-mode-alist '("\\.h$" . c++-mode))
(add-to-list 'auto-mode-alist '("\\.i$" . c++-mode))
(add-to-list 'auto-mode-alist '("\\.\\(p\\)*idl$" . idl-mode))
(load-library "idl-font-lock-1.3")
(if (eq my-unix-tools 'mks)
(progn
(require 'sh-script)
(add-to-list 'sh-alias-alist '(sh . ksh88))
))
(add-to-list 'auto-mode-alist '("\\(\\.\\)*profile$" . sh-mode))
(add-to-list 'auto-mode-alist '("\\.kshrc$" . sh-mode))
(setq auto-mode-alist
(append '(("\\.\\(exe\\|vsd\\|dll\\|com\\)$" . hexl-mode))
auto-mode-alist)
)
(if (eq my-unix-tools 'mks)
(progn
(setq path-separator ";")
(setq explicit-shell-file-name (concat my-unix-bin "/sh.exe"))
(setq explicit-sh.exe-args '("-Li"))
(setq shell-file-name (concat my-unix-bin "/sh.exe"))
(setq w32-quote-process-args t)
(setq shell-command-switch "-c"))
)
(if (eq my-unix-tools 'cygwin)
(progn
(setq explicit-shell-file-name (concat my-unix-bin "/bash.exe"))
(setq shell-file-name (concat my-unix-bin "/bash.exe"))
(setq w32-quote-process-args ?\")
(setq shell-command-switch "-c")
(setenv "PID" nil)
(load "comint")
(fset 'original-comint-exec-1 (symbol-function 'comint-exec-1))
(defun comint-exec-1 (name buffer command switches)
(let ((binary-process-input t)
(binary-process-output nil))
(original-comint-exec-1 name buffer command switches)))
)
)
(setq calendar-latitude +38)
(setq calendar-longitude -122.5)
(setq calendar-location-name "Ross, CA")
(line-number-mode t)
(column-number-mode t)
(display-time)
(if (eq system-type 'windows-nt)
(setq w32-downcase-file-names t)
)
(if (eq my-emacs-type 'fsf_emacs)
(progn
(pc-bindings-mode)
(pc-selection-mode))
)
(defvar my-igrep-dir "igrep-2.83")
(autoload (function igrep) my-igrep-dir
"*Run `grep` PROGRAM to match EXPRESSION in FILES..." t)
(autoload (function igrep-find) my-igrep-dir
"*Run `grep` via `find`..." t)
(autoload (function dired-do-igrep) my-igrep-dir
"*Run `grep` on the marked (or next prefix ARG) files." t)
(autoload (function dired-do-igrep-find) my-igrep-dir
"*Run `grep` via `find` on the marked (or next prefix ARG) directories." t)
(autoload (function grep) my-igrep-dir
"*Run `grep` PROGRAM to match EXPRESSION in FILES..." t)
(autoload (function egrep) my-igrep-dir
"*Run `egrep`..." t)
(autoload (function fgrep) my-igrep-dir
"*Run `fgrep`..." t)
(autoload (function agrep) my-igrep-dir
"*Run `agrep`..." t)
(autoload (function grep-find) my-igrep-dir
"*Run `grep` via `find`..." t)
(autoload (function egrep-find) my-igrep-dir
"*Run `egrep` via `find`..." t)
(autoload (function fgrep-find) my-igrep-dir
"*Run `fgrep` via `find`..." t)
(autoload (function agrep-find) my-igrep-dir
"*Run `agrep` via `find`..." t)
(autoload (function dired-do-grep) my-igrep-dir
"*Run `grep` on the marked (or next prefix ARG) files." t)
(autoload (function dired-do-grep-find) my-igrep-dir
"*Run `grep` via `find` on the marked (or next prefix ARG) directories." t)
(setq igrep-expression-quote-char ?')
(setq igrep-parenthesis-escape-char ?\\)
(setq igrep-program "egrep")
(setq igrep-expression-option "-e")
(setq igrep-read-options t)
(setq grep-null-device "/dev/null")
(setq grep-command "egrep -n")
(setq initial-scratch-message nil)
(if
(eq system-type 'windows-nt)
(progn
(add-to-list 'load-path (concat my-site-lisp "/ispell4"))
(autoload 'ispell-word "ispell4"
"Check spelling of word at or before point" t)
(global-set-key [(meta $)] 'ispell-word)
(autoload 'ispell-region "ispell4"
"Check spelling of every word in the region" t)
(autoload 'ispell-buffer "ispell4"
"Check spelling of every word in the buffer" t)
(autoload 'ispell-complete-word "ispell4"
"Complete word at or before point" t)
(setq ispell-command (concat my-site-lisp "/ispell4/exe/ispell.exe")
ispell-look-dictionary (concat my-site-lisp
"/ispell4/ispell.words")
ispell-look-command (concat my-site-lisp
"/ispell4/exe/look.exe")
ispell-command-options (list "-d"(concat my-site-lisp
"/ispell4/ispell.dict"))))
(autoload 'ispell-word "ispell"
"Check the spelling of word in buffer." t)
(global-set-key [(meta $)] 'ispell-word)
(autoload 'ispell-region "ispell"
"Check the spelling of region." t)
(autoload 'ispell-buffer "ispell"
"Check the spelling of buffer." t)
(autoload 'ispell-complete-word "ispell"
"Look up current word in dictionary and try to complete it." t)
(autoload 'ispell-change-dictionary "ispell"
"Change ispell dictionary." t)
(autoload 'ispell-message "ispell"
"Check spelling of mail message or news post.")
(autoload 'ispell-minor-mode "ispell"
"Toggle mode to automatically spell check words as they are typed in.")
)
(if (eq my-emacs-type 'fsf_emacs)
(progn
(add-to-list 'load-path (concat my-site-lisp "/gnuserv-2.1p1"))
(add-to-list 'exec-path (concat my-site-lisp "/gnuserv-2.1p1"))
(load-library "gnuserv")
(setq gnuserv-frame (selected-frame))
(gnuserv-start))
)
(require 'ediff)
(if (eq system-type 'windows-nt)
(setq ediff-grab-mouse nil)
)
(setq-default ediff-autostore-merges nil)
(setq-default ediff-control-frame-upward-shift 80)
(if
(eq system-type 'windows-nt)
(progn
(add-to-list 'load-path (concat my-site-lisp "/w32-print-1.3"))
(setq-default
w32-print-use-faces nil w32-print-zap-spool-file t w32-print-paper-type 'letter
w32-print-with-line-numbers t
w32-print-enable-keymappings nil w32-print-ps-preview nil w32-print-ps-destination (if (eq my-location 'home)
"lpt1"
"//romsvr1/hplj4050")
w32-print-ps-text-font-size 14.0
w32-print-psnup-path (concat my-site-lisp "/w32-print-1.3/bin")
w32-print-psnup-margin "0in"
w32-print-psnup-enable t
w32-print-gs-destination (if (eq my-location 'home)
"lpt1"
"//romsvr1/hplj4050")
w32-print-gs-device (if (eq my-location 'home) "deskjet" "ljet4")
w32-print-gs-device-dpi (if (eq my-location 'home) '300 '600)
w32-print-gs-version "6.01"
w32-print-gs-path (concat my-gnu-home "/ghostscript/gs6.01/bin")
w32-print-gs-view-path (concat my-gnu-home "/ghostscript/gsview")
w32-print-lpr-destination (if (eq my-location 'home)
"lpt1"
"//romsvr1/hplj4050")
w32-print-lpr-path (concat my-site-lisp "/w32-print-1.2/bin")
)
(load "w32-print")
)
()
)
(setq completion-ignore-case t)
(if (eq my-emacs-type 'fsf_emacs)
(progn
(load-library "bm-hcmplt-1.41")
(dynamic-completion-mode) (icomplete-mode) (bm-hcmplt-mode)
(partial-completion-mode t) )
)
(setq auto-mode-alist
(append '(("Makefile.*$" . makefile-mode)
("makefile.*$" . makefile-mode)
("\\.make$" . makefile-mode)
("\\.mak$" . makefile-mode))
auto-mode-alist)
)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
(add-hook 'find-file-hooks 'auto-insert)
(setq auto-insert-directory (expand-file-name "~/templates/"))
(if (eq my-emacs-type 'fsf_emacs)
(auto-insert-mode 1))
(defconst auto-insert-alist
'(("\\.c$" . "t.c")
("\\.cpp$" . "t.cpp")
("\\.cc$" . "t.cpp")
("\\.h$" . "t.h")
("\\.idl$" . "t.idl")
("\\.ksh$" . "t.ksh")
("\\.mak$" . "t.mak")
("[Mm]akefile*" . "t.mak"))
)
(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward-angle-brackets)
(if window-system (mouse-avoidance-mode 'animate))
(setq compile-command "make -f Makefile all")
(load-library "desktop")
(desktop-load-default)
(if (eq my-location 'home)
(setq gnus-select-method '(nntp "news.pacbell.net")) (setq gnus-select-method '(nntp "news.concentric.net"))) (setq gnus-save-newsrc-file nil) (add-hook 'nntp-server-opened-hook 'nntp-send-authinfo)
(add-to-list 'load-path (concat my-site-lisp "/semantic-1.1"))
(add-to-list 'load-path (concat my-site-lisp "/speedbar-0.10"))
(if (eq my-emacs-type 'fsf_emacs)
(progn
(autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
(autoload 'speedbar-get-focus "speedbar" "Jump to speedbar frame" t)
(define-key-after (lookup-key global-map [menu-bar tools])
[speedbar] '("Speedbar" . speedbar-frame-mode) [calendar])
(custom-set-variables
'(speedbar-show-unknown-files t))
)
)
(add-to-list 'exec-path (concat my-site-lisp "/jde-2.1.7/lisp")) (add-to-list 'load-path (concat my-site-lisp "/jde-2.1.7/lisp"))
(require 'jde)
(custom-set-variables
'(jde-global-classpath (list
(concat my-jdk-home "/lib")
(concat my-jre-home "/lib")
"./"))
'(jde-compile-option-command-line-args "-g")
'(jde-bug-jdk-directory my-jdk-home)
'(jde-db-source-directories (quote ("./")))
'(jde-db-debugger (quote ("JDEbug" "jdb" . "Executable")))
'(jde-bug-jpda-directory my-jpda-home))
(require 'generic-x)
(add-to-list 'auto-mode-alist '("\\.cmd\\(<.*>\\)*$" . bat-generic-mode))
(add-to-list 'auto-mode-alist
'("\\.properties\\(<.*>\\)*$" . default-generic-mode))
(defun jsp-mode ()
(interactive)
(multi-mode 1
'html-mode
'("<%" java-mode)
'("%>" html-mode)))
(setq auto-mode-alist
(cons '("\\.jsp$" . jsp-mode)
auto-mode-alist))
(autoload 'xrdb-mode "xrdb-mode-2.27" "Mode for editing X resource files" t)
(setq auto-mode-alist
(append '(("\\.Xdefaults$" . xrdb-mode)
("\\.Xenvironment$" . xrdb-mode)
("\\.Xresources$" . xrdb-mode)
("*.\\.ad$" . xrdb-mode)
)
auto-mode-alist))
(load-library "color-theme-5.0.1")
(add-to-list 'color-themes '(color-theme-GaryF "GaryF" "Gary Fong <gwfong@hotmail.com>"))
(load "recentf-1.16")
(recentf-mode 1)
(add-hook 'write-file-hooks 'time-stamp)
(if (eq my-unix-tools 'cygwin)
(load "cygwin32-mount")
)
(setq sgml-quick-keys t)
(defun my-after-init-settings ()
"My after initialization settings."
(interactive)
(color-theme-GaryF) (setenv "PATH" (build-path-string exec-path)) (setenv "SHELL" shell-file-name) (setenv "COMSPEC" shell-file-name) (setq-default tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68
72 76 80 64 88 92 96 100 104 108 112 116 120))
(setq-default tab-width 4) )
(defun my-emacs-startup-settings ()
"My emacs startup settings."
(interactive)
(message "my emacs startup settings")
)
(defun set-tab-stops-4 ()
"Sets the tab-stop-list to every 4 characters."
(interactive)
(setq tab-stop-list
'(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68
72 76 80 64 88 92 96 100 104 108 112 116 120))
)
(defun set-tab-width-4 ()
"Set the tab-width variable to 4."
(interactive)
(setq tab-width 4)
(redraw-display)
(message "tab-width = 4")
)
(defun set-tab-width-8 ()
"Set the tab-width variable to 8."
(interactive)
(setq tab-width 8)
(redraw-display)
(message "tab-width = 8")
)
(defun toggle-tab-width-4-8 ()
"Toggles between tab width of 4 and 8."
(interactive)
(if (eq tab-width '4)
(set-tab-width-8)
(set-tab-width-4))
)
(defun set-tab-stops-width-4 ()
"Sets tab stop list and width to 4."
(interactive)
(set-tab-stops-4) (setq tab-width 4)
)
(defun display-chars ()
"Displays characters produced by keys typed. Terminated by 3-sec timeout."
(interactive)
(let ((chars "")
(inhibit-quit t))
(message "Enter characters, terminated by 3-second timeout.")
(while (not (sit-for 3))
(setq chars (concat chars (list (read-char)))
quit-flag nil)) (message "Characters produced: %s" (key-description chars)))
)
(defun toggle-case-fold-search ()
"Toggles case-fold-search variable."
(interactive)
(if (eq case-fold-search nil)
(progn
(setq case-fold-search t)
(message "Setting case-fold-search to t"))
(setq case-fold-search nil)
(message "Setting case-fold-search to nil"))
)
(defun toggle-case-replace ()
"Toggles case-replace variable."
(interactive)
(if (eq case-replace nil)
(progn
(setq case-replace t)
(message "Setting case-replace to t"))
(setq case-replace nil)
(message "Setting case-replace to nil"))
)
(defun my-term-settings ()
"My terminal settings."
(if (eq system-type 'windows-nt)
(progn
(standard-display-8bit 127 254)
(set-input-mode nil nil 0)
(define-key function-key-map [backspace] "\177") (define-key function-key-map [tab] [?\t])
(define-key function-key-map [linefeed] [?\n])
(define-key function-key-map [clear] [11])
(define-key function-key-map [return] [13])
(define-key function-key-map [escape] [?\e])
(define-key function-key-map [Meta tab] [?\M-\t])
(define-key function-key-map [Meta linefeed] [?\M-\n])
(define-key function-key-map [Meta clear] [?\M-\013])
(define-key function-key-map [Meta return] [?\M-\015])
(define-key function-key-map [Meta escape] [?\M-\e])
(put 'backspace 'ascii-character 127)
(put 'delete 'ascii-character 127)
(put 'tab 'ascii-character ?\t)
(put 'linefeed 'ascii-character ?\n)
(put 'clear 'ascii-character 12)
(put 'return 'ascii-character 13)
(put 'escape 'ascii-character ?\e)))
)
(defun toggle-line-wrapping ()
"Toggles between line wrapping in the current buffer."
(interactive)
(if (eq truncate-lines nil)
(progn
(setq truncate-lines t)
(redraw-display)
(message "Setting truncate-lines to t"))
(setq truncate-lines nil)
(redraw-display)
(message "Setting truncate-lines to nil"))
)
(defun insert-c-function-header ()
"Inserts a C function header which conforms to Oacis standards."
(interactive)
(insert
"/******************************************************************************\n"
"*\n"
"* Function: \n"
"*\n"
"* Purpose: \n"
"*\n"
"* Params: \n"
"*\n"
"* Returns: \n"
"*\n"
"* Statuses: \n"
"*\n"
"******************************************************************************/\n"
"\n")
(message "Inserted C function header")
)
(defun insert-c++-function-header ()
"Inserts a C++ function header which conforms to Oacis standards."
(interactive)
(insert
"//-----------------------------------------------------------------------------\n"
"// Function:\t\n"
"// Purpose:\t\n"
"// Params:\t\t\n"
"// Returns:\t\n"
"// Exceptions:\t\n"
"// Precond:\t\n"
"// Postcond:\t\n"
"//-----------------------------------------------------------------------------\n"
"\n"
"return opname(argname) const throw(Err)\n"
"{\n"
"}\n"
"\n")
(message "Inserted C++ function header")
)
(defun insert-c++-class-header ()
"Inserts a C++ class header which conforms to Oacis standards."
(interactive)
(insert
"//-----------------------------------------------------------------------------\n"
"// Class:\t\t_class_\n"
"// Purpose:\t\n"
"//-----------------------------------------------------------------------------\n"
"\n")
(message "Inserted C++ class header")
)
(defun insert-c++-class ()
"Inserts a C++ class which conforms to Oacis standards."
(interactive)
(insert-c++-class-header)
(insert
"class _class_\n"
"{\n"
"public:\n"
"\n"
" // Constructor/destructor.\n"
" _class_();\n"
" virtual ~_class_();\n"
"\n"
"private:\n"
"\n"
" // Unused ctor and assignment op.\n"
" _class_(const _class_&);\n"
" _class_& operator=(const _class_&);\n"
"};\n"
"\n")
(message "Inserted C++ class")
)
(defun untabify-buffer ()
"Untabifies entire buffer."
(interactive)
(point-to-register 1)
(goto-char (point-min))
(untabify (point-min) (point-max))
(register-to-point 1)
)
(defun tabify-buffer ()
"Tabifies entire buffer."
(interactive)
(point-to-register 1)
(goto-char (point-min))
(tabify (point-min) (point-max))
(register-to-point 1)
)
(defun revert-buffer-yes ()
"Revert buffer with 'yes'."
(interactive)
(revert-buffer 'nil, t)
)
(defun toggle-file-rw-mode ()
"Toggles the R/W mode of the file associated with this buffer"
(interactive)
(if (eq buffer-read-only t)
(progn
(shell-command (concat "chmod +w " (buffer-file-name)))
(setq buffer-read-only nil)
)
(shell-command (concat "chmod -w " (buffer-file-name)))
(setq buffer-read-only t))
)
(defun build-path-string (pathList)
"Builds a path string from the given list of path substrings."
(setq path (car pathList)) (setq pathList (cdr pathList)) (if pathList
(concat (concat path path-separator) (build-path-string pathList))
path)
)
(defun my-info-mode-settings ()
"My info mode settings. Currently does nothing."
(interactive)
)
(defun my-font-lock-mode-settings ()
"My font-lock settings."
(interactive)
(setq font-lock-verbose nil)
(require 'lazy-lock)
(setq font-lock-support-mode 'lazy-lock-mode)
)
(defun my-lisp-mode-settings ()
"My lisp mode settings."
(interactive)
(set-tab-stops-width-4)
)
(defun my-emacs-lisp-mode-settings ()
"My emacs lisp mode settings."
(interactive)
(set-tab-stops-width-4)
)
(defun my-lisp-interaction-mode-settings ()
"My lisp interaction mode settings."
(interactive)
(set-tab-stops-width-4)
)
(defun my-dired-mode-settings ()
"My dired mode settings."
(interactive)
(if (eq system-type 'windows-nt)
(setq dired-chmod-program (concat my-unix-bin "/chmod.exe")))
)
(defun my-text-mode-settings ()
"My text mode settings."
(interactive)
(set-tab-stops-width-4)
)
(defun my-c-mode-common-settings ()
"My C/C++/ObjC/Java mode settings."
(interactive)
(c-set-style "stroustrup")
(set-tab-stops-width-4)
(setq c-echo-syntatic-information-p t)
(local-set-key [(control tab)] 'tab-to-tab-stop)
)
(defun my-c-mode-settings()
"My C mode settings. Currently does nothing."
(interactive)
)
(defun my-c++-mode-settings()
"My C++ mode settings. Currently does nothing."
(interactive)
)
(defun my-objc-mode-settings()
"My ObjectiveC mode settings. Currently does nothing."
(interactive)
)
(defun my-java-mode-settings()
"My Java mode settings. Currently does nothing."
(interactive)
)
(defun my-idl-mode-settings()
"My CORBA IDL mode settings. Currently does nothing."
(interactive)
)
(defun my-sh-mode-settings ()
"My shell script mode settings."
(interactive)
(sh-set-shell (file-name-sans-extension shell-file-name))
(set-tab-stops-width-4)
(local-set-key [(control tab)] 'tab-to-tab-stop)
)
(defun my-awk-mode-settings ()
"My AWK mode settings."
(interactive)
(c-set-style "stroustrup")
(set-tab-stops-width-4)
)
(defun my-sql-mode-settings ()
"My SQL mode settings."
(interactive)
(set-tab-stops-width-4)
)
(defun my-makefile-mode-settings()
"My Makefile mode settings."
(interactive)
(set-tab-stops-width-4)
)
(defun my-jde-mode-settings()
"My JDE mode settings."
(interactive)
(setq c-basic-offset 4)
(jde-run-set-applet-viewer "appletviewer")
(setq jde-classpath-separator ";")
)
(defun my-shell-mode-settings-mks()
"My shell mode settings for MKS. Currently does nothing."
(interactive)
)
(defun my-shell-mode-settings-cygwin()
"My shell mode settings for Cygwin."
(interactive)
(setq comint-scroll-show-maximum-output 'this)
(setq comint-completion-addsuffix t)
(setq comint-eol-on-send t)
(setq w32-quote-process-args ?\")
(make-variable-buffer-local 'comint-completion-addsuffix)
)
(defun my-perl-mode-settings()
"My Perl mode settings."
(interactive)
(set-tab-stops-width-4)
)
(defun my-html-mode-settings()
"My HTML mode settings."
(interactive)
(set-tab-stops-width-4)
)
(defun my-default-generic-mode-settings()
"My Default Generic Mode settings."
(interactive)
(set-tab-stops-width-4)
)
(defun my-sgml-mode-settings()
"My SGML Mode settings."
(interactive)
(set-tab-stops-width-4)
)
(defun color-theme-GaryF ()
"My default colors. I used 'color-theme-standard' as the basis for my theme."
(interactive)
(color-theme-install
'(color-theme-standard
((foreground-color . "black")
(background-color . "gray90")
(mouse-color . "black")
(cursor-color . "black")
(border-color . "black")
(background-mode . light))
((apropos-keybinding-face . underline)
(apropos-label-face . (face italic mouse-face highlight))
(apropos-match-face . secondary-selection)
(apropos-property-face . bold-italic)
(apropos-symbol-face . bold)
(goto-address-mail-face . italic)
(goto-address-mail-mouse-face . secondary-selection)
(goto-address-url-face . bold)
(goto-address-url-mouse-face . highlight)
(help-highlight-face . underline)
(list-matching-lines-face . bold)
(view-highlight-face . highlight))
(bold ((t (:bold t))))
(bold-italic ((t (:bold t :italic t))))
(calendar-today-face ((t (:underline t))))
(cperl-array-face ((t (:foreground "Blue" :background "lightyellow2" :bold t))))
(cperl-hash-face ((t (:foreground "Red" :background "lightyellow2" :bold t :italic t))))
(cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
(custom-button-face ((t (nil))))
(custom-changed-face ((t (:foreground "white" :background "blue"))))
(custom-documentation-face ((t (nil))))
(custom-face-tag-face ((t (:underline t))))
(custom-group-tag-face ((t (:foreground "blue" :underline t))))
(custom-group-tag-face-1 ((t (:foreground "red" :underline t))))
(custom-invalid-face ((t (:foreground "yellow" :background "red"))))
(custom-modified-face ((t (:foreground "white" :background "blue"))))
(custom-rogue-face ((t (:foreground "pink" :background "black"))))
(custom-saved-face ((t (:underline t))))
(custom-set-face ((t (:foreground "blue" :background "white"))))
(custom-state-face ((t (:foreground "dark green"))))
(custom-variable-button-face ((t (:bold t :underline t))))
(custom-variable-tag-face ((t (:foreground "blue" :underline t))))
(default ((t (nil))))
(diary-face ((t (:foreground "red"))))
(ediff-current-diff-face-A ((t (:foreground "firebrick" :background "pale green"))))
(ediff-current-diff-face-Ancestor ((t (:foreground "Black" :background "VioletRed"))))
(ediff-current-diff-face-B ((t (:foreground "DarkOrchid" :background "Yellow"))))
(ediff-current-diff-face-C ((t (:foreground "Navy" :background "Pink"))))
(ediff-even-diff-face-A ((t (:foreground "Black" :background "light grey"))))
(ediff-even-diff-face-Ancestor ((t (:foreground "White" :background "Grey"))))
(ediff-even-diff-face-B ((t (:foreground "White" :background "Grey"))))
(ediff-even-diff-face-C ((t (:foreground "Black" :background "light grey"))))
(ediff-fine-diff-face-A ((t (:foreground "Navy" :background "sky blue"))))
(ediff-fine-diff-face-Ancestor ((t (:foreground "Black" :background "Green"))))
(ediff-fine-diff-face-B ((t (:foreground "Black" :background "cyan"))))
(ediff-fine-diff-face-C ((t (:foreground "Black" :background "Turquoise"))))
(ediff-odd-diff-face-A ((t (:foreground "White" :background "Grey"))))
(ediff-odd-diff-face-Ancestor ((t (:foreground "Black" :background "light grey"))))
(ediff-odd-diff-face-B ((t (:foreground "Black" :background "light grey"))))
(ediff-odd-diff-face-C ((t (:foreground "White" :background "Grey"))))
(eshell-ls-archive-face ((t (:foreground "Orchid" :bold t))))
(eshell-ls-backup-face ((t (:foreground "OrangeRed"))))
(eshell-ls-clutter-face ((t (:foreground "OrangeRed" :bold t))))
(eshell-ls-directory-face ((t (:foreground "Blue" :bold t))))
(eshell-ls-executable-face ((t (:foreground "ForestGreen" :bold t))))
(eshell-ls-missing-face ((t (:foreground "Red" :bold t))))
(eshell-ls-product-face ((t (:foreground "OrangeRed"))))
(eshell-ls-readonly-face ((t (:foreground "Brown"))))
(eshell-ls-special-face ((t (:foreground "Magenta" :bold t))))
(eshell-ls-symlink-face ((t (:foreground "DarkCyan" :bold t))))
(eshell-ls-unreadable-face ((t (:foreground "Grey30"))))
(eshell-prompt-face ((t (:foreground "Red" :bold t))))
(eshell-test-failed-face ((t (:foreground "OrangeRed" :bold t))))
(eshell-test-ok-face ((t (:foreground "Green" :bold t))))
(excerpt ((t (:italic t))))
(fixed ((t (:bold t))))
(flyspell-duplicate-face ((t (:foreground "Gold3" :bold t :underline t))))
(flyspell-incorrect-face ((t (:foreground "OrangeRed" :bold t :underline t))))
(font-lock-builtin-face ((t (:foreground "Orchid"))))
(font-lock-comment-face ((t (:foreground "Firebrick"))))
(font-lock-constant-face ((t (:foreground "DarkGoldenrod4"))))
(font-lock-function-name-face ((t (:foreground "Blue"))))
(font-lock-keyword-face ((t (:foreground "Purple"))))
(font-lock-string-face ((t (:foreground "SaddleBrown"))))
(font-lock-type-face ((t (:foreground "ForestGreen"))))
(font-lock-variable-name-face ((t (:foreground "DarkGoldenrod"))))
(font-lock-warning-face ((t (:foreground "Red" :bold t))))
(gnus-cite-attribution-face ((t (:italic t))))
(gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
(gnus-cite-face-10 ((t (:foreground "medium purple"))))
(gnus-cite-face-11 ((t (:foreground "turquoise"))))
(gnus-cite-face-2 ((t (:foreground "firebrick"))))
(gnus-cite-face-3 ((t (:foreground "dark green"))))
(gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
(gnus-cite-face-5 ((t (:foreground "dark khaki"))))
(gnus-cite-face-6 ((t (:foreground "dark violet"))))
(gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
(gnus-cite-face-8 ((t (:foreground "magenta"))))
(gnus-cite-face-9 ((t (:foreground "violet"))))
(gnus-emphasis-bold ((t (:bold t))))
(gnus-emphasis-bold-italic ((t (:bold t :italic t))))
(gnus-emphasis-italic ((t (:italic t))))
(gnus-emphasis-underline ((t (:underline t))))
(gnus-emphasis-underline-bold ((t (:bold t :underline t))))
(gnus-emphasis-underline-bold-italic ((t (:bold t :italic t :underline t))))
(gnus-emphasis-underline-italic ((t (:italic t :underline t))))
(gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
(gnus-group-mail-1-face ((t (:foreground "DeepPink3" :bold t))))
(gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
(gnus-group-mail-2-face ((t (:foreground "HotPink3" :bold t))))
(gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
(gnus-group-mail-3-face ((t (:foreground "magenta4" :bold t))))
(gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
(gnus-group-mail-low-face ((t (:foreground "DeepPink4" :bold t))))
(gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
(gnus-group-news-1-face ((t (:foreground "ForestGreen" :bold t))))
(gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
(gnus-group-news-2-face ((t (:foreground "CadetBlue4" :bold t))))
(gnus-group-news-3-empty-face ((t (nil))))
(gnus-group-news-3-face ((t (:bold t))))
(gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
(gnus-group-news-low-face ((t (:foreground "DarkGreen" :bold t))))
(gnus-header-content-face ((t (:foreground "indianred4" :italic t))))
(gnus-header-from-face ((t (:foreground "red3"))))
(gnus-header-name-face ((t (:foreground "maroon"))))
(gnus-header-newsgroups-face ((t (:foreground "MidnightBlue" :italic t))))
(gnus-header-subject-face ((t (:foreground "red4"))))
(gnus-signature-face ((t (:italic t))))
(gnus-splash-face ((t (:foreground "ForestGreen"))))
(gnus-summary-cancelled-face ((t (:foreground "yellow" :background "black"))))
(gnus-summary-high-ancient-face ((t (:foreground "RoyalBlue" :bold t))))
(gnus-summary-high-read-face ((t (:foreground "DarkGreen" :bold t))))
(gnus-summary-high-ticked-face ((t (:foreground "firebrick" :bold t))))
(gnus-summary-high-unread-face ((t (:bold t))))
(gnus-summary-low-ancient-face ((t (:foreground "RoyalBlue" :italic t))))
(gnus-summary-low-read-face ((t (:foreground "DarkGreen" :italic t))))
(gnus-summary-low-ticked-face ((t (:foreground "firebrick" :italic t))))
(gnus-summary-low-unread-face ((t (:italic t))))
(gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
(gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
(gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
(gnus-summary-normal-unread-face ((t (nil))))
(gnus-summary-selected-face ((t (:underline t))))
(highlight ((t (:background "darkseagreen2"))))
(highlight-changes-delete-face ((t (:foreground "red" :underline t))))
(highlight-changes-face ((t (:foreground "red"))))
(highline-face ((t (:background "paleturquoise"))))
(holiday-face ((t (:background "pink"))))
(info-menu-5 ((t (:underline t))))
(info-node ((t (:bold t :italic t))))
(info-xref ((t (:bold t))))
(italic ((t (:italic t))))
(makefile-space-face ((t (:background "hotpink"))))
(message-cited-text-face ((t (:foreground "red"))))
(message-header-cc-face ((t (:foreground "MidnightBlue"))))
(message-header-name-face ((t (:foreground "cornflower blue"))))
(message-header-newsgroups-face ((t (:foreground "blue4" :bold t :italic t))))
(message-header-other-face ((t (:foreground "steel blue"))))
(message-header-subject-face ((t (:foreground "navy blue" :bold t))))
(message-header-to-face ((t (:foreground "MidnightBlue" :bold t))))
(message-header-xheader-face ((t (:foreground "blue"))))
(message-separator-face ((t (:foreground "brown"))))
(modeline ((t (:foreground "white" :background "black"))))
(region ((t (:background "gray"))))
(secondary-selection ((t (:background "paleturquoise"))))
(show-paren-match-face ((t (:background "turquoise"))))
(show-paren-mismatch-face ((t (:foreground "white" :background "purple"))))
(speedbar-button-face ((t (:foreground "green4"))))
(speedbar-directory-face ((t (:foreground "blue4"))))
(speedbar-file-face ((t (:foreground "cyan4"))))
(speedbar-highlight-face ((t (:background "green"))))
(speedbar-selected-face ((t (:foreground "red" :underline t))))
(speedbar-tag-face ((t (:foreground "brown"))))
(term-black ((t (:foreground "black"))))
(term-blackbg ((t (:background "black"))))
(term-blue ((t (:foreground "blue"))))
(term-bluebg ((t (:background "blue"))))
(term-bold ((t (:bold t))))
(term-cyan ((t (:foreground "cyan"))))
(term-cyanbg ((t (:background "cyan"))))
(term-default-bg ((t (nil))))
(term-default-bg-inv ((t (nil))))
(term-default-fg ((t (nil))))
(term-default-fg-inv ((t (nil))))
(term-green ((t (:foreground "green"))))
(term-greenbg ((t (:background "green"))))
(term-invisible ((t (nil))))
(term-invisible-inv ((t (nil))))
(term-magenta ((t (:foreground "magenta"))))
(term-magentabg ((t (:background "magenta"))))
(term-red ((t (:foreground "red"))))
(term-redbg ((t (:background "red"))))
(term-underline ((t (:underline t))))
(term-white ((t (:foreground "white"))))
(term-whitebg ((t (:background "white"))))
(term-yellow ((t (:foreground "yellow"))))
(term-yellowbg ((t (:background "yellow"))))
(underline ((t (:underline t))))
(vcursor ((t (:foreground "blue" :background "cyan" :underline t))))
(vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
(vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
(vhdl-font-lock-enumvalue-face ((t (:foreground "Gold4"))))
(vhdl-font-lock-function-face ((t (:foreground "Orchid4"))))
(vhdl-font-lock-prompt-face ((t (:foreground "Red" :bold t))))
(vhdl-font-lock-reserved-words-face ((t (:foreground "Orange" :bold t))))
(vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
(vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
(vhdl-speedbar-architecture-selected-face ((t (:foreground "Blue" :underline t))))
(vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
(vhdl-speedbar-configuration-selected-face ((t (:foreground "DarkGoldenrod" :underline t))))
(vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
(vhdl-speedbar-entity-selected-face ((t (:foreground "ForestGreen" :underline t))))
(vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
(vhdl-speedbar-instantiation-selected-face ((t (:foreground "Brown" :underline t))))
(vhdl-speedbar-package-face ((t (:foreground "Grey50"))))
(vhdl-speedbar-package-selected-face ((t (:foreground "Grey50" :underline t))))
(viper-minibuffer-emacs-face ((t (:foreground "Black" :background "darkseagreen2"))))
(viper-minibuffer-insert-face ((t (:foreground "Black" :background "pink"))))
(viper-minibuffer-vi-face ((t (:foreground "DarkGreen" :background "grey"))))
(viper-replace-overlay-face ((t (:foreground "Black" :background "darkseagreen2"))))
(viper-search-face ((t (:foreground "Black" :background "khaki"))))
(widget-button-face ((t (:bold t))))
(widget-button-pressed-face ((t (:foreground "red"))))
(widget-documentation-face ((t (:foreground "dark green"))))
(widget-field-face ((t (:background "gray85"))))
(widget-inactive-face ((t (:foreground "dim gray"))))
(widget-single-line-field-face ((t (:background "gray85"))))))
)
(add-hook 'after-init-hook 'my-after-init-settings)
(add-hook 'emacs-startup-hook 'my-emacs-startup-settings)
(add-hook 'term-setup-hook 'my-term-settings)
(add-hook 'Info-mode-hook 'my-info-mode-settings)
(add-hook 'c-mode-common-hook 'my-c-mode-common-settings)
(add-hook 'c-mode-hook 'my-c-mode-settings)
(add-hook 'c++-mode-hook 'my-c++-mode-settings)
(add-hook 'objc-mode-hook 'my-objc-mode-settings)
(add-hook 'java-mode-hook 'my-java-mode-settings)
(add-hook 'idl-mode-hook 'my-idl-mode-settings)
(add-hook 'dired-load-hook 'my-dired-mode-settings)
(add-hook 'text-mode-hook 'my-text-mode-settings)
(add-hook 'sh-mode-hook 'my-sh-mode-settings)
(add-hook 'lisp-mode-hook 'my-lisp-mode-settings)
(add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-settings)
(add-hook 'lisp-interaction-mode-hook 'my-lisp-interaction-mode-settings)
(add-hook 'font-lock-mode-hook 'my-font-lock-mode-settings)
(add-hook 'sql-mode-hook 'my-sql-mode-settings)
(add-hook 'makefile-mode-hook 'my-makefile-mode-settings)
(add-hook 'jde-mode-hook 'my-jde-mode-settings)
(add-hook 'perl-mode-hook 'my-perl-mode-settings)
(cond
((eq my-unix-tools 'mks)
(add-hook 'shell-mode-hook 'my-shell-mode-settings-mks))
((eq my-unix-tools 'cygwin)
(add-hook 'shell-mode-hook 'my-shell-mode-settings-cygwin))
)
(add-hook 'default-generic-mode-hooks 'my-default-generic-mode-settings)
(add-hook 'sgml-mode-hooks 'my-sgml-mode-settings)
(global-set-key "\C-s" 'isearch-forward-regexp)
(global-set-key "\M-s" 'isearch-forward)
(global-set-key "\C-r" 'isearch-backward-regexp)
(global-set-key "\M-r" 'isearch-backward)
(global-set-key "\M-%" 'query-replace-regexp)
(global-set-key "\M-q" 'append-next-kill)
(global-set-key [(meta backspace)] 'backward-kill-word)
(global-set-key [f1] 'goto-line)
(global-set-key [(shift f1)] 'occur)
(global-set-key [(control f1)] 'set-variable)
(global-set-key [(meta f1)] 'compare-windows)
(global-set-key [f2] 'toggle-tab-width-4-8)
(global-set-key [(shift f2)] 'toggle-case-fold-search)
(global-set-key [(control f2)] 'toggle-case-replace)
(global-set-key [(meta f2)] 'toggle-line-wrapping)
(global-set-key [f3] 'insert-c++-function-header)
(global-set-key [(shift f3)] 'insert-c++-class-header)
(global-set-key [(control f3)] 'auto-insert)
(global-set-key [(meta f3)] 'insert-c++-class)
(global-set-key [f4] 'toggle-file-rw-mode)
(global-set-key [(shift f4)] 'revert-buffer-yes)
(global-set-key [(control f4)] 'untabify-buffer)
(global-set-key [(meta f4)] 'tabify-buffer)
(global-set-key [f5] 'tags-search)
(global-set-key [(shift f5)] 'tags-query-replace)
(global-set-key [(control f5)] 'list-tags)
(global-set-key [(meta f5)] 'tags-apropos)
(global-set-key [(control meta f5)] 'visit-tags-table)
(global-set-key [(control f12)] 'advertised-undo)
(global-set-key [(control right)] 'scroll-left)
(global-set-key [(control left)] 'scroll-right)
(global-set-key [prior] 'scroll-down)
(global-set-key [clear] 'recenter)
(global-set-key [next] 'scroll-up)
(define-key function-key-map [(control kp-home)] [(control home)])
(define-key function-key-map [(control kp-end)] [(control end)])
(define-key function-key-map [(control kp-prior)] [(control prior)])
(define-key function-key-map [(control kp-next)] [(control next)])
(define-key function-key-map [(control kp-left)] [(control left)])
(define-key function-key-map [(control kp-right)] [(control right)])
(define-key function-key-map [(control kp-up)] [(control up)])
(define-key function-key-map [(control kp-down)] [(control down)])
(define-key function-key-map [(meta kp-home)] [(meta home)])
(define-key function-key-map [(meta kp-end)] [(meta end)])
(define-key function-key-map [(meta kp-prior)] [(meta prior)])
(define-key function-key-map [(meta kp-next)] [(meta next)])
(define-key function-key-map [(control meta kp-home)] [(control meta home)])
(define-key function-key-map [(control meta kp-end)] [(control meta end)])
(define-key function-key-map [(control meta kp-prior)] [(control meta prior)])
(define-key function-key-map [(control meta kp-next)] [(control meta next)])
(global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
(global-set-key [vertical-scroll-bar mouse-2] 'scroll-bar-scroll-up)
(global-set-key [vertical-scroll-bar drag-mouse-2] 'scroll-bar-scroll-up)
(global-unset-key [vertical-scroll-bar down-mouse-2])
(global-set-key [vertical-scroll-bar mouse-3] 'scroll-bar-scroll-down)
(global-set-key [vertical-scroll-bar drag-mouse-3] 'scroll-bar-scroll-down)
(cond
((and (eq system-type 'usg-unix-v)
(eq my-emacs-type 'fsf_emacs))
(define-key menu-bar-print-menu [ps-print-region]
'("Postscript Print Region" . ps-print-region))
(define-key menu-bar-print-menu [ps-print-buffer]
'("Postscript Print Buffer" . ps-print-buffer)))
)
|