;; Note that 15 July 2002 Blair added ESS support, keybindings ;; Blair's changes (auto-fill-mode 1) ;; We'll try to add ESS support and keybindings here... ; do not use system default settings if you prefer ; (setq inhibit-default-init t) (load "/home/helpdesk/trial/ess/ess-site") ; if you want to set an ess-directory, change the following line. ; ( setq-default ess-directory nil) ; to something like: ( setq-default ess-directory (getenv "HOME")) ; press F1 to show help, in both command window and script window (define-key ess-mode-map (kbd "") (quote ess-display-help-on-object)) (define-key inferior-ess-mode-map (kbd "") (quote ess-display-help-on-object)) ; press HOME to go to the beginning of the command. (After > ) (define-key inferior-ess-mode-map (kbd "") (quote comint-bol-or-process-mark)) ; Under gnome, C-Up/Down can not be used. So, use Alt-Up/Down (define-key inferior-ess-mode-map (kbd "") (quote comint-previous-input)) (define-key inferior-ess-mode-map (kbd "") (quote comint-next-input)) ; define F5 to turn off graphics ; define F6 to return to editing buffer ; define F7 to eval function (define-key ess-mode-map (kbd "") (quote ess-eval-function)) ; press F9 for evaluate region (define-key ess-mode-map (kbd "") (quote ess-eval-line-and-step)) ; press F10 for evaluate region (define-key ess-mode-map (kbd "") (quote ess-eval-region)) ; press F11 to evaluate buffer ; because of different keymap, F11 might be F11 or SunF36, define both. ; hope that it will not cause trouble. (define-key ess-mode-map (kbd "") (quote ess-eval-buffer)) (define-key ess-mode-map (kbd "") (quote ess-eval-buffer)) ; press F12 to go to the end of command window (define-key inferior-ess-mode-map (kbd "") (quote comint-show-maximum-output)) (define-key ess-mode-map (kbd "") (quote ess-switch-to-end-of-ESS)) (define-key inferior-ess-mode-map (kbd "") (quote comint-show-maximum-output)) (define-key ess-mode-map (kbd "") (quote ess-switch-to-end-of-ESS)) ;; Time-stamp: <2000-06-21 20:33:44 gfong> ;;----------------------------------------------------------------------------- ;; Environment Variables ;; --------------------- ;; emacs_dir : Where emacs is installed on WindowsNT. Affects ;; my-emacs-home. ;; EMACS_HOME : Where emacs is installed on Unix. Afects my-emacs-home. ;; PATH : Execution path. Affects exec-path ;; EMACSPATH : Additional execution path appended to PATH. Affects ;; exec-path. ;; EMACSLOADPATH : Emacs load library path. Affects load-path. ;; SHELL : Shell invocation command. Affects shell-file-name. ;; Others : Others that I don't care about right now: ;; EMACSDATA, EMACSDOC, EMACSLOCKDIR, TERM ;; ;; Windows Registry ;; ---------------- ;; REGEDIT4 ;; [HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs] ;; "emacs_dir"="d:\\gnu\\emacs-20.6" ;; "EMACSDATA"="%emacs_dir%/etc" ;; "EMACSDOC"="%emacs_dir%/etc" ;; "EMACSLOADPATH"="%emacs_dir%/site-lisp;%emacs_dir%/lisp;%emacs_dir%/leim" ;; "EMACSLOCKDIR"="%emacs_dir%/lock" ;; "EMACSPATH"="%emacs_dir%/bin" ;; "SHELL"="%emacs_dir%/bin/cmdproxy.exe" ;; "TERM"="cmd" ;; "Emacs.FONT"="-*-Courier New-normal-r-*-*-12-*-*-*-c-*-*" ;; [HKEY_CLASSES_ROOT\*\Shell\Edit_with_Emacs] ;; @="Edit with &GNU Emacs" ;; [HKEY_CLASSES_ROOT\*\Shell\Edit_with_Emacs\command] ;; @="D:\\Gnu\\emacs-20.6\\site-lisp\\gnuserv-2.1p1\\gnuclientw.exe -F -q \"%1\"" ;;----------------------------------------------------------------------------- ;; To Do: ;; o Find a better JSP mode. The multi-mode thing just isn't working out. ;; o Get this to work with uwin (but I hate uwin, so why would I do this) ;; o Get this to work with Sun and Linux ;; o Get this to work with XEmacs, both unix and native WindowsNT ;; o Find a more flexible way to deal with my project development paths ;; which change very often. ;; o Implement the automatic ~/.emacs recompiler code that I saw somewhere ;; on the web. ;; o Get RMAIL and MIME attachments working. ;;----------------------------------------------------------------------------- (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 ; home NT system 'work) ; work NT system 'work) ; unix system "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" ; home NT system "d:/gnu") ; work NT system nil) ; unix system "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") ; NT system (getenv "EMACS_HOME")) ; unix system "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 ; home NT system 'cygwin) ; work NT system 'unix) ; unix system "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" ; home NT system w/mks (if (eq my-unix-tools 'cygwin) "c:/gnu/cygwin/bin" ; home NT system w/cygwin "/usr/bin")) ; home NT system w/UWIN (if (eq my-unix-tools 'mks) "d:/mks/mksnt" ; work NT system w/mks (if (eq my-unix-tools 'cygwin) "d:/gnu/cygwin/bin" ; work NT system w/cygwin "/usr/bin"))) ; work NT system w/UWIN "/usr/bin") ; unix system "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.") ;;----------------------------------------------------------------------------- ;; GENERAL SETTINGS ;;----------------------------------------------------------------------------- ;; Initialize exec-path. exec-path = PATH + HKLM\Software\Gnu\Emacs\EMACSPATH ;; then modified here in this statement. Example below: ;;(setq exec-path (append (append '("pre" "pend") exec-path) '("ap" "pend"))) ;; Prepend execution path with known paths in a known order. It's assumed that ;; Windows system directories will have already been assigned to exec-path. (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") ) ; <<== Don't delete this exec-path) ) ;; Initialize load-path. load-path = HKLM\Software\Gnu\Emacs\EMACSLOADPATH. ;; If my-site-lisp wasn't /site-lisp, then I would have to add it ;; to the load-path below. ;;(add-to-list 'load-path 'my-site-lisp) ;; Set custom-file so that when the custom package adds something, it doesn't ;; add it to this file. (setq custom-file (expand-file-name "~/.emacs-custom")) ;; Disable narrowing, whatever the hell it is. (put 'narrow-to-region 'disabled nil) ;; Scrolling (setq scroll-step 1) ;; For modifying Info stuff. (require 'info) ;;----------------------------------------------------------------------------- ;; PACKAGE SETTINGS ;;----------------------------------------------------------------------------- ;; Read/write/load compressed files (.Z, .tgz, .gz, .bz2). Note, the handling ;; of archive files (.arc, .lzh, .zip, .zoo) is already loaded (via arc-mode). (load "jka-compr") ;; Font Lock. Set decoration level to 2 and turn it on globally. (setq font-lock-maximum-decoration '((t . 2))) (if (eq my-emacs-type 'fsf_emacs) (global-font-lock-mode t) ) ;; Muli-mode. Load it when needed. (autoload 'multi-mode "multi-mode" "Allow multiple major modes in a buffer" t) ;; Mouse select buffer. Add more file descriminations. Note that the ;; string-match's take into account the uniquify'ed buffer name. (if (eq my-emacs-type 'fsf_emacs) (progn (require 'msb) ;; Properies files (setq msb-menu-cond (cons '((string-match "\\.properties\\(<.*>\\)*$" (buffer-name)) 600 "Properties Files (%d)") msb-menu-cond)) ;; Perl files (setq msb-menu-cond (cons '((eq major-mode 'perl-mode) 590 "Perl Files (%d)") msb-menu-cond)) ;; HTML files (setq msb-menu-cond (cons '((and (eq major-mode 'html-mode) 'no-multi) 580 "HTML Files (%d)") msb-menu-cond)) ;; JSP files (setq msb-menu-cond (cons '((string-match "\\.jsp\\(<.*>\\)*$" (buffer-name)) 570 "JSP Files (%d)") msb-menu-cond)) ;; JDE and Java files (setq msb-menu-cond (cons '((and (memq major-mode '(jde-mode java-mode)) 'no-multi) 500 "Java Files (%d)") msb-menu-cond)) ;; C++ Source files (setq msb-menu-cond (cons '((memq major-mode '(c-mode c++-mode)) 520 "C++ Source Files (%d)") msb-menu-cond)) ;; C++ Header files (must come after C++ Source files) (setq msb-menu-cond (cons '((string-match "\\.h\\(<.*>\\)*$" (buffer-name)) 510 "C++ Header Files (%d)") msb-menu-cond)) ;; IDL files (setq msb-menu-cond (cons '((eq major-mode 'idl-mode) 530 "IDL Files (%d)") msb-menu-cond)) ;; Config files (setq msb-menu-cond (cons '((and (string-match "\\.\\(ini\\|cfg\\)\\(<.*>\\)*$" (buffer-name)) 'no-multi) 540 "Config Files (%d)") msb-menu-cond)) ;; Makefile files (setq msb-menu-cond (cons '((eq major-mode 'makefile-mode) 550 "Makefiles (%d)") msb-menu-cond)) ;; Shell scripts (setq msb-menu-cond (cons '((eq major-mode 'sh-mode) 560 "Shell Scripts (%d)") msb-menu-cond)) ;; Turn msb on (msb-mode 1)) ) ;; CC Mode (C/C++/ObjC/Java/CORBA IDL,Pike) (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") ;; Shell-script mode. For MKS, using sh.exe actually means using KSH, not ;; Bourne. (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)) ;; Associate certain binary files to hexl-mode (setq auto-mode-alist (append '(("\\.\\(exe\\|vsd\\|dll\\|com\\)$" . hexl-mode)) auto-mode-alist) ) ;; Shell mode. The actual shell is set here instead of inherited from the ;; environment/registry. The settings are based upon the unix tools package ;; that is in effect. It is assumed that the path (or load-exec) has been setup ;; properly for correct execution of the shell. Note, though shell-file-name ;; defined to my shell of choice, there are some apps, like w32-print, which ;; override it and use cmdproxy.exe. (if (eq my-unix-tools 'mks) (progn ;; General shell settings (setq path-separator ";") ;; Interactive shell (setq explicit-shell-file-name (concat my-unix-bin "/sh.exe")) (setq explicit-sh.exe-args '("-Li")) ;; Subprocesses invoked via the shell (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 ;; General shell settings (setq explicit-shell-file-name (concat my-unix-bin "/bash.exe")) ;; (setq explicit-bash.exe-args '("--login")) ; doesn't work!? ;; Subprocesses invoked via the shell (setq shell-file-name (concat my-unix-bin "/bash.exe")) (setq w32-quote-process-args ?\") (setq shell-command-switch "-c") ;; The rest comes straight out of the Cygwin FAQ. (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))) ) ) ;; Initialize sunrise/sunset settings. (setq calendar-latitude +38) (setq calendar-longitude -122.5) (setq calendar-location-name "Ross, CA") ;; Turn on line/column number modes. (line-number-mode t) (column-number-mode t) (display-time) ;; Filename case-sensitivity. For Windows systems only. (if (eq system-type 'windows-nt) (setq w32-downcase-file-names t) ) ;; PC keyboard emulation. (if (eq my-emacs-type 'fsf_emacs) (progn (pc-bindings-mode) (pc-selection-mode)) ) ;; IGrep settings (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) ;; Grep settings (setq grep-null-device "/dev/null") (setq grep-command "egrep -n") ;; Scratch buffer settings (setq initial-scratch-message nil) ;; ISpell4 (if ;; Windows NT (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")))) ;; Unix (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.") ) ;; GNU Server. Use this one over Emacs Server. (if (eq my-emacs-type 'fsf_emacs) (progn (add-to-list 'load-path (concat my-site-lisp "/gnuserv-2.1p1")) ;; Modify exec-path to find gnuserv.exe. (add-to-list 'exec-path (concat my-site-lisp "/gnuserv-2.1p1")) (load-library "gnuserv") (setq gnuserv-frame (selected-frame)) (gnuserv-start)) ) ;; Emacs Server (use GNU Server instead) ;;(if (and (eq my-emacs-type 'fsf_emacs) ;; (eq system-type 'usg-unix-v)) ;; (progn ;; (load-library "server") ;; (server-edit))) ;; EDiff settings. (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) ;; Printing. For Windows, using w32-print. For Unix, using built-in. (if ;; Win32 (eq system-type 'windows-nt) (progn (add-to-list 'load-path (concat my-site-lisp "/w32-print-1.3")) (setq-default ;; General w32-print-use-faces nil ; disable color, etc w32-print-zap-spool-file t ; delete temp file w32-print-paper-type 'letter w32-print-with-line-numbers t w32-print-enable-keymappings nil ; disable keyboard shortcuts ;; Postscript w32-print-ps-preview nil ; disable print preview 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 ;; Ghostscript 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") ;; Plain old printer 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") ) ;; Let's use it (load "w32-print") ) ;; Unix system. Nothing to do since I can't print from unix. () ) ;; Completion settings. Turn it on. (setq completion-ignore-case t) (if (eq my-emacs-type 'fsf_emacs) (progn (load-library "bm-hcmplt-1.41") (dynamic-completion-mode) ; completion.el (icomplete-mode) ; icomplete.el (bm-hcmplt-mode) (partial-completion-mode t) ; complete.el ) ) ;; Makefile mode. Add more files to the list of recognized files. (setq auto-mode-alist (append '(("Makefile.*$" . makefile-mode) ("makefile.*$" . makefile-mode) ("\\.make$" . makefile-mode) ("\\.mak$" . makefile-mode)) auto-mode-alist) ) ;; Upper/lower case stuff. This is disabled by default. I want it enabled. (put 'upcase-region 'disabled nil) (put 'downcase-region 'disabled nil) ;; Auto-insert mode. (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")) ) ;; Uniquify buffer names. This makes identical buffer names unique via its ;; directory path. (require 'uniquify) (setq uniquify-buffer-name-style 'post-forward-angle-brackets) ;; Mouse avoidance mode. This moves the mouse cursor away from the text ;; cursor so that they don't overlap. (if window-system (mouse-avoidance-mode 'animate)) ;; Compilation mode (setq compile-command "make -f Makefile all") ;; Desktop (load-library "desktop") (desktop-load-default) ;; GNUS (if (eq my-location 'home) (setq gnus-select-method '(nntp "news.pacbell.net")) ; home (setq gnus-select-method '(nntp "news.concentric.net"))) ; work (setq gnus-save-newsrc-file nil) ; don't want .newsrc laying around (add-hook 'nntp-server-opened-hook 'nntp-send-authinfo) ; ask for user/pwd ;; Semantic Bovinator. Required for JDE 2.1.6b24 and later (add-to-list 'load-path (concat my-site-lisp "/semantic-1.1")) ;; Speedbar. This version required for JDE 2.1.6b24 and later (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]) ;;(global-set-key [(f4)] 'speedbar-get-focus) (custom-set-variables '(speedbar-show-unknown-files t)) ) ) ;; JDE. Version 2.1.6b24 requires Speedbar 0.10 and Semantic 1.1. JDE assumes ;; that exec-path is properly setup. (add-to-list 'exec-path (concat my-site-lisp "/jde-2.1.7/lisp")) ; for jtags (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)) ;; Generic file mode support (eg, .bat, .ini, .properties, etc). Note that ;; the uniquify'd buffer name will be taken into account. (require 'generic-x) (add-to-list 'auto-mode-alist '("\\.cmd\\(<.*>\\)*$" . bat-generic-mode)) (add-to-list 'auto-mode-alist '("\\.properties\\(<.*>\\)*$" . default-generic-mode)) ;; JSP 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)) ;; XRDB mode (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)) ;; Color theme (load-library "color-theme-5.0.1") (add-to-list 'color-themes '(color-theme-GaryF "GaryF" "Gary Fong ")) ;; Recent Files mode (load "recentf-1.16") (recentf-mode 1) ;; Timestamp (add-hook 'write-file-hooks 'time-stamp) ;; Cygwin-mount. Recoginize cygwin-style drive mounts. This should also work ;; with uwin-style mounts. (if (eq my-unix-tools 'cygwin) (load "cygwin32-mount") ) ;; SGML Mode (setq sgml-quick-keys t) ;;----------------------------------------------------------------------------- ;; GENERAL FUNCTIONS ;;----------------------------------------------------------------------------- ;; My after initialization settings. (defun my-after-init-settings () "My after initialization settings." (interactive) (color-theme-GaryF) ; use my color theme (setenv "PATH" (build-path-string exec-path)) ; use PATH defined in here (setenv "SHELL" shell-file-name) ; use SHELL defined in here (setenv "COMSPEC" shell-file-name) ; use COMSPEC defined in here (setq-default tab-stop-list ; globally set tab stops default '(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) ; globally set the tab width default ) ;; My after initialization settings. It only makes sense that if I am adding ;; this function to emacs-startup-hook that this .emacs file has already been ;; parsed. (defun my-emacs-startup-settings () "My emacs startup settings." (interactive) (message "my emacs startup settings") ) ;; Set tab stop list. (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)) ) ;; Sets tab width to 4. (defun set-tab-width-4 () "Set the tab-width variable to 4." (interactive) (setq tab-width 4) (redraw-display) (message "tab-width = 4") ) ;; Sets tab width to 8. (defun set-tab-width-8 () "Set the tab-width variable to 8." (interactive) (setq tab-width 8) (redraw-display) (message "tab-width = 8") ) ;; Toggles between tab width of 4 and 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)) ) ;; Sets tab stop list and width to 4. (defun set-tab-stops-width-4 () "Sets tab stop list and width to 4." (interactive) (set-tab-stops-4) ; this may not be needed anymore since ; I made it the global default (setq tab-width 4) ) ;; Displays characters. (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)) ; quit-flag maybe set by C-g (message "Characters produced: %s" (key-description chars))) ) ;; Toggles case-fold-search. (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")) ) ;; Toggles case-replace. (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")) ) ;; Sets my term settings. (defun my-term-settings () "My terminal settings." ;; screen setup -- that's easy! (if (eq system-type 'windows-nt) (progn (standard-display-8bit 127 254) ;; keyboard setup -- that's simple! (set-input-mode nil nil 0) (define-key function-key-map [backspace] "\177") ;Normal behavior for BS (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))) ) ;; Toggles between line wrapping in the current buffer. (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")) ) ;; Inserts a C function header. (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") ) ;; Untabifies entire buffer. (defun untabify-buffer () "Untabifies entire buffer." (interactive) (point-to-register 1) (goto-char (point-min)) (untabify (point-min) (point-max)) (register-to-point 1) ) ;; Tabifies entire buffer. (defun tabify-buffer () "Tabifies entire buffer." (interactive) (point-to-register 1) (goto-char (point-min)) (tabify (point-min) (point-max)) (register-to-point 1) ) ;; Revert buffer w/yes. (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)) ; Extract first path in the list (setq pathList (cdr pathList)) ; Rest of the list ;; If there's more paths in the list, append the first to the built path ;; string of the rest separated with path-separator. The magic of recursion. (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) ) ;; My common C/C++/ObjC/Java mode settings. (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) ;; Don't turn on font-lock here because IDL mode needs to set some special ;; stuff beforehand. ;;;;;;;;;;;;;;;;;(turn-on-font-lock) ) (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-process-echoes t) ; reported that this is no longer needed (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")))))) ) ;;----------------------------------------------------------------------------- ;; HOOK IN MY FUNCTIONS ;;----------------------------------------------------------------------------- (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) ;;----------------------------------------------------------------------------- ;; KEYBOARD REBINDINGS ;;----------------------------------------------------------------------------- ;; Alphanumeric key combinations (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) ;; Don't use since there's problems unifying with FSF Emacs, XEmacs, winnt, and ;; unix until I understand what the hell is going on. ;;(global-set-key "\C-w" 'clipboard-kill-region) ; cut ;;(global-set-key "\M-w" 'clipboard-kill-ring-save) ; copy ;;(global-set-key "\C-y" 'clipboard-yank) ; paste ;; Function keys ;; f1 (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) ;; f2 (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) ;; f3 (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) ;; f4 (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) ;; f5 (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) ;; f6 ;; f7 ;; f8 ;; f9 ;; f10 ;; f11 ;; f12 (global-set-key [(control f12)] 'advertised-undo) ;; Arrow keys (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) ;; Keypad (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)]) ;; Mouse (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) ;; Change postscript printing to print without faces. (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))) )