;;_____________________________________________________________________________ ;; ;; For more information about this configuration file and Emacs, checkout ;; http://www.tiedeman.com/emacs ;;_____________________________________________________________________________ ;; ;; Version: 2.1 ;;_____________________________________________________________________________ ;; ;; Modify the config variables below to turn on and off sections of this Emacs ;; configuration file. This saves me from having to find a section of this ;; configuration file when I want to turn something on or off. An assignment ;; of the variable to nil means false or no, while an assignment to t means ;; true or yes. ;; ;; NOTE: This probably doesn't work reliably 100% of the time now. I have ;; been adding way to many things in recently and haven't had time to ;; make sure that setting everything to nil will avoid all errors. ;; (defvar config-enable-ange-ftp t) (defvar config-enable-ansi-color t) (defvar config-enable-avoid nil) (defvar config-enable-battery-status nil) (defvar config-enable-blinking-cursor nil) (defvar config-enable-bm-bookmark t) (defvar config-enable-calculator t) (defvar config-enable-comint t) (defvar config-enable-compile-modifications t) (defvar config-enable-cogre nil) (defvar config-enable-css-mode t) (defvar config-enable-cua-mode t) (defvar config-enable-dired-single t) (defvar config-enable-dlgopen nil) (defvar config-enable-ebackup nil) (defvar config-enable-emacs-code-browser nil) (defvar config-enable-emacs-dev-env nil) (defvar config-enable-emacs-server t) (defvar config-enable-eshell nil) (defvar config-enable-extra-java-font-lock t) (defvar config-enable-flyspell nil) (defvar config-enable-follow-mouse nil) (defvar config-enable-hideshow nil) (defvar config-enable-hl-line t) (defvar config-enable-htmlize t) (defvar config-enable-html-helper t) (defvar config-enable-imenu t) (defvar config-enable-iswitchb nil) (defvar config-enable-javascript-mode t) (defvar config-enable-jde nil) (defvar config-enable-mmm-mode t) (defvar config-enable-ms-windows-bash nil) (defvar config-enable-nxml t) (defvar config-enable-outline t) (defvar config-enable-pcl-cvs t) (defvar config-enable-python-mode t) (defvar config-enable-recentf t) (defvar config-enable-semantic-bovinator nil) (defvar config-enable-speedbar t) (defvar config-show-speedbar nil) (defvar config-enable-strip-whitespace t) (defvar config-enable-swbuff t) (defvar config-enable-uniquify t) (defvar config-enable-ws-trim t) (defvar config-enable-xt-mouse nil) (defvar config-override-term-setting t) ;;_____________________________________________________________________________ ;; ;; Your shared system wide lisp packages directory. The path should NOT end ;; with a slash. ;; (defvar config-packages-path "C:\\Program Files\\emacs-21.3\\lisp3rdParty") ;;_____________________________________________________________________________ ;; ;; Extend the load-path so that my specific lisp packages can be found and ;; loaded. If you are running the MS-Windows version of Emacs, make sure that ;; you set the HOME environment variable so that Emacs can properly convert the ;; tilde (~) to the proper path. ;; (add-to-list 'load-path config-packages-path) (add-to-list 'load-path (expand-file-name "~/emacs/site-lisp")) ;;_____________________________________________________________________________ ;; ;; The following section determines various properties that will be used to ;; automatically turn on and off sections of this Emacs configuration file. ;; You should leave these alone as they are going to be determined by Emacs. ;; ;; Check to see if we are on a graphical terminal (if (null window-system) ; then (progn (defvar config-is-graphical-window-system nil) (message "DEBUG: Non-graphical Window System Detected.")) ; else (progn (defvar config-is-graphical-window-system t) (message "DEBUG: Graphical Window System Detected."))) ;; Check to see if we are under MS-Windows (if (eq window-system 'w32) ; then (progn (defvar config-is-ms-windows t) (message "DEBUG: Microsoft OS Detected.")) ; else (progn (defvar config-is-ms-windows nil) (message "DEBUG: Non Microsoft OS Detected."))) ;;_____________________________________________________________________________ ;; ;; Setup ability to print to a network printer. If not on a network, use ;; PRN, LPT1, etc. The ps-printer-name variable is for post-script printing. ;; (setq printer-name "//P166/HP_LJ_1100SE") (setq ps-printer-name "//P166/HP_LJ_1100SE_PS") ;;_____________________________________________________________________________ ;; ;; Change the title bar to display full path and filename. ;; (setq frame-title-format '("%SEmacs: " (buffer-file-name "%f" (dired-directory dired-directory "%b")))) ;;_____________________________________________________________________________ ;; ;; Have to set the frame values early on or frames can be created with ;; incorrect colors and/or fonts. Modify the proper section(s) below based ;; on window manager and display resolution. ;; ;; Eval the following to get a list of all fonts available on your system. ;; (insert (prin1-to-string (x-list-fonts "*"))) ;; ;; Eval the following to show font name currently in use (MS-Windows Only). ;; (insert (prin1-to-string (w32-select-font))) ;; ;; Various MS-Windows fonts I have ;; Lucida "-*-Lucida Console-normal-r-*-*-16-120-96-96-c-*-iso8859-1" ;; Courier New 9 pt "-*-Courier New-normal-r-*-*-12-97-96-96-c-*-iso8859-1" ;; "-*-Courier New-normal-r-*-*-12-102-*-*-c-*-*-ansi" ;; Courier New 10 pt "-*-Courier New-normal-r-*-*-13-97-96-96-c-*-iso8859-1" ;; "-*-Courier New-normal-r-*-*-13-102-*-*-c-*-*-ansi" ;; Courier New 11 pt "-*-Courier New-normal-r-*-*-15-97-96-96-c-*-iso8859-1" ;; "-*-Courier New-normal-r-*-*-15-112-*-*-c-*-*-ansi" ;; Courier New 12 pt "-*-Courier New-normal-r-*-*-16-97-96-96-c-*-iso8859-1" ;; "-*-Courier New-normal-r-*-*-16-120-*-*-c-*-*-ansi" ;; Courier New 14 pt "-*-Courier New-normal-r-*-*-19-97-96-96-c-*-iso8859-1" ;; "-*-Courier New-normal-r-*-*-19-142-*-*-c-*-*-ansi" ;; ;; Various X fonts I have ;; Fixed "fixed" ;; 8x13 "8x13" ;; 10x20 "10x20" ;; (defvar config-foreground-color "white") (defvar config-background-color "#000066") (defvar config-cursor-color "yellow") (if (> emacs-major-version 20) ; then (progn (defvar total-gutter-width 20) (message "DEBUG: Gutter Detected.") ;; Turn off the tool bar as it slows things down quite a bit. (setq tool-bar-mode nil)) ; else (progn (defvar total-gutter-width 0) (message "DEBUG: Gutter NOT Detected."))) (cond ((eq config-is-graphical-window-system t) (message "DEBUG: Display Width: %d" (x-display-pixel-width)) (message "DEBUG: Display Height: %d" (x-display-pixel-height)) (if (eq config-is-ms-windows t) ; then - MS-Windows (progn (if (eq (x-display-pixel-width) 800) ; then - 800x600 display (progn (defvar config-screen-width 80) (defvar config-screen-height 35) (defvar config-screen-offset-top 0) (defvar config-screen-offset-left 218) (defvar config-speedbar-width 28) (defvar config-speedbar-height 35) (defvar config-speedbar-offset-top 0) (defvar config-speedbar-offset-left 0) (defvar config-font "-*-Courier New-normal-r-*-*-12-97-96-96-c-*-iso8859-1"))) (if (eq (x-display-pixel-width) 1024) ; then - 1024x768 display (progn (defvar config-screen-width 80) (defvar config-screen-height 43) (defvar config-screen-offset-top 0) (defvar config-screen-offset-left 360) (defvar config-speedbar-width 42) (defvar config-speedbar-height 43) (defvar config-speedbar-offset-top 0) (defvar config-speedbar-offset-left 0) (defvar config-font "-*-Courier New-normal-r-*-*-13-97-96-96-c-*-iso8859-1"))) (if (eq (x-display-pixel-width) 1152) ; then - 1152x864 display (progn (defvar config-screen-width 80) (defvar config-screen-height 39) (defvar config-screen-offset-top 0) (defvar config-screen-offset-left 327) (defvar config-speedbar-width 114) (defvar config-speedbar-height 39) (defvar config-speedbar-offset-top 0) (defvar config-speedbar-offset-left 0) (defvar config-font "-outline-Courier New-normal-r-normal-normal-17-102-120-120-c-*-iso10646-1"))) (if (eq (x-display-pixel-width) 1280) ; then - 1280x1024 display (progn (defvar config-screen-width 80) (defvar config-screen-height 47) (defvar config-screen-offset-top 0) (defvar config-screen-offset-left 448) (defvar config-speedbar-width 42) (defvar config-speedbar-height 47) (defvar config-speedbar-offset-top 0) (defvar config-speedbar-offset-left 0) (defvar config-font "-*-Courier New-normal-r-*-*-17-102-120-120-c-*-iso8859-5"))))) ; else - Assume X (progn (if (eq (x-display-pixel-width) 800) ; then - 800x600 display (progn (defvar config-screen-width 80) (defvar config-screen-height 40) (defvar config-screen-offset-top 0) (defvar config-screen-offset-left 292) (defvar config-speedbar-width 44) (defvar config-speedbar-height 40) (defvar config-speedbar-offset-top 0) (defvar config-speedbar-offset-left 0) (defvar config-font "fixed"))) (if (eq (x-display-pixel-width) 1024) ; then - 1024x768 display (progn (defvar config-screen-width 80) (defvar config-screen-height 49) (defvar config-screen-offset-top 27) (defvar config-screen-offset-left 432) (defvar config-speedbar-width 54) (defvar config-speedbar-height 49) (defvar config-speedbar-offset-top 27) (defvar config-speedbar-offset-left 77) (defvar config-font "fixed"))) (if (eq (x-display-pixel-width) 1152) ; then - 1152x864 display (progn (defvar config-screen-width 80) (defvar config-screen-height 54) (defvar config-screen-offset-top 0) (defvar config-screen-offset-left 406) (defvar config-speedbar-width 124) (defvar config-speedbar-height 51) (defvar config-speedbar-offset-top 0) (defvar config-speedbar-offset-left 0) (defvar config-font "9x15"))) (if (eq (x-display-pixel-width) 1280) ; then - 1280x1024 display (progn (defvar config-screen-width 80) (defvar config-screen-height 62) (defvar config-screen-offset-top 0) (defvar config-screen-offset-left 532) (defvar config-speedbar-width 56) (defvar config-speedbar-height 62) (defvar config-speedbar-offset-top 0) (defvar config-speedbar-offset-left 0) (defvar config-font "9x15")))))) ;; ;; The initial-frame-alist is the first window Emacs creates. Windows created ;; after the initial window will have the default-frame-alist parameters. ;; The following settings can be anything as long as they exist. They will ;; be reset after the display resolution and window manager is determined. ;; (setq initial-frame-alist '((width . 80) (height . 41) (top . 0) (left . 327) (font . "-*-Courier New-normal-r-*-*-17-102-120-120-c-*-iso8859-5") (foreground-color . "white") (background-color . "#000066") (cursor-color . "yellow"))) ;; ;; Adjust the initial-frame-alist parameters based on the display resolution ;; and the window manager. ;; ;; change parameter: (setf (cdr font) config-font) ;; add parameter: (push (append '(font) config-font) initial-frame-alist) ;; (require 'cl) (cond ((eq config-is-graphical-window-system t) (let ((font (assq 'font initial-frame-alist)) (foreground-color (assq 'foreground-color initial-frame-alist)) (background-color (assq 'background-color initial-frame-alist)) (cursor-color (assq 'cursor-color initial-frame-alist)) (width (assq 'width initial-frame-alist)) (height (assq 'height initial-frame-alist)) (top (assq 'top initial-frame-alist)) (left (assq 'left initial-frame-alist))) (if font (setf (cdr font) config-font)) (if foreground-color (setf (cdr foreground-color) config-foreground-color)) (if background-color (setf (cdr background-color) config-background-color)) (if cursor-color (setf (cdr cursor-color) config-cursor-color)) (if width (setf (cdr width) config-screen-width)) (if height (setf (cdr height) config-screen-height)) (if top (setf (cdr top) config-screen-offset-top)) (if left (setf (cdr left) (setq config-screen-offset-left (- config-screen-offset-left total-gutter-width))))))) ;; ;; The following settings can be anything as long as they exist. They will ;; be reset after the display resolution and window manager is determined. ;; (setq default-frame-alist '((font . "-*-Courier New-normal-r-*-*-17-102-120-120-c-*-iso8859-5") (foreground-color . "white") (background-color . "#000066") (cursor-color . "yellow"))) ;; ;; Adjust the default-frame-alist parameters based on the display resolution ;; and the window manager. ;; (require 'cl) (cond ((eq config-is-graphical-window-system t) (let ((font (assq 'font default-frame-alist)) (foreground-color (assq 'foreground-color default-frame-alist)) (background-color (assq 'background-color default-frame-alist)) (cursor-color (assq 'cursor-color default-frame-alist))) (if font (setf (cdr font) config-font)) (if foreground-color (setf (cdr foreground-color) config-foreground-color)) (if background-color (setf (cdr background-color) config-background-color)) (if cursor-color (setf (cdr cursor-color) config-cursor-color))))) ;;_____________________________________________________________________________ ;; ;; Global key bindings that I require. ;; (define-key function-key-map [delete] "\C-d") (global-set-key "\C-cg" 'goto-line) ;;_____________________________________________________________________________ ;; ;; Support for the bash shell under Windows 95/98/ME/NT/2000 ;; (cond ((and (eq config-enable-ms-windows-bash t) (eq config-is-ms-windows t)) (setq binary-process-input t) (setq w32-quote-process-args ?\") (setq shell-file-name "bash") (setenv "SHELL" shell-file-name) (setq explicit-shell-file-name shell-file-name) (setq explicit-sh-args '("-login" "-i")))) ;;_____________________________________________________________________________ ;; ;; Adds ability to change the current font via a Windows 95/98/ME/NT/2000 ;; dialog box. ALT-F10 to display dialog box. (cond ((eq config-is-ms-windows t) (defun w32-set-font () "Select a new font via Window's dialog box" (interactive) (let ((new-font (w32-select-font))) (if new-font (set-frame-font new-font)))) (global-set-key [(meta f10)] 'w32-set-font))) ;;_____________________________________________________________________________ ;; ;; Changes the value of the TERM variable to "dumb". This is done because the ;; color-gcc RPM screws up the Emacs compilation mode by inserting SGR control ;; sequences (ANSI escape) into the gcc output. Be warned that setting this ;; could cause other problems for other modes. ;; (cond ((eq config-override-term-setting t) (setenv "TERM" "dumb"))) ;;_____________________________________________________________________________ ;; ;; Two functions to handle the conversion of files from Unix to DOS (add CR to ;; the end of each line) or DOS to Unix (strip CR from the end of each line). ;; The key bindings to control the conversions are CTRL-F8 for DOS to Unix ;; conversion and ALT-F8 for Unix to DOS conversion. This set of functions ;; were written by Earl Stutes. ;; (defun dos-unix () (interactive) (goto-char (point-min)) (while (search-forward "\r" nil t) (replace-match "")) (set-buffer-file-coding-system 'iso-8859-1-unix)) (global-set-key [(control f8)] 'dos-unix) (defun unix-dos () (interactive) (goto-char (point-min)) (while (search-forward "\n" nil t) (replace-match "\r\n")) (set-buffer-file-coding-system 'iso-8859-1-dos)) (global-set-key [(meta f8)] 'unix-dos) ;;_____________________________________________________________________________ ;; ;; SEMANTIC BOVINATOR-- http://cedet.sourceforge.net/semantic.shtml ;; A lexer, parser-generator and parser. This library is used by several ;; other lisp packages. ;; ;; NOTE: Semantic Bovinator is used by many other packages and must be loaded ;; prior to their use. ;; (cond ((eq config-enable-semantic-bovinator t) (progn (add-to-list 'load-path (concat config-packages-path "/eieio")) (add-to-list 'load-path (concat config-packages-path "/semantic")) (if (locate-library "semantic") ; then (progn (setq semantic-load-turn-everything-on t) (require 'semantic-load)) ; else (progn (message "MISSING: semantic-load.el") (message " http://cedet.sourceforge.net/semantic.shtml")))))) ;;_____________________________________________________________________________ ;; ;; SPEEDBAR -- Standard Package ;; Displays available files, directories, functions, classes, etc. ;; ;; NOTE: Speedbar is used by many other packages and must be loaded ;; prior to their use. ;; (cond ((and config-enable-speedbar config-is-graphical-window-system) (progn (add-to-list 'load-path (concat config-packages-path "/speedbar")) (if (locate-library "speedbar") ; then (progn (require 'speedbar) (setq speedbar-frame-parameters (quote ((width . 30) (height . 39) (top . 0) (left . 0) (font . "-outline-Courier New-normal-r-normal-normal-17-102-120-120-c-*-iso10646-1") (foreground-color . "white") (background-color . "#000066") (cursor-color . "yellow")))) (require 'cl) (if (> emacs-major-version 20) ; then (progn (defvar speedbar-width-offset 4) (defvar speedbar-height-offset 1)) ; else (progn (defvar speedbar-width-offset 0) (defvar speedbar-height-offset 0))) (let ((font (assq 'font speedbar-frame-parameters)) (foreground-color (assq 'foreground-color speedbar-frame-parameters)) (background-color (assq 'background-color speedbar-frame-parameters)) (cursor-color (assq 'cursor-color speedbar-frame-parameters)) (width (assq 'width speedbar-frame-parameters)) (height (assq 'height speedbar-frame-parameters)) (top (assq 'top speedbar-frame-parameters)) (left (assq 'left speedbar-frame-parameters))) (if font (setf (cdr font) config-font)) (if foreground-color (setf (cdr foreground-color) config-foreground-color)) (if background-color (setf (cdr background-color) config-background-color)) (if cursor-color (setf (cdr cursor-color) config-cursor-color)) (if width (setf (cdr width) (setq config-speedbar-width (- config-speedbar-width speedbar-width-offset)))) (if height (setf (cdr height) (setq config-speedbar-height (+ config-speedbar-height speedbar-height-offset)))) (if top (setf (cdr top) config-speedbar-offset-top)) (if left (setf (cdr left) config-speedbar-offset-left))) (speedbar-add-supported-extension ".[bB][mM][pP]") (speedbar-add-supported-extension ".[jJ][pP][gG]") (speedbar-add-supported-extension ".[gG][iI][fF]") (speedbar-add-supported-extension ".properties") (speedbar-add-supported-extension ".[cC][oO][nN][fF]") (speedbar-add-supported-extension ".[xX][mM][lL]") (speedbar-add-supported-extension ".[dD][tT][dD]") (speedbar-add-supported-extension ".[sS][qQ][lL]") (speedbar-add-supported-extension ".[tT][xX][tT]") (speedbar-add-supported-extension ".[bB][aA][tT]") (speedbar-add-supported-extension ".[dD][aA][tT]") (speedbar-add-supported-extension ".[lL][oO][gG]") (speedbar-add-supported-extension ".[pP][hH][pP]") (speedbar-add-supported-extension ".[aA][sS][pP]") (speedbar-add-supported-extension ".[jJ][sS][pP]") (speedbar-add-supported-extension ".[cC][sS][sS]") (speedbar-add-supported-extension ".[jJ][sS]") (speedbar-add-supported-extension ".sh") (speedbar-add-supported-extension ".pc") (speedbar-add-supported-extension ".sc") (cond ((eq config-show-speedbar t) (speedbar-frame-mode 1)))) ; else (progn (message "MISSING: speedbar.el") (message " Located within standard distribution of Emacs.")))))) ;;_____________________________________________________________________________ ;; ;; ANGE-FTP -- Standard Package ;; Allows the easy retrieval of files from a remote host. This in combination ;; with speedbar is a pretty effective way for me to access files on another ;; machine. C-x C-f like normal but enter something of the form /host:filename ;; to retrieve a file. You will be prompted for username and password the ;; first time. ;; (cond ((eq config-enable-ange-ftp t) (if (locate-library "ange-ftp") ; then (require 'ange-ftp) ; else (progn (message "MISSING: ange-ftp.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; ANSI-COLOR -- http://www.geocities.com/kensanata ;; Converts the SGR color control sequences (previously ANSI escape codes) ;; to emacs font-lock-colors. Conversion of the SGR color control codes will ;; not be handled in a buffer that has font-lock enabled within it. Another ;; page with good information about the ANSI-COLOR mode is ;; http://www.geocities.com/kensnata/wiki/AnsiColor/html ;; (cond ((eq config-enable-ansi-color t) (if (locate-library "ansi-color") ; then (progn (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t) (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)) ; else (progn (message "MISSING: ansi-color.el") (message " http://www.geocities.com/kensanata"))))) ;;_____________________________________________________________________________ ;; ;; AVOID -- Standard Package ;; Moves the mouse pointer to the corner when the cursor gets near it. Also ;; places the cursor in its previous position after the cursor has moved away. ;; (cond ((eq config-enable-avoid t) (if (locate-library "avoid") ; then (progn (require 'avoid) (mouse-avoidance-mode 'exile)) ; else (progn (message "MISSING: avoid.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; BATTERY -- Standard Package ;; Determines the amount of battery life left and via various lisp functions, ;; can display that value. Using "META-x battery" will display the current ;; state of the battery while using "META-x display-battery" will place the ;; state of the battery within the mode line. The latter is what enabling ;; this section of code does. ;; (cond ((eq config-enable-battery-status t) (if (locate-library "battery") ; then (progn (require 'battery) (display-battery)) ; else (progn (message "MISSING: battery.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; BLINKING-CURSOR -- ftp://ftp.sunet.se/pub/gnu/emacs-lisp/incoming ;; Causes the cursor to blink. ;; (cond ((eq config-enable-blinking-cursor t) (if (locate-library "blinking-cursor") ; then (progn (require 'blinking-cursor) (setq blinking-cursor-colors ["yellow" "navy"]) (blinking-cursor-mode 1)) ; else (progn (message "MISSING: blinking-cursor.el") (message " ftp://ftp.sunet.se/pub/gnu/emacs-lisp/incoming"))))) ;;_____________________________________________________________________________ ;; ;; BM BOOK MARK -- http://home.online.no/~jood/emacs/bm.el ;; Provides a visible book mark. This package differs from the standard Emacs ;; book marking package in that it is much simpler to use. However, the ;; trade off for ease of use is power. For book marks that have titles, are ;; saved between sessions and quite a few other things, use the standard ;; book mark package contained in the standard Emacs distribution. ;; (cond ((eq config-enable-bm-bookmark t) (if (locate-library "bm") ; then (progn (require 'bm) (global-set-key [(control f9)] 'bm-toggle-bookmark) (global-set-key [f9] 'bm-goto-bookmark) (global-set-key [(shift f9)] 'bm-goto-bookmark-previous)) ; else (progn (message "MISSING: bm.el") (message " http://home.online.no/~jood/emacs/bm.el"))))) ;;_____________________________________________________________________________ ;; ;; CALCULATOR -- http://www.gnusoftware.com/Emacs/Lisp ;; Provides simple calculator functions in a mini-buffer. ;; (cond ((eq config-enable-calculator t) (if (locate-library "calculator") ; then (progn (autoload 'calculator "calculator" "A simple pocket calculator for Emacs." t) (global-set-key [(control return)] 'calculator) ;; Add the calculator menu item to the tools menu items. (define-key-after (lookup-key global-map [menu-bar tools]) [calculator] '("Calculator (mini-buffer)" . calculator) 'calendar)) ; else (progn (message "MISSING: calculator.el") (message " http://www.gnusoftware.com/Emacs/Lisp"))))) ;;_____________________________________________________________________________ ;; ;; COMINT -- Standard Package ;; Allows filename completion in the mini-buffer. Simply type the partial path ;; or environment variable and then hit the TAB key to complete the filename. ;; Another area this adds completion is within a shell buffer. ;; (cond ((eq config-enable-comint t) (if (locate-library "comint") ; then (autoload 'comint-dynamic-complete-filename "comint" "Complete filenames." t) ; else (progn (message "MISSING: comint.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; COMPILE -- Standard Package ;; Parses the output produced when compiling some source code. If the ;; resulting output associates an error with a line number in a file, selecting ;; the error will load the file and position the buffer to the line containing ;; the error. ;; (cond ((eq config-enable-compile-modifications t) (if (locate-library "compile") ; then (progn (require 'compile) (setq compilation-error-regexp-alist (append (list ;; works for Jikes '("^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):\\([0-9]+\\):[0-9]+:[0-9]+:" 1 2 3) ;; works for Javac ;; thanks to Barrie Treloar '("^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):" 1 2)) compilation-error-regexp-alist))) ; else (progn (message "MISSING: compile.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; COGRE -- http://cedet.sourceforge.net/cogre.shtml ;; Cogre is a base library for editing and manipulating connected graphs. ;; Additional tools will be available using COGRE for managing diagrams for ;; UML flavors, such as a class hierarchy diagrams. ;; (cond ((eq config-enable-cogre t) (progn (add-to-list 'load-path (concat config-packages-path "/cogre-0.2")) (if (and (eq config-enable-semantic-bovinator t) (locate-library "cogre")) ; then (require 'cogre) ; else (progn (message "MISSING: cogre.el or a dependency") (message " http://cedet.sourceforge.net/cogre.shtml")))))) ;;_____________________________________________________________________________ ;; ;; CSS-MODE -- http://www.garshol.priv.no/download/software/css-mode/ ;; Cascading Style Sheets syntax highlighting and indentation. This mode is ;; required by MMM-MODE to handle CSS embedded within HTML. ;; (cond ((eq config-enable-css-mode t) (if (locate-library "css-mode") ; then (progn (require 'css-mode) (setq cssm-indent-level '4) (setq cssm-indent-function 'cssm-c-style-indenter) (setq auto-mode-alist (cons '("\\.[cC][sS][sS]\\'" . css-mode) auto-mode-alist))) ; else (progn (message "MISSING: css-mode.el") (message " http://www.garshol.priv.no/download/software/css-mode/"))))) ;;_____________________________________________________________________________ ;; ;; CUA-MODE -- http://hjem.get2net.dk/storm/emacs ;; Provides a complete emulation of the standard CUA key bindings ;; (Motif/Windows/Mac GUI) for selecting and manipulating the region where ;; S- is used to highlight & extend the region. An alternative ;; method is to enable the pc-selection-mode. While the pc-selection-mode is ;; not as complete, I prefer it because it creates a more Emacs like ;; environment. ;; (cond ((eq config-enable-cua-mode t) (if (locate-library "CUA-mode") ; then (progn (require 'CUA-mode) (CUA-mode t)) ; else (progn (message "MISSING: CUA-mode.el") (message " http://hjem.get2net.dk/storm/emacs"))))) ;;_____________________________________________________________________________ ;; ;; DIRED-SINGLE -- http://www.northbound-train.com/emacs.html#MyPackages ;; Forces dired to use a single window as you traverse a directory structure. ;; (cond ((eq config-enable-dired-single t) (if (locate-library "dired-single") ; then (progn (require 'dired-single) (defun my-dired-init () "Bunch of stuff to run for dired, either immediately or when it's loaded." ;; (define-key dired-mode-map [return] 'joc-dired-single-buffer) (define-key dired-mode-map [mouse-1] 'joc-dired-single-buffer-mouse) (define-key dired-mode-map "^" (function (lambda nil (interactive) (joc-dired-single-buffer ".."))))) ;; if dired's already loaded, then the keymap will be bound (if (boundp 'dired-mode-map) ;; we're good to go; just add our bindings (my-dired-init) ;; it's not loaded yet, so add our bindings to the load-hook (add-hook 'dired-load-hook 'my-dired-init))) ; else (progn (message "MISSING: dired-single.el") (message " http://www.northbound-train.com/emacs.html#MyPackages"))))) ;;_____________________________________________________________________________ ;; ;; DLGOPEN -- http://www.gnu.org/software/emacs/windows/big.html ;; Provides a Windows Open File dialog box for opening files. ;; (cond ((and (eq config-enable-dlgopen t) (eq config-is-ms-windows t)) (progn (if (file-exists-p (concat config-packages-path "/dlgopen/dlgopen.el")) ; then (progn (add-to-list 'load-path (concat config-packages-path "/dlgopen")) (load-library "dlgopen") (setq dlgopen-executable-path (concat config-packages-path "/dlgopen/getfile.exe"))) ; else (progn (message "MISSING: dlgopen.el") (message " http://www.gnu.org/software/emacs/windows/big")))))) ;;_____________________________________________________________________________ ;; ;; EBACKUP -- http://www.anc.ed.ac.uk/~stephen/emacs/ell.html ;; Instead of the conventional backup alternatives in the standard Emacs, ;; ebackup (enhanced backup) provides the following: ;; - keeps all backups in ~/.emacs-backups ;; - stores files with directory structure. ;; - support rotation of files. Each time a file is backed up we store it as a ;; number and then rotate these backups. ;; (cond ((eq config-enable-ebackup t) (if (locate-library "ebackup") ; then (require 'ebackup) ; else (progn (message "MISSING: ebackup.el") (message " http://www.anc.ed.ac.uk/~stephen/emacs/ell.html"))))) ;;_____________________________________________________________________________ ;; ;; EMACS CODE BROWSER -- http://home.swipnet.se/mayhem/ecb.html ;; ECB is source code browser for Emacs. It is a global minor-mode which ;; displays a couple of windows that can be used to browse directories, files ;; and methods. It supports method parsing for Java, C, C++, Elisp etc. ;; (cond ((eq config-enable-emacs-code-browser t) (progn (add-to-list 'load-path (concat config-packages-path "/ecb-1.70")) (if (and (eq config-enable-semantic-bovinator t) (locate-library "ecb")) ; then (require 'ecb) ; else (progn (message "MISSING: ecb.el or a dependency") (message " http://home.swipnet.se/mayhem/ecb.html")))))) ;;_____________________________________________________________________________ ;; ;; EMACS DEVELOPMENT ENVIRONMENT -- http://cedet.sourceforge.net/ede.shtml ;; EDE brings many divergent commands used for debugging, and compiling and ;; sticks them into a simple menu next to commands used for maintaining a ;; project file ;; ;; NOTE: This package relies on Semantic Bovinator and Speedbar. Therefore, ;; it must be loaded after they have been configured. ;; (cond ((eq config-enable-emacs-dev-env t) (progn (add-to-list 'load-path (concat config-packages-path "/ede-1.0beta2")) (if (and (eq config-enable-semantic-bovinator t) (eq config-enable-speedbar t) (locate-library "ede")) ; then (require 'ede) ; else (progn (message "MISSING: ede.el or a dependency") (message " http://cedet.sourceforge.net/ede.shtml")))))) ;;_____________________________________________________________________________ ;; ;; EMACS Server or GNUSERV ;; Make Emacs startup as a server. Use emacsclient under Unix versions of ;; Emacs or gnuclient under the MS-Windows version to throw a file to ;; Emacs for editing. This will speed up things if you have Emacs as your ;; default editor within other apps (sqlplus for example). Remember to hit ;; C-x # to release the Emacs client from the buffer. If running under the ;; MS-Windows version of Emacs and you want to have Emacs included on the ;; "Send To" menu, goto the profiles folder for NT or the desktop folder for ;; 95/98 and within your user folder you will find a "SendTo" folder. Create ;; an icon there called Emacs with a target of 'gnuclientw.exe -q -F "%L"'. ;; Make sure that you have the %L quoted or long file names won't be supported ;; properly. ;; (cond ((eq config-enable-emacs-server t) (if (eq config-is-ms-windows t) ; then (if (locate-library "gnuserv") ; then (progn (require 'gnuserv) (gnuserv-start) (setq gnuserv-frame (selected-frame))) ; else (progn (message "MISSING: gnuserv.el") (message " http://www.scala.com/nico/gnuserv.html"))) ; else (progn (server-start) (setq server-temp-file-regexp "^/tmp/Re\\|/draft$\\|tmp.*sql"))))) ;;_____________________________________________________________________________ ;; ;; ESHELL -- http://www.gci-net.com/users/j/johnw/eshell.html ;; Uses internal LISP functions to produce an OS independent shell. The ;; command set is very similar to bash or zsh so this could be used to give a ;; unix style shell under MS-Windows without using Cygwin or something similar. ;; (cond ((eq config-enable-eshell t) (progn (add-to-list 'load-path (concat config-packages-path "/eshell")) (add-to-list 'load-path (concat config-packages-path "/pcomplete")) (if (and (locate-library "eshell") (locate-library "pcomplete")) ; then (progn (load "eshell-auto") (load "pcomplete" )) ; else (progn (message "MISSING: eshell.el or pcomplete.el") (message " http://www.gci-net.com/users/j/johnw/eshell.html")))))) ;;_____________________________________________________________________________ ;; ;; EXTRA-JAVA-FONT-LOCK -- http://perso.wanadoo.fr/david.ponce ;; Adds even more syntax hilighting to the java modes or JDE. ;; (cond ((eq config-enable-extra-java-font-lock t) (if (locate-library "extra-java-font-lock") ; then (progn (require 'extra-java-font-lock) (setq font-lock-maximum-decoration t)) ; else (progn (message "MISSING: extra-java-font-lock.el") (message " http://perso.wanadoo.fr/david.ponce"))))) ;;_____________________________________________________________________________ ;; ;; FLYSPELL -- http://kaolin.unice.fr/~serrano/emacs/emacs.html ;; Uses iSpell to check the spelling of words as they are typed. Produces ;; output very similar to MS-Word's spell checking feature. This package is ;; part of the standard emacs distribution but you may want to check to make ;; sure you have the latest version. Earlier versions don't contain the ;; flyspell-prog-mode so they are unable to limit checking of source code to ;; remark statements and strings. ;; (cond ((eq config-enable-flyspell t) (if (locate-library "flyspell") ; then (require 'flyspell) ; else (progn (message "MISSING: flyspell.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; FOLLOW_MOUSE -- http://www.anc.ed.ac.uk/~stephen/emacs/ell.html ;; Causes an Emacs windows or frame to be activated when the mouse passes over ;; it. ;; (cond ((eq config-enable-follow-mouse t) (if (locate-library "follow-mouse") ; then (progn (require 'follow-mouse) (turn-on-follow-mouse)) ; else (progn (message "MISSING: follow-mouse.el") (message " http://www.anc.ed.ac.uk/~stephen/emacs/ell.html"))))) ;;_____________________________________________________________________________ ;; ;; HIDESHOW -- Standard Package ;; Hides/Shows text within a block. The block is defined by the major-mode. ;; This allows comment blocks, function blocks, etc. to be available for ;; showing or hiding. Unless you use the style the author uses for brace ;; placement, this won't work properly. ;; (cond ((eq config-enable-hideshow t) (if (locate-library "hideshow") ; then (progn (require 'hideshow) (add-hook 'c-mode-hook '(lambda () (hs-minor-mode 1))) (add-hook 'java-mode-hook '(lambda () (hs-minor-mode 1))) (add-hook 'emacs-lisp-mode-hook '(lambda () (hs-minor-mode 1)))) ; else (progn (message "MISSING: hideshow.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; HL-LINE -- http://www.gnusoftware.com/Emacs/Lisp/ ;; Hi-lights the current line. ;; (cond ((eq config-enable-hl-line t) (if (locate-library "hl-line") ; then (progn (require 'hl-line) (hl-line-mode) (setq hl-line-face (quote secondary-selection))) ; else (progn (message "MISSING: hl-line.el") (message " http://www.gnusoftware.com/Emacs/Lisp"))))) ;;_____________________________________________________________________________ ;; ;; HTMLIZE -- http://jagor.srce.hr/~hniksic/htmlize.el ;; Converts the text in the current buffer to HTML. The font and font-lock ;; colors will also be saved. To use, do M-x htmlize-buffer ;; (cond ((eq config-enable-htmlize t) (if (locate-library "htmlize") ; then (require 'htmlize) ; else (progn (message "MISSING: htmlize.el") (message " http://www.gnusoftware.com/Emacs/Lisp"))))) ;;_____________________________________________________________________________ ;; ;; HTML-HELPER-MODE -- http://www.gest.unipd.it/~saint/hth.html ;; http://www.santafe.edu/~nelson/tools/ ;; HTML file editing mode. ;; (cond ((eq config-enable-html-helper t) (if (and (locate-library "html-helper-mode") (locate-library "tempo")) ; then (progn (require 'tempo) (require 'html-helper-mode) (add-to-list 'auto-mode-alist '("\\.[hH][tT][mM][lL]?$" . html-helper-mode)) (add-to-list 'auto-mode-alist '("\\.[cC][fF][mM]$" . html-helper-mode)) (add-to-list 'auto-mode-alist '("\\.[jJ][sS][pP]$" . html-helper-mode)) (add-to-list 'auto-mode-alist '("\\.[pP][hH][pP]$" . html-helper-mode)) (add-to-list 'auto-mode-alist '("\\.[aA][sS][pP]$" . html-helper-mode)) (setq html-helper-mode-uses-visual-basic nil) (setq html-helper-mode-uses-JDE nil) (setq html-helper-basic-offset 2) (setq html-helper-item-continue-indent 2) (add-hook 'html-helper-load-hook (function (lambda () (load "jsp-html-helper-mode.el"))))) ; else (progn (message "MISSING: html-helper-mode.el or tempo.el") (message " http://www.gest.unipd.it/~saint/hth.html"))))) ;;_____________________________________________________________________________ ;; ;; IMENU -- Standard Package ;; Displays available functions, classes, variables, etc. ;; (cond ((and (eq config-enable-imenu t) (eq config-enable-jde nil)) (if (locate-library "imenu") ; then (require 'imenu) ; else (progn (message "MISSING: imenu.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; ISWITCHB -- Standard Package ;; The following function changes the way you switch buffers. You ;; are presented with a list of buffers that shrinks as you type ;; the name, only the matching buffers are shown, making buffer ;; switching much easier. ;; (cond ((eq config-enable-iswitchb t) (if (locate-library "iswitchb") ; then (progn (require 'iswitchb) (iswitchb-default-keybindings) (setq iswitchb-default-method (quote samewindow))) ; else (progn (message "MISSING: iswitchb.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; JAVASCRIPT-MODE -- http://www.hesketh.com/schampeo/javascript/ ;; JavaScript syntax highlighting and indentation. This mode is required by ;; MMM-MODE to handle JavaScript embedded within HTML. ;; (cond ((eq config-enable-javascript-mode t) (if (locate-library "javascript-mode") ; then (progn (require 'javascript-mode) (defun my-javascript-mode-hook () (c-set-style "ellemtel") (setq tab-width 4) (setq c-basic-offset 4) (setq indent-tabs-mode nil) (setq c-tab-always-indent nil) (c-set-offset 'statement-case-intro ' + ) (c-toggle-hungry-state 1) (make-local-variable 'compile-command) (setq compile-command (quote "make ")) (if (fboundp 'turn-on-ws-trim) (turn-on-ws-trim)) (cond ((and (eq config-enable-flyspell t) (fboundp 'flyspell-prog-mode)) (flyspell-prog-mode))) (cond ((and (eq config-enable-imenu t) (fboundp 'imenu-add-to-menubar)) (imenu-add-to-menubar "Functions") (setq imenu-sort-function (quote imenu--sort-by-name))))) (add-hook 'javascript-mode-hook 'my-javascript-mode-hook)) ; else (progn (message "MISSING: javascript-mode.el") (message " http://www.hesketh.com/schampeo/javascript/"))))) ;;_____________________________________________________________________________ ;; ;; JDE -- http://sunsite.auc.dk/jde/ ;; Java Development Environment. ;; (cond ((eq config-enable-jde t) (progn (add-to-list 'load-path (concat config-packages-path "/jde")) (add-to-list 'load-path (concat config-packages-path "/elib")) (if (and (eq config-enable-speedbar t) (locate-library "jde")) ; then (progn (require 'cl) (require 'jde)) ; else (progn (message "MISSING: jde.el or one of its components") (message " http://sunsite.auc.dk/jde/")))))) ;;_____________________________________________________________________________ ;; ;; MMM-MODE -- http://sourceforge.net/projects/mmm-mode ;; Allows for multiple major modes within a single buffer. Things such as ;; JavaScript within a HTML buffer are accomplished by this mode. ;; (cond ((eq config-enable-mmm-mode t) (progn (add-to-list 'load-path (concat config-packages-path "/mmm-mode-0.4.7")) (if (locate-library "mmm-mode") ; then (progn (require 'mmm-mode) (setq mmm-global-mode 'maybe) (mmm-add-find-file-hook) (mmm-add-mode-ext-class 'html-helper-mode "\\.[jJ][sS][pP]$" 'jsp) (mmm-add-mode-ext-class 'html-helper-mode "\\.[hH][tT][mM][lL]$" 'html-js) (mmm-add-mode-ext-class 'html-helper-mode "\\.[hH][tT][mM][lL]$" 'embedded-css)) ; else (progn (message "MISSING: mmm-mode.el") (message " http://sourceforge.net/projects/mmm-mode")))))) ;;_____________________________________________________________________________ ;; ;; nXML -- http://www.xmlhack.com/read.php?item=2061#id5376111 or ;; http://groups.yahoo.com/group/emacs-nxml-mode ;; A new mode for editing XML documents from within GNU Emacs. It's a ;; milestone in that it's the first open-source editing application to enable ;; context-sensitive validated editing against Relax NG schemas. It also ;; provides a clever mechanism for real-time, automatic visual identification ;; of validity errors, along with flexible syntax-highlighting capabilities. ;; (cond ((eq config-enable-nxml t) (progn (add-to-list 'load-path (concat config-packages-path "/nxml-mode-20030929")) (if (file-exists-p (concat config-packages-path "/nxml-mode-20030929/rng-auto.el")) ; then (progn (load-file (concat config-packages-path "/nxml-mode-20030929/rng-auto.el")) (setq auto-mode-alist (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\|rdf\\)\\'" . nxml-mode) auto-mode-alist))) ; else (progn (message "MISSING: nxml.el") (message " http://groups.yahoo.com/group/emacs-nxml-mode")))))) ;;_____________________________________________________________________________ ;; ;; OUTLINE -- Standard Package ;; Hides/Shows text within a block. The block is defined by the major-mode. ;; This allows function blocks, if-then-else blocks etc. to be hidden or shown. ;; This is far from perfect but works better for me than hideshow. Shift ;; middle-mouse button hides a block while the shift right-mouse shows a block. ;; (cond ((eq config-enable-outline t) (if (locate-library "outline") ; then (progn (require 'outline) (add-hook 'c-mode-hook '(lambda () (outline-minor-mode 1))) (add-hook 'java-mode-hook '(lambda () (outline-minor-mode 1))) (global-set-key [(shift mouse-2)] 'hide-subtree) (global-set-key [(shift mouse-3)] 'show-subtree)) ; else (progn (message "MISSING: outline.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; PCL-CVS -- ftp://rum.cs.yale.edu/pub/monnier/pcl-cvs ;; A version control interface specifically made for CVS. This integrates ;; with the native version control system built into Emacs. ;; (cond ((eq config-enable-pcl-cvs t) (progn (if (< emacs-major-version 21) (progn (add-to-list 'load-path (concat config-packages-path "/pcl-cvs-2.9.9")) (add-to-list 'load-path (concat config-packages-path "/elib")))) (if (or (locate-library "pcl-cvs") (locate-library "pcvs")) ; then (progn (if (< emacs-major-version 21) (load-file (concat config-packages-path "/pcl-cvs-2.9.9/" "pcl-cvs-startup.elc"))) (defun my-cvs-edit-mode-hook () (set-fill-column 69) (auto-fill-mode 1) (cond ((and (eq config-enable-flyspell t) (fboundp 'flyspell-prog-mode)) (flyspell-mode)))) (add-hook 'cvs-edit-mode-hook 'my-cvs-edit-mode-hook) (defun my-vc-log-mode-hook () (set-fill-column 69) (auto-fill-mode 1) (cond ((and (eq config-enable-flyspell t) (fboundp 'flyspell-prog-mode)) (flyspell-mode)))) (add-hook 'vc-log-mode-hook 'my-vc-log-mode-hook)) ; else (progn (message "MISSING: pcl-cvs.el or one of its components") (message " ftp://rum.cs.yale.edu/pub/monnier/pcl-cvs")))))) ;;_____________________________________________________________________________ ;; ;; PYTHON-MODE -- http://www.python.org/emacs/python-mode ;; Python language support. The enhancements for python-mode come mainly from ;; John Wiegley's .emacs file (http://www.gci-net.com/users/j/johnw/emacs.html) ;; I think I got everything I stripped from his file working correctly below. ;; (cond ((eq config-enable-python-mode t) (if (locate-library "python-mode") ; then (progn (require 'python-mode) (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) (add-to-list 'interpreter-mode-alist '("python" . python-mode)) (cond ((and (eq config-enable-flyspell t) (fboundp 'flyspell-prog-mode)) (add-hook 'python-mode-hook 'flyspell-prog-mode))) (eval-after-load "python-mode" '(add-to-list 'python-font-lock-keywords '("\\b__name__\\)" 1 font-lock-builtin-face))) (eval-after-load "python-mode" '(add-to-list 'python-font-lock-keywords '("\\b\\(self\\)[ .,]?" 1 font-lock-type-face)))) ; (add-hook 'python-mode-hook ; (function ; (lambda () ; (set (make-local-variable ; 'parens-require-spaces) nil) ; (setq indicate-empty-lines t)))) ; (defvar python-keywords-wanting-colon ; '("def" "class" "if" "elif" "while" "else" ; "try" "except" "finally" "for" "lambda")) ; (defvar python-kwc-regexp nil) ; (defadvice py-newline-and-indent ; (before always-insert-colons activate) ; "Always make sure that colons appear in the appropriate place." ; (unless (memq (char-before) '(?: ?, ?\\)) ; (let ((here (point)) ; insert-colon already-has-it) ; (save-excursion ; (beginning-of-line) ; (save-excursion ; (if (search-forward ":" here t) ; (setq already-has-it t))) ; (unless already-has-it ; (unless python-kwc-regexp ; (require 'regexp-opt) ; (setq python-kwc-regexp ; (concat ; "\\s-*\\<" ; (regexp-opt python-keywords-wanting-colon t) ; "\\>"))) ; (if (and (not (and (boundp 'font-lock-mode) ; (eq (get-text-property (point) 'face) ; 'font-lock-string-face))) ; (looking-at python-kwc-regexp)) ; (setq insert-colon t)))) ; (if insert-colon ; (let ((last-command-char ?:)) ; (py-electric-colon nil))))) ; else (progn (message "MISSING: python-mode.el") (message " http://www.python.org/emacs/python-mode"))))) ;;_____________________________________________________________________________ ;; ;; RECENTF -- http://perso.wanadoo.fr/david.ponce/index.html ;; Adds an open recent files option to the files menu. This package is set to ;; be included in the Emacs 21 distribution. ;; (cond ((eq config-enable-recentf t) (if (locate-library "recentf") ; then (progn (require 'recentf) (recentf-mode 1)) ; else (progn (message "MISSING: recentf.el") (message " http://perso.wanadoo.fr/david.ponce"))))) ;;_____________________________________________________________________________ ;; ;; STRIP-WHITESPACE -- http://www.gnusoftware.com/Emacs/Lisp/ ;; Removes the trailing white-space from the end of each line within a buffer. ;; To strip whitespace from a buffer do M-x strip-trailing-whitespace ;; (cond ((eq config-enable-strip-whitespace t) (if (locate-library "strip-whitespace") ; then (progn (autoload 'strip-trailing-whitespace "strip-whitespace" "Strip whitespace from the end of lines." t)) ; else (progn (message "MISSING: strip-whitespace.el") (message " http://www.gnusoftware.com/Emacs/Lisp"))))) ;;_____________________________________________________________________________ ;; ;; SWBUFF -- http://perso.wanadoo.fr/david.ponce/index.html ;; Cycle thru the buffers easier. Currently hooked to control-tab and ;; control-shift-tab. The regexps is used to exclude buffers. The regexps ;; currently removes all buffers starting with a space and all starting with ;; and ending with an asterisk (i.e. *messages*, *scratch*, etc.). ;; (cond ((eq config-enable-swbuff t) (if (locate-library "swbuff") ; then (progn (autoload 'swbuff-switch-to-next-buffer "swbuff" "Switch to next buffer." t) (autoload 'swbuff-switch-to-previous-buffer "swbuff" "Switch to previous buffer." t) (setq swbuff-exclude-buffer-regexps (quote ("^ " "^\\*.*\\*" "ChangeLog" "TAGS"))) (global-set-key [(control shift tab)] 'swbuff-switch-to-previous-buffer) (global-set-key [(control tab)] 'swbuff-switch-to-next-buffer) (global-set-key [(control shift kp-tab)] 'swbuff-switch-to-previous-buffer) (global-set-key [(control shift iso-lefttab)] 'swbuff-switch-to-previous-buffer)) ; else (progn (message "MISSING: swbuff.el") (message " http://perso.wanadoo.fr/david.ponce"))))) ;;_____________________________________________________________________________ ;; ;; UNIQUIFY -- Standard Package ;; Adds to the buffer name when loading multiple files having the same name. ;; Will produce a more intuitive unique buffer name in the form BUFFER ;; (i.e Makefile<2> would be changed into Makefile). ;; (cond ((eq config-enable-uniquify t) (if (locate-library "uniquify") ; then (progn (require 'uniquify) (setq uniquify-buffer-name-style 'post-forward-angle-brackets)) ; else (progn (message "MISSING: uniquify.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; WS-TRIM -- http://anc.ed.ac.uk/~stephen/emacs ;; Removes the trailing white-space from the end of each line within a buffer. ;; The removal process is automatic and I prefer it to strip-whitespace. ;; There are two variable that allow you to customize the stripping of the ;; whitespace within the buffer. Review the ws-trim.el for more complete ;; documentation. The defaults are fine for me. ;; (cond ((eq config-enable-ws-trim t) (if (locate-library "ws-trim") ; then (require 'ws-trim) ; else (progn (message "MISSING: ws-trim.el") (message " http://anc.ed.ac.uk/~stephen/emacs"))))) ;;_____________________________________________________________________________ ;; ;; XT-MOUSE -- Standard Package ;; Enables mouse support when Emacs is executed as "emacs -nw" from within an ;; Xterm session. ;; (cond ((and config-enable-xt-mouse (not config-is-graphical-window-system)) (if (locate-library "xt-mouse") ; then (progn (load "xt-mouse" 'noerr 'nomsg) (if (featurep 'xt-mouse) (xterm-mouse-mode 1))) ; else (progn (message "MISSING: xt-mouse.el") (message " Located within standard distribution of Emacs."))))) ;;_____________________________________________________________________________ ;; ;; Set color and font properties to what I like. Remember that placing the ;; cursor on top of a piece of text and using the menu options ;; Edit -> Text Properties -> List Properties will display the font-lock face ;; name you want to set. Alternately, you could execute the lisp function ;; list-text-properties-at after placing the cursor on the text you want ;; information on. While these could be modified by hand, these were set by ;; customization for me. Be careful. ;; (custom-set-faces ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(default ((t (:foreground "white" :background "#000066")))) '(bm-face ((t (:background "darkslateblue")))) '(custom-button-face ((t (:foreground "yellow" :background "dark blue")))) '(custom-documentation-face ((t (:foreground "#10D010")))) '(custom-face-tag-face ((t (:foreground "goldenrod" :underline t)))) '(custom-group-tag-face ((t (:underline t :foreground "cyan")))) '(custom-set-face ((t (:foreground "#2020D0")))) '(custom-state-face ((t (:foreground "mediumaquamarine")))) '(custom-variable-tag-face ((t (:underline t :foreground "cyan")))) '(cvs-filename-face ((t (:foreground "white")))) '(cvs-header-face ((t (:bold t :foreground "cyan")))) '(font-lock-comment-face ((t (:foreground "grey50" :slant italic)))) '(font-lock-constant-face ((t (:foreground "indian red")))) '(font-lock-function-name-face ((t (:foreground "cyan")))) '(font-lock-keyword-face ((t (:foreground "dark cyan")))) '(font-lock-string-face ((t (:foreground "#10D010")))) '(highlight ((t (:foreground "navy" :background "darkseagreen2")))) '(highlight-changes-delete-face ((t (:foreground "red" :background "navy")))) '(highlight-changes-face ((t (:background "navy")))) '(html-helper-bold-face ((t (:bold t)))) '(html-helper-builtin-face ((t (:foreground "OrangeRed1")))) '(html-helper-italic-face ((t (:italic t)))) '(html-helper-underline-face ((t (:underline t)))) '(html-tag-face ((t (:bold t :foreground "dark orchid")))) '(italic ((t (:italic t)))) '(mmm-cleanup-submode-face ((t (:background "blue4")))) '(mmm-code-submode-face ((t (:background "#000033")))) '(mmm-comment-submode-face ((t (:background "gray25")))) '(mmm-declaration-submode-face ((t (:background "blue4")))) '(mmm-default-submode-face ((t (:background "#000033")))) '(mmm-init-submode-face ((t (:background "blue4")))) '(mmm-output-submode-face ((t (:background "#00004C")))) '(mmm-special-submode-face ((t (:background "#00004C")))) '(modeline ((t (:foreground "cornflowerblue" :background "black")))) '(modeline-buffer-id ((t (:foreground "cornflowerblue" :background "black")))) '(modeline-mousable ((t (:foreground "cornflowerblue" :background "black")))) '(modeline-mousable-minor-mode ((t (:foreground "cornflowerblue" :background "black")))) '(nxml-attribute-local-name-face ((t (:inherit nxml-name-face :foreground "lightGoldenrod")))) '(nxml-attribute-value-delimiter-face ((t (:inherit nxml-delimiter-face :foreground "#10D010")))) '(nxml-attribute-value-face ((t (:inherit nxml-delimited-data-face :foreground "#10D010")))) '(nxml-comment-content-face ((t (:foreground "grey50" :slant italic)))) '(nxml-comment-delimiter-face ((t (:inherit nxml-delimiter-face :foreground "grey50")))) '(nxml-element-local-name-face ((t (:inherit nxml-name-face :foreground "purple" :weight bold)))) '(nxml-tag-delimiter-face ((t (:inherit nxml-delimiter-face :foreground "cyan")))) '(nxml-tag-slash-face ((t (:inherit nxml-name-face :foreground "purple" :weight bold)))) '(region ((t (:background "#003300")))) '(secondary-selection ((t (:background "navy")))) '(semantic-dirty-token-face ((t (:inherit nil)))) '(semantic-unmatched-syntax-face ((t (:inherit nil :underline "red")))) '(show-paren-match-face ((t (:background "darkgreen")))) '(show-paren-mismatch-face ((t (:background "red")))) '(speedbar-directory-face ((t (:foreground "light green")))) '(underline ((t (:underline t)))) '(widget-field-face ((t (:foreground "black" :background "grey35")))) '(widget-inactive-face ((t (:foreground "gray")))) '(widget-single-line-field-face ((t (:foreground "navy" :background "gray85"))))) ;;____________________________________________________________________________ ;; ;; Menu item modifications and additions. ;; ;; Add the macros menu in (define-key-after (lookup-key global-map [menu-bar tools]) [separator-macros] '("--" . t) 'gdb) (define-key-after (lookup-key global-map [menu-bar tools]) [my-macros-menu] (cons "Macros" (make-sparse-keymap "Macros")) 'separator-macros) (define-key (lookup-key global-map [menu-bar tools my-macros-menu]) [start-macro] '(menu-item "Begin macro definition" start-kbd-macro :enable (not (eq defining-kbd-macro t)))) (define-key (lookup-key global-map [menu-bar tools my-macros-menu]) [start-macro] '(menu-item "Begin macro definition" start-kbd-macro :enable (not (eq defining-kbd-macro t)))) (define-key-after (lookup-key global-map [menu-bar tools my-macros-menu]) [end-macro] '(menu-item "Finish macro definition" end-kbd-macro :enable (eq defining-kbd-macro t)) 'start-macro) (define-key-after (lookup-key global-map [menu-bar tools my-macros-menu]) [edit-last-macro] '(menu-item "Edit last macro" edit-last-kbd-macro :enable (and (not (eq last-kbd-macro nil)) (not (eq defining-kbd-macro t)))) 'end-macro) (define-key-after (lookup-key global-map [menu-bar tools my-macros-menu]) [execute-last-macro] '(menu-item "Execute last macro" call-last-kbd-macro :enable (and (not (eq last-kbd-macro nil)) (not (eq defining-kbd-macro t)))) 'edit-last-macro) (define-key-after (lookup-key global-map [menu-bar tools my-macros-menu]) [separator-named-macros] '("--" . t) 'execute-last-macro) (define-key-after (lookup-key global-map [menu-bar tools my-macros-menu]) [name-last-macro] '(menu-item "Name the last macro" name-last-kbd-macro :enable (and (not (eq last-kbd-macro nil)) (not (eq defining-kbd-macro t)))) 'separator-named-macros) (define-key-after (lookup-key global-map [menu-bar tools my-macros-menu]) [edit-named-macro] '(menu-item "Edit named macro" edit-named-kbd-macro) 'name-last-macro) (define-key-after (lookup-key global-map [menu-bar tools my-macros-menu]) [convert-named-macro] '(menu-item "Convert named macro to lisp" insert-kbd-macro) 'edit-named-macro) ;; Add the UNIX to DOS and DOS to UNIX file conversions (define-key-after (lookup-key global-map [menu-bar tools]) [separator-conversions] '("--" . t) 'gdb) (define-key-after (lookup-key global-map [menu-bar tools]) [dos-to-unix] '(menu-item "DOS to UNIX" dos-unix) 'separator-conversions) (define-key-after (lookup-key global-map [menu-bar tools]) [unix-to-dos] '(menu-item "UNIX to DOS" unix-dos) 'dos-to-unix) ;; Modify the file menu to add split the window vertically (I know the command ;; and the menu item's description differ but it makes more sense to me). (define-key-after (lookup-key global-map [menu-bar files]) [split-window-horizontally] '("Split Window (vertically)" . split-window-horizontally) 'split-window) (define-key-after (lookup-key global-map [menu-bar files]) [unsplit-current-window] '(menu-item "Delete Window with Cursor" delete-window :enable (not (one-window-p t nil))) 'split-window-horizontally) ;; Modify the edit menu to add the rectangular selections options. (define-key-after (lookup-key global-map [menu-bar edit]) [separator-selections] '("--" . t) 'mark-whole-buffer) (define-key-after (lookup-key global-map [menu-bar edit]) [my-rectangular-menu] (cons "Rectangular selection" (make-sparse-keymap "Rectangles")) 'separator-selections) (define-key (lookup-key global-map [menu-bar edit my-rectangular-menu]) [cut-from-rectangle] '(menu-item "Cut" kill-rectangle :enable (and mark-active (not buffer-read-only)))) (define-key-after (lookup-key global-map [menu-bar edit my-rectangular-menu]) [copy-from-rectangle] '(menu-item "Copy to register" copy-rectangle-to-register :enable (and mark-active (not buffer-read-only))) 'cut-from-rectangle) (define-key-after (lookup-key global-map [menu-bar edit my-rectangular-menu]) [paste-in-rectangle] '(menu-item "Paste" yank-rectangle :enable (and ;; Emacs compiled --without-x doesn't have ;; x-selection-exists-p. (fboundp 'x-selection-exists-p) (x-selection-exists-p) (not buffer-read-only))) 'copy-from-rectangle) (define-key-after (lookup-key global-map [menu-bar edit my-rectangular-menu]) [open-in-rectangle] '(menu-item "Open (shifts text right)" open-rectangle :enable (and mark-active (not buffer-read-only))) 'paste-in-rectangle) (define-key-after (lookup-key global-map [menu-bar edit my-rectangular-menu]) [clear-the-rectangle] '(menu-item "Clear (clears with whitespace)" clear-rectangle :enable (and mark-active (not buffer-read-only))) 'open-in-rectangle) (define-key-after (lookup-key global-map [menu-bar edit my-rectangular-menu]) [replace-the-rectangle] '(menu-item "Replace (replaces with string)" string-rectangle :enable (and mark-active (not buffer-read-only))) 'clear-the-rectangle) ;; Modify the edit menu to add the register selections options. (define-key-after (lookup-key global-map [menu-bar edit]) [my-register-menu] (cons "Register selection" (make-sparse-keymap "Registers")) 'my-rectangular-menu) (define-key (lookup-key global-map [menu-bar edit my-register-menu]) [my-copy-to-register] '(menu-item "Copy" copy-to-register :enable (and mark-active (not buffer-read-only)))) (define-key-after (lookup-key global-map [menu-bar edit my-register-menu]) [my-paste-from-register] '(menu-item "Paste" insert-register) 'my-copy-to-register) ;;____________________________________________________________________________ ;; ;; Define miscellaneous properties to my liking. While you could modify these ;; by hand, they were set for me by customization. Be careful. ;; (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. '(bm-face (quote bm-face)) '(bm-priority 1) '(case-fold-search t) '(column-number-mode t) '(current-language-environment "Latin-1") '(cvs-allow-dir-commit t) '(default-input-method "latin-1-prefix") '(dired-kept-versions 0) '(global-font-lock-mode t nil (font-lock)) '(html-helper-mode-uses-bold-italic t nil (html-helper-mode)) '(jde-bug-jpda-directory "c:/jdk1.3/jpda/") '(jde-compile-option-debug (quote ("all" (t nil nil)))) '(jde-db-debugger (quote ("oldjdb" "" . "Executable"))) '(jde-db-source-directories (quote ("~/opt/websrc/dev1/janus-dev5/developers/tiedemma/java/" "/opt/websrc/dev1/janus-dev5/developers/tiedemma/java/"))) '(mmm-submode-decoration-level 2) '(next-line-add-newlines nil) '(pc-select-meta-moves-sexps t) '(pc-select-selection-keys-only t) '(pc-selection-mode t nil (pc-select)) '(resize-minibuffer-mode 1 nil (rsz-mini)) '(save-place t) '(scroll-bar-mode (quote right)) '(scroll-step 1) '(show-paren-mode t nil (paren)) '(transient-mark-mode t) '(uniquify-buffer-name-style (quote post-forward-angle-brackets) nil (uniquify)) '(visible-bell t) '(widget-mouse-face (quote highlight))) (put 'downcase-region 'disabled nil) (put 'upcase-region 'disabled nil) ;;_____________________________________________________________________________ ;; ;; C-MODE ;; Customize various aspects of c-mode to my liking. Remember that placing the ;; cursor on top of some text and pressing C-c C-o will display the ;; c-set-offset parameter name. ;; (defun my-c-mode-hook () (c-set-style "ellemtel") (setq tab-width 4) (setq c-basic-offset 4) (setq indent-tabs-mode nil) (setq c-tab-always-indent nil) (c-set-offset 'statement-case-intro ' + ) (c-set-offset 'topmost-intro '-) (c-toggle-hungry-state 1) (make-local-variable 'compile-command) (setq compile-command (quote "make ")) (if (fboundp 'turn-on-ws-trim) (turn-on-ws-trim)) (cond ((and (eq config-enable-flyspell t) (fboundp 'flyspell-prog-mode)) (flyspell-prog-mode))) (cond ((and (eq config-enable-imenu t) (fboundp 'imenu-add-to-menubar)) (imenu-add-to-menubar "Functions") (setq imenu-sort-function (quote imenu--sort-by-name))))) (add-hook 'c-mode-hook 'my-c-mode-hook) (add-to-list 'auto-mode-alist '("\\.[pP][hH]\\'" . c-mode)) (add-to-list 'auto-mode-alist '("\\.[sSpP][cC]\\'" . c-mode)) ;;_____________________________________________________________________________ ;; ;; C++-MODE ;; Customize various aspects of c++-mode to my liking. ;; (defun my-c++-mode-hook () (c-set-style "ellemtel") (setq tab-width 4) (setq c-basic-offset 4) (setq indent-tabs-mode nil) (setq c-tab-always-indent nil) (c-set-offset 'statement-case-intro ' + ) (c-set-offset 'topmost-intro '-) (c-toggle-hungry-state 1) (make-local-variable 'compile-command) (setq compile-command (quote "make ")) (if (fboundp 'turn-on-ws-trim) (turn-on-ws-trim)) (cond ((and (eq config-enable-flyspell t) (fboundp 'flyspell-prog-mode)) (flyspell-prog-mode))) (cond ((and (eq config-enable-imenu t) (fboundp 'imenu-add-to-menubar)) (imenu-add-to-menubar "Methods") (setq imenu-sort-function (quote imenu--sort-by-name))))) (add-hook 'c++-mode-hook 'my-c++-mode-hook) ;;_____________________________________________________________________________ ;; ;; EMACS-LISP-MODE ;; Customize various aspects of emacs-lisp-mode to my liking. ;; (defun my-emacs-lisp-mode-hook () (cond ((and (eq config-enable-imenu t) (fboundp 'imenu-add-to-menubar)) (imenu-add-to-menubar "Imenu") (setq imenu-sort-function (quote imenu--sort-by-name)))) (if (fboundp 'turn-on-ws-trim) (turn-on-ws-trim)) (cond ((and (eq config-enable-flyspell t) (fboundp 'flyspell-prog-mode)) (flyspell-prog-mode)))) (add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook) ;;_____________________________________________________________________________ ;; ;; JAVA-MODE ;; Customize various aspects of java-mode to my liking. ;; (defun my-java-mode-hook () (c-set-style "java") (setq tab-width 4) (setq c-basic-offset 4) (setq indent-tabs-mode nil) (setq c-tab-always-indent nil) (c-toggle-hungry-state 1) (c-set-offset 'arglist-intro '+) (c-set-offset 'substatement-open 0) (c-set-offset 'case-label '+) (make-local-variable 'compile-command) (setq compile-command (quote "ant -emacs -find ")) (if (fboundp 'turn-on-ws-trim) (turn-on-ws-trim)) (cond ((and (eq config-enable-flyspell t) (fboundp 'flyspell-prog-mode)) (flyspell-prog-mode))) (cond ((and (eq config-enable-jde nil) (eq config-enable-imenu t) (fboundp 'imenu-add-to-menubar)) (imenu-add-to-menubar "Methods") (setq imenu-sort-function (quote imenu--sort-by-name))))) (add-hook 'java-mode-hook 'my-java-mode-hook) ;;_____________________________________________________________________________ ;; ;; MAKEFILE-MODE ;; Customize various aspects of makefile-mode to my liking. ;; (defun my-makefile-mode-hook () (cond ((and (eq config-enable-imenu t) (fboundp 'imenu-add-to-menubar)) (imenu-add-to-menubar "Imenu") (setq imenu-sort-function (quote imenu--sort-by-name)))) (if (fboundp 'turn-on-ws-trim) (turn-on-ws-trim)) (cond ((and (eq config-enable-flyspell t) (fboundp 'flyspell-prog-mode)) (flyspell-prog-mode)))) (add-hook 'makefile-mode-hook 'my-makefile-mode-hook) ;;_____________________________________________________________________________ ;; ;; SQL-MODE ;; Customize various aspects of sql-mode to my liking. Remember that placing ;; the cursor on top of some text and pressing C-c C-o will display the ;; c-set-offset parameter name. ;; (defun my-sql-mode-hook () (setq tab-width 4) (setq c-basic-offset 4) (setq indent-tabs-mode nil) (if (fboundp 'turn-on-ws-trim) (turn-on-ws-trim)) (cond ((and (eq config-enable-flyspell t) (fboundp 'flyspell-prog-mode)) (flyspell-prog-mode)))) (add-hook 'sql-mode-hook 'my-sql-mode-hook) (add-to-list 'auto-mode-alist '("\\.[sS][qQ][lL]\\'" . sql-mode)) ;;_____________________________________________________________________________ ;; ;; Make sure we set the focus to the main Emacs window. ;; TODO: Currently only works under MS-Windows. Find solution for X. ;; ;; (other-frame 0)