(defvar sk:is-xemacs (string-match "XEmacs" emacs-version)
"Variable interne différente de nil si on est dans XEmacs")
(defvar sk:home (expand-file-name "~") "Home sweet home")
(defvar sk:elisp-path "~/.elisp" "Chemin vers mes packages elisp")
(add-to-list 'load-path sk:elisp-path)
(progn (cd sk:elisp-path)
(normal-top-level-add-subdirs-to-load-path)
(cd sk:home))
(let ((gnusp (concat sk:elisp-path "/gnus")))
(when (file-exists-p gnusp)
(add-to-list 'load-path gnusp)))
(setq gnus-home-directory (concat sk:home "/.gnus.d"))
(setq message-directory (concat gnus-home-directory "/Mail"))
(setq gnus-directory (concat gnus-home-directory "/News"))
(setq gnus-agent-directory (concat gnus-home-directory "/agent"))
(setq read-mail-command 'gnus) (setq mail-user-agent 'gnus-user-agent
)
(set-language-environment 'French) (prefer-coding-system 'utf-8) (set-locale-environment "fr_FR")
(when (< emacs-major-version 23)
(unify-8859-on-encoding-mode t) (unify-8859-on-decoding-mode t) )
(cond ((eq system-type 'darwin)
(message "on est sous mac")
(setq process-connection-type t)
(setq mac-option-modifier 'none) (setq mac-command-modifier 'meta)
(if window-system
(progn
(set-background-color "gray90")
(create-fontset-from-fontset-spec "-misc-seki-medium-r-*-12-*-*-*-*-*-*-fontset-custom_seki")
(set-fontset-font "fontset-custom_seki" 'latin-iso8859-1 '("Monaco" . "iso8859-1"))
(set-fontset-font "fontset-custom_seki" 'latin-iso8859-15 '("Monaco" . "iso8859-15"))
(set-fontset-font "fontset-custom_seki" '(#x2200 . #x2200) '("Monaco" . "iso8859-15"))
(set-frame-font "-misc-seki-medium-r-*-12-*-*-*-*-*-*-fontset-custom_seki")
(setq default-frame-alist '((width . 120)
(height . 44)
(top . 76) (left . 260) (font . "-misc-seki-medium-r-*-12-*-*-*-*-*-*-fontset-custom_seki")
(cursor-type . bar)
(cursor-color . "purple")
))
)
)
(global-set-key (kbd "<kp-delete>") 'delete-char) (global-set-key (kbd "<kp-divide>") "/") (global-set-key (kbd "<C-kp-home>") (kbd "<C-home>")) (global-set-key (kbd "<C-kp-end>") (kbd "<C-end>"))
(global-set-key (kbd "<home>") 'beginning-of-line)
(global-set-key (kbd "<end>") 'end-of-line)
(setq printer-name "IMP_DEV_PROJ")
(setq ps-mule-font-info-database-default '((latin-iso8859-15 (normal nil nil iso-latin-9))
(latin-iso8859-1 (normal nil nil iso-latin-1))))
)
((eq system-type 'windows-nt) (progn
(message "on est sous ouin-ouin")
(global-set-key [128] 'sk-insere-euro)
(when (string-match "^PC-SEBASTIEN" system-name)
(setq w32-alt-is-meta nil)
(setq w32-lwindow-modifier 'meta))
(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)
(if window-system
(progn
(set-background-color "gray90")
(set-cursor-color "#ff00aa")
(create-fontset-from-fontset-spec
"-*-lucida console-*-*-*-*-10-*-*-*-*-*-fontset-lucida,
ascii:-*-lucida console-*-*-*-*-10-*-*-*-*-*-iso8859-1,
latin-iso8859-1:-*-lucida console-*-*-*-*-10-*-*-*-*-*-iso8859-1")
(create-fontset-from-fontset-spec
"-*-consolas-*-*-*-*-12-*-*-*-*-*-fontset-consolas,
ascii:-*-consolas-*-*-*-*-12-*-*-*-*-*-iso8859-1,
latin-iso8859-1:-*-consolas-*-*-*-*-12-*-*-*-*-*-iso8859-1,
latin-iso8859-15:-*-consolas-*-*-*-*-12-*-*-*-*-*-iso8859-15,
uniscribe:-*-Arial Unicode MS-*-*-*-*-12-*-*-*-*-*-iso8859-15")
(setq default-frame-alist '((width . 100)
(height . 44)
(top . 50) (left . 50) (font . "fontset-consolas") (cursor-type . bar)
(cursor-color . "purple")
))
)
)
)
)
((eq system-type 'gnu/linux) (progn
(message "on est avec le pingouin")
()
(if window-system
(progn
(set-background-color "gray90")
(create-fontset-from-fontset-spec
"-gnu-unifont-*-*-*-*-16-*-*-*-*-*-fontset-unifont,
ascii:-gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1,
latin-iso8859-1:-gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1")
(create-fontset-from-fontset-spec
"-Misc-Fixed-Medium-R-SemiCondensed--12-*-*-*-*-*-fontset-obelix,
latin-iso8859-1:-Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO8859-1,
latin-iso8859-15:-Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO8859-15,
mule-unicode-2500-33ff:-Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1,
unicode-bmp:-Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1,
chinese-gb2312:-Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1,
chinese-gbk:-Misc-Fixed-Medium-R-SemiCondensed--12-110-75-75-C-60-ISO10646-1")
(setq initial-frame-alist '((width . 110)
(height . 45)
(top . 80) (left . 180) (font . "fontset-obelix")
(cursor-type . bar)
))
(setq default-frame-alist initial-frame-alist)
(defun browse-url-firefox-new-tab (url &optional new-window)
"Open URL in a new tab in Firefox."
(interactive (browse-url-interactive-arg "URL: "))
(let ((cmd (shell-command-to-string
(concat "mozilla-firefox -a firefox -remote 'openURL("
url ",new-tab)' > /dev/null"))))
(unless (string= "" cmd)
(message "Starting Firefox...")
(start-process (concat "firefox " url) nil "/bin/sh" "-c"
(concat "mozilla-firefox " url "|| true"))
(message "Starting Firefox...done"))))
(setq browse-url-browser-function 'browse-url-firefox-new-tab)
)
)
(setq printer-name "Obelix")
)
)
(t (message "Plateforme non identifiée"))
)
(setq inhibit-startup-message t gnus-inhibit-startup-message t) (fset 'yes-or-no-p 'y-or-n-p)
(setq visible-bell t)
(blink-cursor-mode 0)
(setq use-dialog-box nil
use-file-dialog nil)
(setq make-backup-files nil)
(setq-default ctl-arrow 'latin-9)
(setq show-nonbreak-escape nil)
(setq scroll-preserve-screen-position t)
(setq column-number-mode t)
(setq line-number-mode t)
(add-hook 'before-save-hook 'time-stamp)
(when (require 'saveplace)
(setq-default save-place t))
(setq ps-paper-type 'a4)
(setq sentence-end-double-space nil)
(setq require-final-newline 1
mode-require-final-newline 1)
(setq mouse-yank-at-point nil)
(setq track-eol 'nil)
(setq-default indicate-empty-lines t)
(define-key key-translation-map [(control ?')] (lookup-key key-translation-map [(control ?x) ?8 ?']))
(define-key key-translation-map [(control ?`)] (lookup-key key-translation-map [(control ?x) ?8 ?`]))
(define-key key-translation-map [(control ?")] (lookup-key key-translation-map [(control ?x) ?8 ?"]))
(global-set-key [(control ?6)] (lookup-key key-translation-map [(control ?x) ?8 ?^]))
(if (eq system-type 'gnu/linux)
(define-key key-translation-map [(control 2226)] (lookup-key key-translation-map [(control ?x) ?8]))
(define-key key-translation-map [(control 178)] (lookup-key key-translation-map [(control ?x) ?8]))
)
(global-set-key (quote [S-iso-lefttab]) 'hippie-expand)
(global-set-key (quote [S-tab]) 'hippie-expand)
(global-set-key [(control tab)] `other-window)
(global-set-key [(control meta tab)] `other-frame)
(when (require 'ido nil t)
(ido-mode t)
(setq ido-enable-regexp t)
)
(global-set-key "\C-cg" 'goto-line)
(when (require 'recentf)
(setq recentf-auto-cleanup 'never) (recentf-mode 1))
(require 'kill-ring-rotate nil t)
(setq-default ediff-ignore-similar-regions t
ediff-custom-diff-options "-u" ediff-backup-specs "-z .orig -b"
)
(add-hook 'ediff-cleanup-hook (lambda () (ediff-janitor nil nil))) (setq ediff-diff-ok-lines-regexp
(concat
"^\\("
"[0-9,]+[acd][0-9,]+\C-m?$"
"\\|[<>] "
"\\|---"
"\\|.*Warning *:"
"\\|.*No +newline"
"\\|.*missing +newline"
"\\|.*Pas +de +fin +de +ligne"
"\\|.*Kein +Zeilenumbruch +am +Dateiende"
"\\|^\C-m?$"
"\\)"))
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
(when (require 'paren)
(show-paren-mode t)
(setq blink-matching-paren t)
(setq blink-matching-paren-on-screen t)
(setq show-paren-style 'parenthesis)
(setq blink-matching-paren-dont-ignore-comments t))
(auto-compression-mode t)
(tool-bar-mode -1)
(setq case-fold-search t)
(setq-default tab-width 4)(setq-default indent-tabs-mode nil) (defvaralias 'c-basic-offset 'tab-width)
(defvaralias 'cperl-indent-level 'tab-width)
(require 'boxquote nil t)
(setq read-quoted-char-radix 16)
(defconst dabbrev-always-check-other-buffers t) (defconst dabbrev-abbrev-char-regexp "\\sw\\|\\s_")
(setq hippie-expand-try-functions-list
'(try-expand-dabbrev
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-complete-file-name-partially
try-complete-file-name
try-complete-lisp-symbol-partially
try-complete-lisp-symbol
try-expand-whole-kill))
(global-set-key [home] 'My-smart-home)
(global-set-key [end] 'My-smart-end)
(defun My-smart-home ()
"Odd home to beginning of line, even home to beginning of text/code."
(interactive)
(if (and (eq last-command 'My-smart-home)
(/= (line-beginning-position) (point)))
(beginning-of-line)
(beginning-of-line-text))
)
(defun My-smart-end ()
"Odd end to end of line, even end to begin of text/code."
(interactive)
(if (and (eq last-command 'My-smart-end)
(= (line-end-position) (point)))
(end-of-line-text)
(end-of-line))
)
(defun end-of-line-text ()
"Move to end of current line and skip comments and trailing space.
Require `font-lock'."
(interactive)
(end-of-line)
(let ((bol (line-beginning-position)))
(unless (eq font-lock-comment-face (get-text-property bol 'face))
(while (and (/= bol (point))
(eq font-lock-comment-face
(get-text-property (point) 'face)))
(backward-char 1))
(unless (= (point) bol)
(forward-char 1) (skip-chars-backward " \t\n"))))
)
(when (require 'printing nil t)
)
(setq display-time-load-average-threshold 1.0)
(server-start)
(add-hook 'server-switch-hook
(lambda ()
(let ((server-buf (current-buffer)))
(bury-buffer)
(switch-to-buffer-other-frame server-buf))))
(add-hook 'server-done-hook
(lambda () (delete-frame)))
(when (require 'edit-server nil 't)
(setq edit-server-new-frame nil)
(edit-server-start))
(setq calendar-week-start-day 1)
(setq display-time-24hr-format t)
(display-time)
(defvar calendar-day-abbrev-array
["dim" "lun" "mar" "mer" "jeu" "ven" "sam"])
(defvar calendar-day-name-array
["dimanche" "lundi" "mardi" "mercredi" "jeudi" "vendredi" "samedi"])
(defvar calendar-month-abbrev-array
["jan" "fév" "mar" "avr" "mai" "jun"
"jul" "aoû" "sep" "oct" "nov" "déc"])
(defvar calendar-month-name-array
["janvier" "février" "mars" "avril" "mai" "juin"
"juillet" "août" "septembre" "octobre" "novembre" "décembre"])
(setq calendar-date-display-form '(dayname " " day " " monthname " " year))
(setq calendar-location-name "Metz, FR"
calendar-latitude [49 07 north]
calendar-longitude [6 10 east])
(setq mark-holidays-in-calendar t
general-holidays nil
hebrew-holidays nil
islamic-holidays nil
bahai-holidays nil
oriental-holidays nil)
(setq local-holidays
'((holiday-fixed 5 1 "Fête du travail")
(holiday-fixed 5 8 "Victoire 1945")
(holiday-fixed 7 14 "Fête nationale")
(holiday-fixed 8 15 "Assomption")
(holiday-fixed 11 1 "Toussaint")
(holiday-fixed 11 11 "Armistice 1918")
(holiday-float 5 0 2 "Fête des mères")
(holiday-float 6 0 3 "Fête des pères")))
(when (require 'bbdb nil t)
(progn
(bbdb-initialize 'gnus 'message)
(setq gnus-optional-headers 'bbdb/gnus-lines-and-from
bbdb-complete-name-allow-cycling t
bbdb-send-mail-style 'gnus) (autoload 'bbdb/gnus-lines-and-from "bbdb-gnus")
(autoload 'bbdb "bbdb-com" "Insidious Big Brother Database" t)
(autoload 'bbdb-name "bbdb-com" "Insidious Big Brother Database" t)
(autoload 'bbdb-company "bbdb-com" "Insidious Big Brother Database" t)
(autoload 'bbdb-net "bbdb-com" "Insidious Big Brother Database" t)
(autoload 'bbdb-notes "bbdb-com" "Insidious Big Brother Database" t)
(autoload 'bbdb-insinuate-vm "bbdb-vm" "Hook BBDB into VM")
(autoload 'bbdb-insinuate-rmail "bbdb-rmail" "Hook BBDB into RMAIL")
(autoload 'bbdb-insinuate-mh "bbdb-mhe" "Hook BBDB into MH-E")
(autoload 'bbdb-insinuate-gnus "bbdb-gnus" "Hook BBDB into GNUS")
(autoload 'bbdb-insinuate-sendmail "bbdb" "Hook BBDB into sendmail")
(add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
(autoload 'bbdb/send-hook "moy-bbdb"
"Function to be added to `message-send-hook' to notice records when sending messages" t)
(add-hook 'message-send-hook 'bbdb/send-hook)
(setq bbdb-north-american-phone-numbers-p nil)
(setq bbdb-use-pop-up nil)
(setq bbdb-default-area-code nil)
(setq bbdb/mail-auto-create-p nil
bbdb/news-auto-create-p nil
bbdb/send-auto-create-p nil
bbdb/send-prompt-for-create-p t
) (setq bbdb-pop-up-target-lines 7)
(setq bbdb-always-add-addresses nil
bbdb-quiet-about-name-mismatches t)
(setq bbdb-offer-save 'savenoprompt)
(setq bbdb-dwim-net-address-allow-redundancy t)
)
)
(require 'eudc nil t)
(if (featurep 'bbdb)
(require 'eudcb-bbdb nil t))
(require 'eudcb-mab nil t)
(setq eudc-inline-expansion-servers 'hotlist) (add-to-list 'eudc-server-hotlist '("localhost" . bbdb) t)
(eudc-protocol-set 'eudc-inline-query-format
'((firstname)
(lastname)
(firstname lastname)
(net))
'bbdb)
(eudc-protocol-set 'eudc-inline-expansion-format
'("%s %s <%s>" firstname lastname net)
'bbdb)
(when (string-match "\\`goudurix" system-name)
(add-to-list 'eudc-server-hotlist '("localhost" . mab) t)
(add-to-list 'eudc-server-hotlist '("metz-exchange" . ldap) t)
(setq ldap-host-parameters-alist '(("metz-exchange" base "o=SAGE" auth nil scope subtree))
eudc-query-form-attributes '(uid name firstname email))
(eudc-protocol-set 'eudc-inline-query-format
'((name)
(email))
'mab)
(eudc-protocol-set 'eudc-inline-expansion-format
'("%s <%s>" name email)
'mab)
(eudc-protocol-set 'eudc-inline-query-format
'(
(uid)
(name)
(mail))
'ldap)
(eudc-protocol-set 'eudc-inline-expansion-format
'("%s <%s>" cn mail)
'ldap))
(setq eudc-default-return-attributes nil
eudc-strict-return-matches nil)
(if (featurep 'bbdb)
(eudc-set-server "localhost" 'bbdb t))
(when (require 'ispell)
(setq ispell-program-name "aspell")
(setq ispell-dictionary "fr") (autoload 'flyspell-mode "flyspell" "On-the-fly spelling." t)
)
(defvar sk:custom-directory (concat sk:home "/.emacs.d")
"Chemin vers les fichiers de configuration d'Emacs")
(setq custom-file (concat sk:custom-directory "/.emacs-custom"))
(when (file-exists-p custom-file)
(load-file custom-file))
(setq c-basic-offset 4
c-offsets-alist (quote ((case-label . +)))
c-style-variables-are-local-p nil
c-tab-always-indent (quote other))
(eval-after-load "ecb"
(setq ecb-directories-menu-user-extension-function nil
ecb-history-menu-user-extension-function nil
ecb-layout-name "left3"
ecb-methods-menu-user-extension-function nil
ecb-new-ecb-frame t))
(defun sk-insere-euro (&optional arg) "Insère le symbole Euro ISO 8859-15.
Avec un préfixe, insère la version Unicode."
(interactive "*P")
(if arg
(insert (make-char 'mule-unicode-0100-24ff 116 76))
(insert (make-char 'latin-iso8859-15 164))))
(defun sk-oe (&optional arg) "Insère le e dans l'o."
(interactive "*P")
(insert (make-char 'latin-iso8859-15 #xBD)))
(if (eq system-type 'darwin)
(progn
(defvar sw-last-applescript nil
"Stores the last Applescript command executed from Emacs.")
(defvar sw-applescript-buffer-name "*AppleScript output*"
"Name for the buffer to display AppleScript output.")
(defun sw-applescript-run-buffer ()
"Execute the whole buffer as an Applescript"
(interactive)
(setq sw-last-applescript (buffer-string))
(sw-run-and-display-applescript (buffer-string)))
(defun sw-applescript-run-region ()
"Execute the region as an Applescript"
(interactive)
(let ((region (buffer-substring (region-beginning) (region-end))))
(setq sw-last-applescript region)
(sw-run-and-display-applescript region)))
(defun sw-run-last-applescript ()
"Run the last Applescript command again"
(interactive)
(sw-run-and-display-applescript sw-last-applescript))
(defun sw-run-and-display-applescript (code)
"Switch to the AppleScript buffer, erase it, run the code and display the results."
(switch-to-buffer (get-buffer-create sw-applescript-buffer-name))
(erase-buffer)
(insert (do-applescript code)))
))
(defun delete-trailing-spaces () "Effacer les espaces et tabulations en fin de chaque ligne du tampon"
(interactive)
(progn
(save-excursion
(goto-line 1)
(replace-regexp "[ \t]+$" ""))))
(defun dos2unix ()
(interactive)
(goto-char (point-min))
(while (search-forward "\r" nil t)
(replace-match "")))
(defun unix2dos ()
(interactive)
(goto-char (point-min))
(while (search-forward "\n" nil t)
(replace-match "\r\n")))
(defun ascii-table ()
"Afficher la table de caractères ASCII."
(interactive)
(switch-to-buffer "*ASCII*")
(erase-buffer)
(insert (format "Caractères ASCII de code 1 à 254.\n"))
(let ((i 0))
(while (< i 254) (setq i (+ i 1))
(insert (format "%4d %c\n" i i))))
(beginning-of-buffer))
(load-library "calendar.elc")
(defun sk-insere-date ()
(interactive)
(insert (calendar-date-string (calendar-current-date))))
(defun sk-insere-date-sel ()
(interactive)
(when (and (boundp 'calendar-buffer)
(buffer-live-p (get-buffer calendar-buffer))
(let ((str
(with-current-buffer calendar-buffer
(calendar-date-string (calendar-cursor-to-date t)))))
(insert str)))))
(eval-after-load "gnus-start" '(progn (make-face 'my-gnus-group-line-ticked-face)
(make-face 'my-gnus-group-line-new-face)
(make-face 'my-gnus-group-line-unread-face)
(make-face 'my-gnus-topic-line-face)
(make-face 'my-gnus-mouse-group-line-ticked-face)
(make-face 'my-gnus-mouse-group-line-new-face)
(make-face 'my-gnus-mouse-group-line-unread-face)
(make-face 'my-gnus-mouse-group-line-groupname-face)
(make-face 'my-gnus-mouse-topic-line-face)
(make-face 'my-gnus-group-line-groupname-face)
(make-face 'my-gnus-group-line-groupname-read-face-1)
(make-face 'my-gnus-group-line-groupname-read-face-2)
(make-face 'my-gnus-group-line-groupname-read-face-3)
(make-face 'my-gnus-group-line-groupname-read-face-4)
(make-face 'my-gnus-group-line-groupname-unread-face-1)
(make-face 'my-gnus-group-line-groupname-unread-face-2)
(make-face 'my-gnus-group-line-groupname-unread-face-3)
(make-face 'my-gnus-group-line-groupname-unread-face-4)
(setq gnus-face-1 'my-gnus-group-line-ticked-face)
(setq gnus-face-2 'my-gnus-group-line-new-face)
(setq gnus-face-3 'my-gnus-group-line-unread-face)
(setq gnus-face-5 'my-gnus-topic-line-face)
(setq gnus-face-8 'my-gnus-summary-line-tree-face)
(setq gnus-mouse-face-1 'my-gnus-mouse-group-line-ticked-face)
(setq gnus-mouse-face-2 'my-gnus-mouse-group-line-new-face)
(setq gnus-mouse-face-3 'my-gnus-mouse-group-line-unread-face)
(setq gnus-mouse-face-4 'my-gnus-mouse-group-line-groupname-face)
(setq gnus-mouse-face-5 'my-gnus-mouse-topic-line-face)
))
(defvar sk:ps-hide-local-variables t
"FIXME:...")
(defun sk:hide-local-variables ()
(narrow-to-region (point-min)
(progn
(end-of-buffer)
(when (re-search-backward "Local Variables" nil t) (forward-line -1))
(point))))
(defadvice ps-print-buffer
(around sk:ps-print-buffer activate)
"FIXME:..."
(save-excursion
(save-restriction
(when sk:ps-hide-local-variables
(sk:hide-local-variables))
ad-do-it)))
(defadvice ps-print-buffer-with-faces
(around sk:ps-print-buffer-with-faces activate)
"FIXME:..."
(save-excursion
(save-restriction
(when sk:ps-hide-local-variables
(sk:hide-local-variables))
ad-do-it)))
(defadvice ps-spool-buffer
(around sk:ps-spool-buffer activate)
"FIXME:..."
(save-excursion
(save-restriction
(when sk:ps-hide-local-variables
(sk:hide-local-variables))
ad-do-it)))
(defadvice ps-spool-buffer-with-faces
(around sk:ps-spool-buffer-with-faces activate)
"FIXME:..."
(save-excursion
(save-restriction
(when sk:ps-hide-local-variables
(sk:hide-local-variables))
ad-do-it)))
(defun sk:ps-date-format ()
"Retourne le format de date dd/mm/yy"
(format-time-string "%d/%m/%y"))
(setq ps-right-header '("/pagenumberstring load"
sk:ps-date-format
ps-time-stamp-hh:mm:ss))
(setq apropos-do-all t)
(global-set-key (kbd "C-h a") 'apropos)
(defadvice apropos-value (around drkm-my:apropos-value activate)
"FIXME<docstring>: ..."
(let ((apropos-do-all (if (let ((arg (ad-get-arg 1)))
(or (eq arg '-)
(and (numberp arg) (< arg 0))))
(ad-set-arg 1 nil)
apropos-do-all)))
ad-do-it))
(setq Man-notify-method 'newframe Man-frame-parameters
'((foreground-color . "black")
(background-color . "grey90")
(cursor-color . "black")
(mouse-color . "gold")
(width . 80)
(tool-bar-lines . 0)))
(require 'info)
(let ((infop (concat sk:elisp-path "/info")))
(when (file-exists-p infop)
(setq Info-directory-list Info-default-directory-list) (push infop Info-directory-list)))
(when (or (string-match "\\`goudurix" system-name)
(string-match "\\`zebigbos" system-name))
(push "/sw/share/info" Info-directory-list)
(push "/Applications/Emacs.app/Contents/Resources/info" Info-directory-list) )
(setq Info-fontify-maximum-menu-size 1000000)
(defun Info-other-frame (&optional file)
"Start *info* mode in another frame."
(interactive (if current-prefix-arg
(list (read-file-name "Info file name: " nil nil t))))
(let ((pop-up-frames t)
(buffer (current-buffer)))
(pop-to-buffer buffer t)
(raise-frame (window-frame (selected-window)))
(info file)))
(defun Info-uniquify-buffer ()
"Rename an *info* buffer uniquely."
(rename-buffer "*info*" 't))
(defun Info-rename-buffer (suffix)
"Rename an *info* buffer according to the user's choice."
(interactive "sBuffer name suffix: ")
(rename-buffer (concat "*info-" suffix "*")))
(defun Info-search-again (regexp)
"Search an info file with a better user-interface than Info-search."
(interactive (list (if Info-search-history
(car Info-search-history)
(read-string "Regexp search: "
nil 'Info-search-history))))
(Info-search regexp))
(global-set-key "\C-x5i" 'Info-other-frame )
(add-hook 'Info-mode-hook 'Info-uniquify-buffer)
(define-key Info-mode-map "s" 'Info-search-again)
(define-key Info-mode-map "S" 'Info-search)
(define-key Info-mode-map "r" 'Info-rename-buffer)
(require 'screen-lines2 nil t)
(require 'find-this-file nil t)
(require 'visual-basic-mode nil t)
(if (load "folding" 'nomessage 'noerror)
(folding-mode-add-find-file-hook))
(add-hook 'docbook-mode-hook
'turn-on-font-lock)
(when (require 'w3m-load nil t)
(if (string-match "\\`goudurix" system-name)
(setq w3m-icon-directory (concat sk:elisp-path "/w3m/icons"))))
(eval-after-load "dired"
'(progn
(defadvice dired-advertised-find-file (around dired-subst-directory activate)
"Replace current buffer if file is a directory."
(interactive)
(let* ((orig (current-buffer))
(filename (dired-get-filename))
(bye-p (file-directory-p filename)))
ad-do-it
(when (and bye-p (not (string-match "[/\\\\]\\.$" filename)))
(kill-buffer orig))))))
(autoload 'pymacs-load "pymacs" nil t)
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(unless window-system
(progn
(global-set-key "\eOp" "0")
(global-set-key "\eOq" "1")
(global-set-key "\eOr" "2")
(global-set-key "\eOs" "3")
(global-set-key "\eOt" "4")
(global-set-key "\eOu" "5")
(global-set-key "\eOv" "6")
(global-set-key "\eOw" "7")
(global-set-key "\eOx" "8")
(global-set-key "\eOy" "9")
(global-set-key "\eOQ" "/")
(global-set-key "\eOR" "*")
(global-set-key "\eOS" "-")
(global-set-key "\eOl" "+")
(global-set-key "\eOm" 'newline-and-indent)
(global-set-key "\eOn" ".")
))
(require 'cdi nil t)
(when (require 'emms nil t)
(when (require 'emms-default nil t)
(emms-setup 'advanced (concat sk:home "/mp3"))))
(when (string-match "\\`goudurix" system-name)
(setq load-path (cons "/Users/seki/Appl/xref/emacs" load-path))
(setq exec-path (cons "/Users/seki/Appl/xref" exec-path))
(load "xrefactory"))
(autoload 'underhat-region "under" "Underline the region" t)
(global-set-key "\C-c\C-u" 'underhat-region)
(when (require 'erc-auto nil t)
(require 'erc-menu)
(require 'erc-nicklist)
(setq erc-nick "seki"
erc-user-full-name "Sébastien Kirche"
erc-public-away-p nil
erc-port 6667
erc-prompt-for-password nil)
(setq erc-default-coding-system '(utf-8 . undecided))
(setq erc-paranoid t)
(load (concat sk:home "/.emacs_ercpass"))
(require 'erc-services)
(erc-services-mode 1)
(setq erc-prompt-for-nickserv-password nil)
(setq erc-nickserv-passwords
'((freenode (("seki" . ,freenode-nickone-pass)
("seki_zzzz" . ,freenode-nickone-pass)))
)
)
(setq erc-encoding-coding-alist '())
(add-to-list 'erc-encoding-coding-alist '("#emacsfr" . utf-8))
(add-to-list 'erc-encoding-coding-alist '("#fmbl" . latin-0))
(add-to-list 'erc-encoding-coding-alist '("#seki" . latin-0))
(add-to-list 'erc-encoding-coding-alist '("#seki8" . utf-8))
)
(when (require 'planner nil t)
(require 'muse-mode nil t)
(require 'remember-planner nil t)
(setq planner-directory (concat sk:home "/Plans"))
(setq planner-publishing-directory (concat planner-directory "/wiki"))
(setq planner-project "WikiPlanner"
planner-default-page "TaskPool")
(setq muse-project-alist
`((,planner-project (,planner-directory
:default ,planner-default-page
:major-mode planner-mode
:visit-link planner-visit-link)
(:base "xhtml"
:path ,planner-publishing-directory)))))
(let ((nxml-loader (concat sk:elisp-path "/nxml/rng-auto.el")))
(when (file-exists-p nxml-loader)
(load nxml-loader)
(add-to-list 'auto-mode-alist '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)" . nxml-mode))))
(if (eq system-type 'darwin)
(setq face-font-rescale-alist '((".*osaka-bold.*" . 1.15)
(".*osaka-medium-i.*" . 1.2)
(".*osaka-medium-r.*" . 1.2)
(".*courier-medium.*" . 1.0)
(".*courier-bold.*" . 1.0)
("-cdac$" . 1.3))))
(when (require 'remem nil t)
(setq remem-log-p t)
(setq remem-database-dir "~/R-Agent")
(setq remem-scopes-list '(
("mail" 6 5 50)
("docspersos" 6 5 50)
))
)
(setq-default ps-lpr-command "C:/Program Files/Ghostgum/gsview/gsprint.exe")
(setq-default ps-printer-name t)
(setq-default ps-printer-name-option nil)
(setq ps-lpr-switches '("-query"))
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(when (require 'tramp nil t)
(add-to-list 'tramp-methods
(list "ecpl" '(tramp-login-program "plink")
(cons 'tramp-login-args
(list (list
'("-l" "%u")
'("-P" "%p")
'("-ssh")
'("-t")
'("-a")
'("-x")
(if (equal system-type 'windows-nt)
(progn
(setq keyfilename (expand-file-name (concat (getenv "HOME") "/.ssh/kirchse-priv.ppk")))
(if (file-exists-p keyfilename)
(list "-i" (concat "\"" keyfilename "\"")))))
'("%h")
'("\"")
'("env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ '")
'("/bin/sh")
'("\"")
)))
'(tramp-remote-shell "/bin/sh")
'(tramp-remote-shell-login ("-l"))
'(tramp-remote-shell-args ("-c"))
'(tramp-default-port 22))
t)
(setq tramp-backup-directory-alist nil)
(setq tramp-auto-save-directory nil)
(when (or (string-match "\\`obelix" system-name)
(string-match "\\`petisuix" system-name))
(setq tramp-shell-prompt-pattern "[0-9]+:[0-9]+ \\w+@\\w+ [^#%]*[#%] *"))
)
(when (or (string-match "\\`obelix" system-name)
(string-match "\\`petisuix" system-name))
(setq tramp-shell-prompt-pattern "[0-9]+:[0-9]+ \\w+@\\w+ [^#%]*[#%] *"))
(when (> emacs-major-version 22)
)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'narrow-to-region 'disabled nil)
(let ((elpa-dir (expand-file-name "~/.emacs.d/elpa")))
(when (and (file-exists-p elpa-dir)
(load (concat (file-name-as-directory elpa-dir) "package.el")))
(package-initialize))
)
(when (file-exists-p "c:/dev/perl/Emacs-PDE-0.2.16")
(add-to-list 'load-path "c:/dev/perl/Emacs-PDE-0.2.16/lisp/")
(load "pde-load"))