;;; Linux-Mandrake Configuration for GNU/Emacs. ; Chmouel Boudjnah <chmouel@mandrakesoft.com> ; Pixel <pixel@mandrakesoft.com> ; Frederic Lepied <flepied@mandrakesoft.com> ; See http://www.emacs.org/ for more information and configuration ; examples. ;; Macros to detect if we are under X. (defmacro Xlaunch (&rest x) (list 'if (eq window-system 'x)(cons 'progn x))) ; Under X to get the suppr key working. (Xlaunch (define-key global-map [(delete)] "\C-d")) ;;; 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 [(meta O) ?F] 'end-of-line) ; Don't add lines on the end of lines unless we want. (setq next-line-add-newlines nil) ; X selection manipulation (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... (custom-set-variables '(pc-select-meta-moves-sexps t) '(pc-select-selection-keys-only t) '(pc-selection-mode t)) ;; Show parenthesis mode (show-paren-mode t) ;; By default start in text mode. (setq default-major-mode (lambda () (text-mode) (turn-on-auto-fill) (font-lock-mode))) ; Don't ask to revert for TAGS (setq revert-without-query (cons "TAGS" revert-without-query)) ;; Use the following for i18n ;(standard-display-european t) ;(set-language-environment "latin-1") ;; Color and Fonts. (require 'font-lock) (setq font-lock-mode-maximum-decoration t) ;; turn on colorization. (if (fboundp 'global-font-lock-mode) (global-font-lock-mode t)) ;; turn on auto (de)compression (if (fboundp 'auto-compression-mode) (auto-compression-mode t)) ;; Turn on selection and change the default color (setq transient-mark-mode 't highlight-nonselected-windows 't) ;; Save positions in files between sessions (require 'saveplace) (setq-default save-place t) ;; Visualize long lines (require 'auto-show) ;; Load package or local system startup files (let* ((paths '("/etc/emacs/site-start.d")) ;; Get a list of all the files in all the specified ;; directories that match the pattern. (files (apply 'append (mapcar (lambda (dir) (directory-files dir t "^.*\\.el$" nil)) paths)))) (mapcar (lambda (file) (if debug-on-error (load-file file) (condition-case () (load file nil) (error (message "Error while loading %s" file))))) files) ) ;; More information with the info file (Control-h i)