;; Linux-Mandrake Configuration ; Chmouel Boudjnah . ; Pixel . ; Thanks to Eric Marsden . ;; Some macros. (defmacro GNUEmacs (&rest x) (list 'if (string-match "GNU Emacs 20" (version)) (cons 'progn x))) (defmacro XEmacs (&rest x) (list 'if (string-match "XEmacs 21" (version)) (cons 'progn x))) (defmacro Xlaunch (&rest x) (list 'if (eq window-system 'x)(cons 'progn x))) (add-hook 'after-init-hook 'server-start) (add-hook 'server-done-hook (lambda () (shell-command "screen -r -X select `cat ~/tmp/emacsclient-caller`"))) (GNUEmacs (Xlaunch (define-key global-map [(delete)] "\C-d") )) (GNUEmacs ; XEmacs compatibility (global-set-key [(control tab)] `other-window) (global-set-key [(meta g)] `goto-line) (defun switch-to-other-buffer () (interactive) (switch-to-buffer (other-buffer))) (global-set-key [(meta control ?l)] `switch-to-other-buffer) (global-set-key [(meta O) ?H] 'beginning-of-line) (global-set-key [home] 'beginning-of-line) (global-set-key [(meta O) ?F] 'end-of-line) (global-set-key [end] 'end-of-line) (setq next-line-add-newlines nil)) ; X selection manipulation (GNUEmacs (defun x-own-selection (s) (x-set-selection `PRIMARY s))) (global-set-key [(shift insert)] '(lambda () (interactive) (insert (x-get-selection)))) (global-set-key [(control insert)] '(lambda () (interactive) (x-own-selection (buffer-substring (point) (mark))))) ; Shift-arrows a la windows... (GNUEmacs (custom-set-variables '(pc-select-meta-moves-sexps t) '(pc-select-selection-keys-only t) '(pc-selection-mode t nil (pc-select)))) (XEmacs (if (eq window-system 'x) (global-set-key (read-kbd-macro "DEL") 'delete-char) (or (global-set-key "[3~" 'delete-char)) )) ;; By default we starting in text mode. (setq initial-major-mode (lambda () (text-mode) (turn-on-auto-fill) (font-lock-mode) )) (GNUEmacs (setq revert-without-query (cons "TAGS" revert-without-query))) ; Use the following for i18n ;(standard-display-european t) ;(GNUEmacs (set-language-environment "latin-1")) ;(XEmacs (require 'x-compose)) ; Some new Colors for Font-lock. (setq font-lock-mode-maximum-decoration t) (require 'font-lock) (setq font-lock-use-default-fonts nil) (setq font-lock-use-default-colors nil) (copy-face 'default 'font-lock-string-face) (set-face-foreground 'font-lock-string-face "Sienna") (copy-face 'italic 'font-lock-comment-face) (set-face-foreground 'font-lock-comment-face "Red") (copy-face 'bold 'font-lock-function-name-face) (set-face-foreground 'font-lock-function-name-face "MediumBlue") (copy-face 'default 'font-lock-keyword-face) (set-face-foreground 'font-lock-keyword-face "SteelBlue") (copy-face 'default 'font-lock-type-face) (GNUEmacs (set-face-foreground 'modeline "red") (set-face-background 'modeline "lemonchiffon")) (GNUEmacs (setq transient-mark-mode 't) ) (XEmacs (set-face-foreground 'bold-italic "LightBlue") ) (GNUEmacs (Xlaunch (make-face-bold 'bold-italic) )) (set-face-foreground 'bold-italic "LightBlue") ; (setq default-frame-alist ; '( ; ;;; Define here the default geometry or via ~/.Xdefaults. ; ;; (width . 84) (height . 46) ; (cursor-color . "red") ; (cursor-type . box) ; (foreground-color . "black") ; (background-color . "honeydew"))) ;; A small exemples to show how Emacs is powerfull. ; Define function to match a parenthesis otherwise insert a % (global-set-key "%" 'match-paren) (defun match-paren (arg) "Go to the matching parenthesis if on parenthesis otherwise insert %." (interactive "p") (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) (t (self-insert-command (or arg 1))))) ;; By default turn on colorization. (if (fboundp 'global-font-lock-mode) (global-font-lock-mode t) ) ;; Add bzip2 suffixes to info reader. (XEmacs (require 'info) (setq Info-suffix-list (Append '( (".info.bz2" . "bzip2 -dc %s") (".bz2" . "bzip2 -dc %s") ) Info-suffix-list)) ) ;; More information with the info file (Control-h i) (setq load-path (nconc '( "~/devel/tools/emacs/tramp/lisp" "~/devel/tools/emacs/jde-2.3.0/lisp" "~/devel/tools/emacs/ecb-2.01" "~/devel/tools/emacs/eieio-0.17" "~/devel/tools/emacs/elib-1.0" "~/devel/tools/emacs/speedbar-0.14beta4" "~/devel/tools/emacs/semantic-1.4.4" "~/devel/tools/emacs/coolStuff" "~/devel/tools/emacs/coolStuff/sql-mode" ;; Add paths to other add-on packages here. ) load-path)) (setq default-frame-alist '((left . 70) (width . 150) (top . 769) (height . 90) (cursor-color . "gray") (foreground-color . "ivory") (background-color . "black") (vertical-scroll-bars . right) (font . "-*-clean-medium-r-*-*-10-*-*-*-*-*-*-*") ; (font . "-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1") ; (font . "-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1") ; (font . "-*-Terminal-normal-r-*-*-10-*-*-*-c-*-*-#204-") )) ;(message (w32-select-font)) ; use this code snippet to get w32 font names (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. '(font-lock-comment-face ((((class color) (background light)) (:foreground "Dark sea green")))) '(font-lock-function-name-face ((((class color) (background light)) (:bold t :foreground "green")))) '(font-lock-keyword-face ((((class color) (background light)) (:foreground "LightBlue")))) '(font-lock-reference-face ((((class color) (background light)) (:foreground "Red")))) '(font-lock-string-face ((((class color) (background light)) (:foreground "yellow")))) '(font-lock-type-face ((((class color) (background light)) (:foreground "sky blue")))) '(font-lock-variable-name-face ((t (:foreground "medium sea green")))) '(highlight ((((class color) (background light)) (:foreground "green" :background "dark olive green")))) '(region ((t (:foreground "gray24" :background "PeachPuff4")))) '(secondary-selection ((((class color) (background light)) (:foreground "black" :background "plum4")))) '(widget-field-face ((((class grayscale color) (background light)) (:foreground "black" :background "darkgray")))) '(widget-single-line-field-face ((((class grayscale color) (background light)) (:foreground "black" :background "gray85"))))) (defun uncomment-region (beg end) "...Uncomment selected region" (interactive "r") (comment-region beg end -1)) ;; CSS mode (autoload 'css-mode "css-mode") (setq auto-mode-alist (cons '("\\.css\\'" . css-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.properties" . sh-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.js" . c++-mode) auto-mode-alist)) ;; Stuff needed for JDE (require 'jde) ;; Emacs Code Browser (require 'ecb) (load "toString") ;(setq jde-web-browser "browse-url-default-windows-browser") (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. '(align-c++-modes (quote (c++-mode c-mode java-mode jde-mode))) '(align-dq-string-modes (quote (emacs-lisp-mode lisp-mode scheme-mode c++-mode c-mode jde-mode java-mode perl-mode cperl-mode vhdl-mode))) '(align-indent-before-aligning t) '(align-open-comment-modes (quote (emacs-lisp-mode lisp-mode scheme-mode c++-mode jde-mode java-mode perl-mode cperl-mode makefile-mode tex-mode plain-tex-mode latex-mode slitex-mode vhdl-mode))) '(align-to-tab-stop nil) '(backup-directory nil) '(browse-url-browser-function (quote browse-url-gnome-moz)) '(browse-url-generic-args (quote ("-remote \"openURL("))) '(browse-url-generic-program "/usr/lib/MozillaFirebird/MozillaFirebird") '(browse-url-netscape-program "netscape") '(ecb-compile-window-height 10) '(ecb-options-version "2.01") '(ecb-source-path (quote ("/home/gborggaa/devel/trees/TOT/adserver/src" "/home/gborggaa/devel/trees/TOT/adserver/src/ngu/src" "/home/gborggaa/devel/trees/TOT/adserver/src/ngu/include" "/home/gborggaa/devel/trees/TOT/adserver/src/ngim/src"))) '(jde-ant-args "-emacs") '(jde-ant-buildfile "build.xml") '(jde-ant-complete-target nil) '(jde-ant-enable-find t) '(jde-ant-invocation-method (quote ("Script"))) '(jde-ant-program "ant") '(jde-ant-read-args t) '(jde-ant-read-target t) '(jde-ant-user-jar-files (quote ("/home/gborggaa/devel/tools/apache-ant-1.5.2/lib/optional.jar" "/home/gborggaa/devel/contest/src/problem2/../netgravity/common/jars/crimson.jar" "/usr/java/j2sdk1.4.1_02/lib/rt.jar" "/usr/java/j2sdk1.4.1_02/lib/tools.jar"))) '(jde-auto-parse-buffer-interval 60) '(jde-bug-debug nil) '(jde-bug-jdk-directory "/usr/local/jdk1.2.2.") '(jde-bug-jre-home "/usr/java/j2sdk1.4.1_02") '(jde-bug-key-bindings (quote (("[? ? ?]" . jde-bug-step-over) ("[? ? ?]" . jde-bug-step-into) ("[? ? ?]" . jde-bug-step-into-all) ("[? ? ?]" . jde-bug-step-out) ("[? ? ?]" . jde-bug-continue) ("[? ? ?]" . jde-bug-toggle-breakpoint)))) '(jde-bug-stack-info nil) '(jde-compile-option-classpath nil) '(jde-compile-option-debug (quote ("all" (t nil nil)))) '(jde-compile-option-deprecation t) '(jde-compiler (quote ("javac server" ""))) '(jde-complete-function (quote jde-complete-in-line)) '(jde-db-classic-mode-vm t) '(jde-db-option-connect-address "javadebug") '(jde-debugger (quote ("JDEbug"))) '(jde-enable-abbrev-mode nil) '(jde-gen-code-templates (quote (("Get Set Pair" . jde-gen-get-set) ("Action Listener" . jde-gen-action-listener) ("Window Listener" . jde-gen-window-listener) ("Mouse Listener" . jde-gen-mouse-listener) ("Action" . my-gen-action) ("File-javadoc" . my-gen-file-javadoc) ("Method-javadoc" . my-gen-method-javadoc)))) '(jde-help-docsets (quote (("JDK API" "/usr/java/j2sdk1.4.1_02/docs/api/" nil)))) '(jde-jdk-registry (quote (("1.4.1_03" . "/usr/java/j2sdk1.4.1_02/")))) '(jde-run-application-class "netgravity.common.util.ngutEmail") '(jde-run-classic-mode-vm t) '(jde-run-option-application-args (quote ("d:/build/TOT/adserver/src/ngbp/src/netgravity/admanager/server/ejb/deployment/Order_ejb-jar.xml" "someotherarg"))) '(jde-run-option-connect-to-debugger (quote (t "Attach" "javadebug"))) '(jde-run-option-debug (quote (nil "Attach" nil))) '(jde-run-option-vm-args (quote ("-mx128m" "-Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol"))) '(jde-run-working-direcotry default-directory) '(jde-run-working-directory "D:/DoubleClick/AdServer") '(make-backup-files nil) '(pc-select-meta-moves-sexps t) '(pc-select-selection-keys-only t) '(pc-selection-mode t nil (pc-select)) '(tramp-completion-without-shell-p t) '(tramp-debug-buffer t) '(visible-bell t)) ;; ;; My customizations ;; (add-hook 'java-mode-hook '(lambda ()(define-key jde-mode-map "\C-c\C-v\C-g" 'jde-gen-code))) ;; JDE Templates (defcustom my-gen-file-javadoc '( "\"/** \" 'n" "\" * \" (file-name-nondirectory buffer-file-name) \"

\" 'n" "\" * \" 'n" "\" * \" 'n" "\" * \" 'n" "\" * @author Geoffrey Borggaard\" 'n" "\" */ \" 'n" ) "* Template fore generation javadoc file comments." :group 'jde-gen :type '(repeat string) :set '(lambda (sym val) (defalias 'my-gen-file-javadoc (tempo-define-template "java-doc-file" (jde-gen-read-template val) nil "Insert skeleton file javadoc.")) (set-default sym val))) (defcustom my-gen-method-javadoc '( "\" /** \" 'n" "\" * \" 'n" "\" * \" 'n" "\" * \" 'n" "\" * @param \" 'n" "\" * @return \" 'n" "\" */ \" 'n" ) "* Template for generation of javadoc file comments." :group 'jde-gen :type '(repeat string) :set '(lambda (sym val) (defalias 'my-gen-method-javadoc (tempo-define-template "java-doc-method" (jde-gen-read-template val) nil "Insert skeleton method javadoc.")) (set-default sym val))) (defcustom my-gen-action-template '( "\" Action\" " "'& (P \"Action name: \")" "\" = new AbstractAction() {\" 'n>" "\"public void actionPerformed(ActionEvent e) {\" 'n>" "\"}};\" 'n>" ) "*Template for generating an action listener. Setting this variable defines a template instantiation command, `my-gen-action', as a side-effect." :group 'jde-gen :type '(repeat string) :set '(lambda (sym val) (defalias 'my-gen-action (tempo-define-template "java-action" (jde-gen-read-template val) nil "Insert skeleton action.")) (set-default sym val))) ;;; Go to the last marked file (load "ffap") (defun geoffs-go-to-marked-file () "Goes to the last marked file" (interactive) (if (file-exists-p "~/.lastmarkedfile") (let ((namebuffer (find-file-noselect "~/.lastmarkedfile"))) (set-buffer namebuffer) (switch-to-buffer (find-file-noselect (ffap-file-at-point))) (kill-buffer namebuffer)))) (provide 'geoffs-go-to-marked-file) (defun geoffs-mark-current-file() "Marks the current file" (interactive) (geoffs-mark-file (buffer-file-name))) (defun geoffs-mark-file(filename) (progn (set-buffer (find-file-noselect "~/.lastmarkedfile")) (erase-buffer) (insert filename) (save-buffer 0) (kill-buffer (current-buffer)))) (provide 'geoffs-mark-current-file) (defvar extraload t) ;; show time in modeline (display-time) ;; auto-save files (setq delete-auto-save-files t) ;; don't bother me about GNU at startup ;(setq inhibit-startup-message t) ;(setq inhibit-startup-echo-area-message "zippo") (setq completion-ignored-extensions '(".dvi" ".aux" ".obj" ".exe" ".ckp" ".bak" ".class" ".imp" ".lpt" ".bin" ".otl" ".err" ".lib")) (global-set-key [home] 'beginning-of-line) (global-set-key [end] 'end-of-line) ;; tell java mode not to turn spaces into tabs, or something (i forgot) (add-hook 'java-mode-hook (lambda () (setq indent-tabs-mode nil) ;; (c-set-offset 'substatement-open 0) )) (put 'eval-expression 'disabled nil) (put 'upcase-region 'disabled nil) (put 'narrow-to-region 'disabled nil) (put 'downcase-region 'disabled nil) (setq gnus-select-method '(nntp "Client.ne.news.psi.net")) ;; Power Macros! (require 'power-macros) (power-macros-mode) (pm-load) ;; Home and end keys (require 'pc-keys) (require 'slashdot) (require 'net-utils) (require 'babel) (load "backup-dir") (require 'sql-mode) (sql-initialize) (setq sql-require-final-go (not t)) (setq sql-get-tables-command "select table_name from user_tables;") (setq sql-get-columns-command-prefix "desc ") (setq sql-get-columns-command-suffix "") (load "jumptosource") (load "align") ;; I don't like quiting accidentally. (define-key global-map "\C-x\C-c" 'goto-line) ;; Other keymaps (define-key global-map "\C-x\c" 'comment-region) (define-key global-map "\C-xl" 'goto-line) (define-key global-map [f6] 'slashdot) (define-key global-map [f3] 'hippie-expand) (define-key global-map "\C-xu" 'uncomment-region) (define-key global-map "\C-xt" 'geoffs-mark-current-file) (define-key global-map "\C-x\C-t" 'geoffs-go-to-marked-file) (define-key global-map [f5] 'align-entire) (defun back-error () (interactive) (next-error -1)) ;(global-set-key [(hyper a)] 'next-error) ;(global-set-key [(hyper q)] 'back-error) (setq auto-mode-alist (append '(("\\.war\\'" . archive-mode)) '(("\\.ear\\'" . archive-mode)) '(("\\.sar\\'" . archive-mode)) auto-mode-alist)) (require 'decompile) (geoffs-go-to-marked-file) ; (set-face-foreground 'font-lock-function-name-face "LightBlue") ; (set-face-foreground 'jde-java-font-lock-operator-face "LightBlue") ; (set-face-foreground 'jde-java-font-lock-package-face "LightBlue") ; (set-face-foreground 'speedbar-directory-face "LightBlue") ;;;#ident "@(#)OrigId: pcl-cvs-startup.el,v 1.4 1993/05/31 18:40:33 ceder Exp " ;;; ;;;#ident "@(#)cvs/contrib/pcl-cvs:$Name: $:$Id: pcl-cvs-startup.el,v 1.1 1996/04/14 15:17:59 kfogel Exp $" ;;; (autoload 'cvs-update "pcl-cvs" "Run a 'cvs update' in the current working directory. Feed the output to a *cvs* buffer and run cvs-mode on it. If optional prefix argument LOCAL is non-nil, 'cvs update -l' is run." t) (autoload 'cvs-update-other-window "pcl-cvs" "Run a 'cvs update' in the current working directory. Feed the output to a *cvs* buffer, display it in the other window, and run cvs-mode on it. If optional prefix argument LOCAL is non-nil, 'cvs update -l' is run." t) ;; (require 'tramp) ;; (setq tramp-default-method "smx") (autoload 'visual-basic-mode "visual-basic-mode" "Visual Basic mode." t) (setq auto-mode-alist (append '(("\\.\\(frm\\|bas\\|cls\\)$" . visual-basic-mode)) auto-mode-alist)) (setq tool-bar-mode 'nil) (defun geoffs-post-config () (interactive) (progn (set-foreground-color "ivory") (set-background-color "black") )) (provide 'geoffs-post-config) (global-set-key [f15] 'geoffs-post-config) (defun up-slightly () (interactive) (scroll-up 5)) (defun down-slightly () (interactive) (scroll-down 5)) (global-set-key [mouse-4] 'down-slightly) (global-set-key [mouse-5] 'up-slightly) (defun up-one () (interactive) (scroll-up 1)) (defun down-one () (interactive) (scroll-down 1)) (global-set-key [S-mouse-4] 'down-one) (global-set-key [S-mouse-5] 'up-one) (defun up-a-lot () (interactive) (scroll-up)) (defun down-a-lot () (interactive) (scroll-down)) (global-set-key [C-mouse-4] 'down-a-lot) (global-set-key [C-mouse-5] 'up-a-lot) (defun my-color-theme () "Color theme by Geoffrey A Borggaard, created 2003-04-04." (interactive) (color-theme-install '(my-color-theme ((foreground-color . "ivory") (background-color . "black") (mouse-color . "black") (cursor-color . "gray") (border-color . "black") (background-mode . light)) ( (modeline "white" "black" nil nil nil) (highlight "green" "dark olive green" nil nil nil) (bold nil nil t nil nil) (italic nil nil nil t nil) (bold-italic nil nil t t nil) (region "gray24" "PeachPuff4" nil nil nil) (secondary-selection "black" "plum4" nil nil nil) (underline nil nil nil nil t) (font-lock-comment-face "Dark sea green" nil nil nil nil) (font-lock-string-face "yellow" nil nil nil nil) (font-lock-keyword-face "Blue" nil nil nil nil) (font-lock-builtin-face "Orchid" nil nil nil nil) (font-lock-function-name-face "green" nil t nil nil) (font-lock-variable-name-face "medium sea green" nil nil nil nil) (font-lock-type-face "sky blue" nil nil nil nil) (font-lock-constant-face "CadetBlue" nil nil nil nil) (font-lock-warning-face "Red" nil t nil nil) (widget-documentation-face "dark green" nil nil nil nil) (widget-button-face nil nil t nil nil) (widget-field-face "black" "darkgray" nil nil nil) (widget-single-line-field-face "black" "gray85" nil nil nil) (widget-inactive-face "dim gray" nil nil nil nil) (widget-button-pressed-face "red" nil nil nil nil) (custom-invalid-face "yellow" "red" nil nil nil) (custom-rogue-face "pink" "black" nil nil nil) (custom-modified-face "white" "blue" nil nil nil) (custom-set-face "blue" "white" nil nil nil) (custom-changed-face "white" "blue" nil nil nil) (custom-saved-face nil nil nil nil t) (custom-button-face nil nil nil nil nil) (custom-documentation-face nil nil nil nil nil) (custom-state-face "dark green" nil nil nil nil) (custom-variable-tag-face "blue" nil nil nil t) (custom-variable-button-face nil nil t nil t) (custom-face-tag-face nil nil nil nil t) (custom-group-tag-face-1 "red" nil nil nil t) (custom-group-tag-face "blue" nil nil nil t) (speedbar-button-face "green4" nil nil nil nil) (speedbar-file-face "cyan4" nil nil nil nil) (speedbar-directory-face "blue4" nil nil nil nil) (speedbar-tag-face "brown" nil nil nil nil) (speedbar-selected-face "red" nil nil nil t) (speedbar-highlight-face nil "green" nil nil nil) (jde-bug-breakpoint-cursor "cyan" "brown" nil nil nil) (jde-bug-breakpoint-marker "red" "yellow" nil nil nil) ) (default ((t (:stipple nil :background "black" :foreground "peachpuff" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 44 :width normal :family "schumacher-clean")))) (zmacs-region ((t (:background "white" :foreground "black")))))))