3 ;; Author: Olivier Tetard <olivier.tetard@miskin.fr>
4 ;; URL : http://toutoune25.miskin.fr/
6 ;; This file is free software; you can redistribute it and/or modify it
7 ;; under the terms of the GNU General Public License as published by the
8 ;; Free Software Foundation; either version 2, or (at your option) any
11 ;; This file is distributed in the hope that it will be useful, but
12 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ;; General Public License for more details.
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GNU Emacs; see the file COPYING. If not, write to the Free
18 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 ;; Inspiré par les fichiers de :
22 ;; * Julien Danjou (julien.danjou.org)
23 ;; * Mark Triggs (http://grapevine.net.au/)
26 ;; | Extensions et paths
29 (push (expand-file-name "~/.elisp") load-path)
37 ;; | Couleurs et apparence
44 (if (>= emacs-major-version 23)
45 (set-frame-font "DejaVu Sans Mono-10"))
51 (server-start) ; Multi-tty powa !
52 (ido-mode t) ; Utilisation du mode ido
53 (setq auto-save-interval 1200) ; Autosave
54 (setq scroll-step 2) ; On se decale de 2 lignes quand on change de page
55 (delete-selection-mode t) ; On peut supprimer une selection
56 (fset 'yes-or-no-p 'y-or-n-p) ; yes == y
57 (show-paren-mode t) ; On affiche les parentheses liées
58 (setq display-time-24hr-format t) ; Heure au format 24h
59 (display-time) ; On affiche l'heure dans la barre
60 (setq visible-bell t) ; On desactive les beeps
61 (setq inhibit-startup-screen t) ; On désactive le splash screen
62 (setq use-file-dialog nil) ; Désactivation des boites de
63 (setq use-dialog-box nil) ; fichiers GTK+
64 (setq scroll-bar-mode 'right)
65 (column-number-mode 1)
67 ;; Configuration d'uniquify
68 (setq uniquify-buffer-name-style 'reverse)
69 (setq uniquify-separator "|")
70 (setq uniquify-after-kill-buffer-p t)
71 (setq uniquify-ignore-buffers-re "^\\*")
73 ;; Les copiers/coller doivent aller dans le clipboard de l'OS
74 (setq x-select-enable-clipboard t)
75 (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
77 (setq auto-mode-alist (cons '(".mail" . message-mode) auto-mode-alist))
79 ;; Quand vous recevez un fichier .txt d'une machine dos/windows il est
80 ;; très énervant de voir les ^M a chaque fin de ligne, utiliser M-x
81 ;; dos-unix pour vous en débarrasser. (J. Danjou)
84 (goto-char (point-min))
85 (while (search-forward "\r" nil t) (replace-match "")))
89 ;; (read-abbrev-file "~/.abbrev_defs")
91 (global-set-key (quote [S-tab]) (quote dabbrev-expand))
94 (set major-mode 'text-mode)
95 (add-hook 'text-mode-hook 'turn-on-auto-fill)
97 ;; Enable longlines-mode for LaTeX files
98 (add-hook 'latex-mode-hook 'longlines-mode)
100 ;; On utilise Mozilla Firefox
101 (defun browse-url-firefox-new-tab (url &optional new-window)
102 "Open URL in a new tab in Firefox."
103 ;; (interactive (browse-url-interactive-arg "URL: "))
104 (let ((cmd (shell-command-to-string
105 (concat "mozilla-firefox -a firefox -remote 'openURL("
106 url ",new-tab)' > /dev/null"))))
107 (unless (string= "" cmd)
108 (message "Starting Firefox...")
109 (start-process (concat "firefox " url) nil "/bin/sh" "-c"
110 (concat "mozilla-firefox " url "|| true"))
111 (message "Starting Firefox...done"))))
113 (setq browse-url-browser-function 'browse-url-firefox-new-tab)
119 (global-set-key "\C-cp" 'ps-print-buffer-with-faces)
122 ;; | Configuration pour les différants modes
126 (setq ispell-program-name "aspell")
127 (setq ispell-dictionary "french")
130 (setq tex-dvi-view-command "evince")
131 (setq LaTeX-verbatim-environments (quote ("verbatim" "verbatim*" "lstlisting")))
132 (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
135 (setq find-file-run-dired t)
136 (setq dired-listing-switches "-l")
137 (setq dired-recursive-deletes 'top)
140 (defalias 'perl-mode 'cperl-mode)
143 (setq-default indent-tabs-mode nil)
145 ;; Toujours avoir nouvelle ligne en fin de fichier
146 (setq require-final-newline t)
148 ;; Configuration de debian-changelog
149 (setq debian-changelog-full-name "Olivier Tétard")
150 (setq debian-changelog-mailing-address "olivier.tetard@miskin.fr")
152 (setq safe-local-variable-values
153 (quote ((TeX-PDF-mode . PDF))))
155 ;; Stolen from http://xemacs.seanm.ca/lisp/dired-extras.el
156 (defun dired-do-apply-function (func)
157 "Apply an interactive lisp function to all the marked files.
158 The function is not passed any arguments. The function honours restrictions."
159 (interactive "aFunction: ")
161 (dolist (file (dired-get-marked-files))
162 (message "Processing %s..." file)
163 (set-buffer (find-file-noselect file))
164 (goto-char (point-min))
169 (setq-default c-basic-offset 8)
170 (setq-default indent-tabs-mode t)
173 (push (expand-file-name "~/.elisp/twittering-mode") load-path)
174 (require 'twittering-mode)
175 (setq twittering-use-master-password t)
176 (setq twittering-icon-mode t)
177 (setq twittering-timer-interval 300)
178 (setq twittering-url-show-status nil)
179 (add-hook 'twittering-new-tweets-hook
181 (let ((n twittering-new-tweets-count))
182 (start-process "twittering-notify" nil "notify-send"
183 "-i" "/usr/share/pixmaps/gnome-emacs.png"
185 (format "You have %d new tweet%s"
186 n (if (> n 1) "s" ""))))))
190 (custom-set-variables
191 ;; custom-set-variables was added by Custom.
192 ;; If you edit it by hand, you could mess it up, so be careful.
193 ;; Your init file should contain only one such instance.
194 ;; If there is more than one, they won't work right.
195 '(TeX-output-view-style (quote (("^dvi$" ("^landscape$" "^pstricks$\\|^pst-\\|^psfrag$") "%(o?)dvips -t landscape %d -o && gv %f") ("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$" "%(o?)dvips %d -o && gv %f") ("^dvi$" ("^\\(?:a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4\\)$" "^landscape$") "%(o?)xdvi %dS -paper a4r -s 0 %d") ("^dvi$" "^\\(?:a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4\\)$" "%(o?)xdvi %dS -paper a4 %d") ("^dvi$" ("^\\(?:a5\\(?:comb\\|paper\\)\\)$" "^landscape$") "%(o?)xdvi %dS -paper a5r -s 0 %d") ("^dvi$" "^\\(?:a5\\(?:comb\\|paper\\)\\)$" "%(o?)xdvi %dS -paper a5 %d") ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d") ("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d") ("^dvi$" "^legalpaper$" "%(o?)xdvi %dS -paper legal %d") ("^dvi$" "^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d") ("^dvi$" "." "%(o?)xdvi %dS %d") ("^pdf$" "." "evince %o %(outpage)") ("^html?$" "." "netscape %o"))))
196 '(canlock-password "a29a3189d5be23f38adc9d2627e77c898e00cde1")
197 '(display-time-24hr-format t)
198 '(inhibit-startup-screen t)
199 '(mail-yank-prefix "> ")
200 '(muse-file-extension "muse")
201 '(muse-html-charset-default "utf-8")
202 '(muse-html-encoding-default (quote utf-8))
203 '(muse-html-meta-content-encoding (quote utf-8))
204 '(muse-html-style-sheet "<link rel=\"stylesheet\" type=\"text/css\" charset=\"utf-8\" media=\"all\" href=\"/style.css\" />")
205 '(muse-mode-auto-p nil)
206 '(muse-publish-desc-transforms (quote (muse-wiki-publish-pretty-title muse-wiki-publish-pretty-interwiki muse-publish-escape-specials-in-string)))
207 '(muse-wiki-publish-small-title-words (quote ("the" "and" "at" "on" "of" "for" "in" "an" "a" "page" "anime")))
208 '(muse-xhtml-footer "~/documents/wiki/common/footer.html")
209 '(muse-xhtml-header "~/documents/wiki/common/header.html")
210 '(safe-local-variable-values (quote ((sgml-local-ecat-files) (sgml-local-catalogs) (sgml-exposed-tags) (sgml-default-dtd-file) (sgml-parent-document) (sgml-indent-data . t) (sgml-indent-step . 2) (sgml-always-quote-attributes . t) (sgml-minimize-attributes) (sgml-shorttag . t) (sgml-omittag . t) (TeX-PDF-mode . "PDF") (TeX-PDF-mode . PDF)))))
212 ;; custom-set-faces was added by Custom.
213 ;; If you edit it by hand, you could mess it up, so be careful.
214 ;; Your init file should contain only one such instance.
215 ;; If there is more than one, they won't work right.
216 '(erc-current-nick-face ((t (:foreground "red" :slant oblique :background: "yellow"))))
217 '(highlight-current-line-face ((t (:background "#6699cc"))))
218 '(muse-bad-link-face ((t (:foreground "DeepPink" :underline "DeepPink" :weight bold))))
219 '(muse-link-face ((t (:foreground "blue" :underline "blue" :weight bold)))))