;; Linux-Mandrake Configuration ; Chmouel Boudjnah . ; Pixel . ; Thanks to Eric Marsden . ; Russification by AEN . ; Thanks to Oleg Tikhonov. ;; Some macros. (defmacro GNUEmacs (&rest x) (list 'if (string-match "GNU Emacs 21" (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)) ) (GNUEmacs (require 'info) (setq Info-suffix-list (append '( (".info.bz2" . "bunzip2") (".bz2" . "bunzip2") ) Info-suffix-list)) ) ;; More information with the info file (Control-h i) ;; Russification (XEmacs (set-language-environment "Cyrillic-KOI8") (select-input-method "cyrillic-jcuken") ) (GNUEmacs (set-language-environment "Cyrillic-KOI8") ;; for v.20 ;; (set-language-environment "Cyrillic-KOI8-R") (set-terminal-coding-system 'koi8-r) ) ; My addon ;(setq auto-mode-alist (cons '("\.py$" . python-mode) auto-mode-alist)) ;(autoload 'python-mode "python-mode" "Mode for python files." t) (desktop-load-default) (desktop-read) (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. '(canlock-password "0b0d7376626bf3b72a8afa252bae5f71e639ff01") '(case-fold-search t) '(current-language-environment "Cyrillic-KOI8") '(default-input-method "cyrillic-jcuken") '(european-calendar-style t) '(face-font-selection-order (quote (:height :width :slant :weight))) '(global-font-lock-mode t nil (font-lock)) '(pc-select-meta-moves-sexps t) '(pc-select-selection-keys-only t) '(pc-selection-mode t nil (pc-select)) '(speedbar-show-unknown-files t) '(tool-bar-mode nil nil (tool-bar)) '(visible-bell t)) (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 (:stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 1 :width normal :family "default")))) '(fringe ((((class color) (background light)) (:background "DarkSeaGreen")))) '(highlight ((((class color) (background light)) (:background "lightblue" :foreground "white")))) '(info-xref ((t (:foreground "red" :weight bold)))) '(mode-line ((((type x w32 mac) (class color)) (:background "SkyBlue4" :foreground "gold" :box (:line-width -1 :style released-button))))) '(region ((t (:background "DodgerBlue" :foreground "LightYellow1"))))) (GNUEmacs (global-set-key [(control return)] 'speedbar) (global-set-key [(meta return)] 'speedbar-get-focus) ) (desktop-load-default) (desktop-read) ;(require 'ecb) ;(setq semantic-show-unmatched-syntax-mode nil) ;(setq gnus-select-method '(nntp "localhost")) ;(add-to-list 'load-path "/home/svgol/.emacs.d/emacs-wiki/") ;(add-to-list 'load-path "/home/svgol/.emacs.d/planner/") ;(require 'planner) ;(require 'remember) (require 'un-define)