hello, j’ouvre un topic pour échanger nos fichiers de conf d’emacs. Ce topic pourra servir aux nouveaux utilisateur d’emacs pour qu’ils piochent ce dont ils ont besoin.
attention : pour la bonne compréhension de tous, merci de commenter votre .emacs Voici le mien : [code];;###############################################################################
;; référence bibliographique avec reftex
;;###############################################################################
(autoload 'reftex-mode “reftex” “RefTeX Minor Mode” t)
(autoload 'turn-on-reftex “reftex” “RefTeX Minor Mode” nil)
(autoload 'reftex-add-to-label-alist “reftex” “RefTeX Minor Mode” nil)
;;; To turn on RefTeX Minor Mode for all LaTeX files,
(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; without AUCTeX LaTeX mode
;;; Replace AUCTeX functions
(setq reftex-plug-into-AUCTeX t) ;only for AUCTeX
;;###############################################################################
;; dvi interactif
;;###############################################################################
(add-hook 'server-switch-hook '(lambda () (server-edit)))
(add-hook 'server-switch-hook '(lambda () (raise-frame)))
(add-hook 'server-done-hook '(lambda () (kill-this-buffer)))
(setq focus-follows-mouse nil)
(server-start)
(global-set-key [(f4)] 'server-start)
;;################################################################################
;; SURLIGNAGE D’UNE RÉGION SÉLECTIONNÉE
;;################################################################################
(transient-mark-mode t)
;;################################################################################
;; POUR NE PAS AVOIR À TAPER EN ENTIER LA RÉPONSE YES/NO
;;################################################################################
(fset 'yes-or-no-p 'y-or-n-p)
;;################################################################################
;; NUMÉROTATION DES LIGNES EST DES COLONNES
;;################################################################################
;; Show line-number in the mode line
(line-number-mode 1)
;; Show column-number in the mode line
(column-number-mode 1)
;;################################################################################
;; POUR AVOIR L’HEURE DANS LA BARRE D’ETAT
;;################################################################################
(display-time)
(setq display-time-24hr-format t) ;; Format 24 heures
;;################################################################################
;; AUTO FILL MODE(retour a la ligne automatiquement)
;;################################################################################
(setq auto-fill-mode 1)
(add-to-list 'auto-mode-alist (cons “\.php$” 'php-mode))
(defun toggle-setnu-mode ()
(interactive)
(if setnu-mode
(setnu-mode -1)
(setnu-mode 1)))
;;################################################################################
;; AFFICHAGE DES IMAGES ET FICHIERS COMPRESSÉS
;;################################################################################
(setq auto-image-file-mode t)
(setq auto-compression-mode t)
(cond ((not (eq window-system 'x))
(set-keyboard-coding-system 'latin-1)))
;;################################################################################
; METTRE TOUS LES FICHIERS DE SAUVEGARDE DANS UN SEUL RÉPERTOIRE
;;################################################################################
(setq backup-directory-alist
’(("." . “~/.emacs-backup-files/”)))
(cond ((not (eq window-system 'x))
(set-keyboard-coding-system 'latin-1)))
;;################################################################################
;; CHEMIN COMPLET DANS LA BARRE DE TITRE ?
;;################################################################################
;;(setq frame-title-format “%S: %f”)
;;################################################################################
;; POUR ENREGISTRER AUTOMATIQUEMENT LA POSITION DU CURSEUR QUAND ON QUITTE UN
;; FICHIER, ET Y RETOURNER AUTOMATIQUEMENT À LA RÉOUVERTURE
;;################################################################################
(require 'saveplace)
(setq-default save-place t)
;;################################################################################
;; PARENTHESE MATCHING, PERMET DE VERIFIER AU FUR ET À MESURE DE LA FRAPPE QUE
;; L’ON FERME BIEN CE QUE L’ON OUVRE, AUSSI BIEN POUR LES PARENTHÈSES QUE LES
;; CROCHETS OU LES ACCOLADES.
;;################################################################################
(require 'paren)
(show-paren-mode 1)
(setq-default hilight-paren-expression t)
;;################################################################################
;; SUPPRIME TOUS LES ESPACES EN FIN DE LIGNE
;;################################################################################
(autoload 'nuke-trailing-whitespace “whitespace” nil t)
;;################################################################################
;; COMPLETION AUTOMATIQUE
;;################################################################################
(abbrev-mode t) ; completion automatique
(global-set-key (quote [S-tab]) (quote dabbrev-expand))
;;################################################################################
;; Laisser le curseur en place lors d’un défilement par pages.
;;################################################################################
; Par défaut, Emacs place le curseur en début ou fin d’écran
; selon le sens du défilement.
(setq scroll-preserve-screen-position t)
;;#################################################################################
;; Supprimer les fichiers de sauvegarde en quittant.
;;#################################################################################
; (vous savez, ces fameux fichiers dont le nom se termine par « ~ »)
(setq make-backup-files nil)
;;#################################################################################
;; ISPELL (dictionaire français)
;;#################################################################################
(setq ispell-dictionary “francais”)
;;#################################################################################
;; FLYSPELL CORRECTEUR ORTHOGRAPHIQUE
;;#################################################################################
;; Pour que F2 lance flyspell
(global-set-key [f2] 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
;;#################################################################################
;; MPG123 (pour écouter de la musique mp3 dans emacs
;;#################################################################################
(autoload 'mpg123 “mpg123” “A Front-end to mpg123” t)
;;#################################################################################
;; couleurs(changer les couleurs, mettre en fond noir)
;;#################################################################################
(set-foreground-color “grey80”)
(set-background-color “black”)
;;#################################################################################
;; calendar(agenda)
;;#################################################################################A
;; === DATES-HEURES-CALENDRIER hhh ===
;; ===================================
;; Heure-Dates
;; La semaine commence le lundi
(setq calendar-week-start-day 1)
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(display-time)
;; vacances
(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”)))
;; voir les entrees de diary dans LaTeX calendar
(setq cal-tex-diary t)
;; calendrier Français
(setq european-calendar-style 't)
(setq calendar-week-start-day 1)
(setq calendar-day-name-array
[“Dimanche” “Lundi” “Mardi” “Mercredi” “Jeudi” “Vendredi” “Samedi”])
(setq calendar-month-name-array
[“Janvier” “Février” “Mars” “Avril” “Mai” “Juin” “Juillet”
“Août” “Septembre” “Octobre” “Novembre” “Décembre”])
;;; diary
(diary)
;; fancy diary display
(add-hook 'diary-display-hook 'fancy-diary-display)
[/code]