;; Mandrakelinux 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))) (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) (set-face-foreground 'font-lock-type-face "DarkOliveGreen") (GNUEmacs (set-face-foreground 'modeline "red") (set-face-background 'modeline "lemonchiffon")) (GNUEmacs (setq transient-mark-mode 't) ) (XEmacs (set-face-foreground 'bold-italic "Blue") ) (GNUEmacs (Xlaunch (make-face-bold 'bold-italic) )) (set-face-foreground 'bold-italic "Blue") (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)