GNU Emacs pour débutant

Raymond RIPP
Thu May 4 12:38:18 MET DST 1995

revu le 28 décembre 2000

Pourquoi pas vi ou EDT ou jove ou pfe ou Word?

Parcequ'il

Il a Emacs se lance par

emacs fichier.truc

Si truc est un environnement connu de emacs, il s'y met. Par exemple: FORTRAN, C, Pascal, lisp, LaTeX, Tcl, mail, perl, vi, EDT Dans ces environnements les tabulations se font automatiquement, le parenthésage est vérifié, les compilateurs peuvent être lancés depuis emacs, etc.

Le minimum vital

L'aide vient par

C-h ... help ou [Aide]

On sauve le fichier par

C-x C-s ... save-buffer ou [F9]

On sort de emacs par

C-x C-c ... kill-emacs ou [F10]

On pose une marque par

C-SPC ... set-mark

On coupe une zone par

C-w ... kill-region ou [Sélect.]

On efface un ligne par

C-k ... kill-line ou [Eff.texte]

On remet la ligne par

C-y ... yank ou [Insérer]

On efface le caratère sous le curseur par

C-d

On change de buffer ou de fichier avec la souris.


 Voici mon .emacs qui tourne en X avec un clavier de PC ... il y a des touches pratiques
(setq line-number-mode t)
(setq column-number-mode t)
(transient-mark-mode t)

(global-set-key "\M-s"   'replace-string)

(global-set-key [C-cancel] 'isearch-forward)
(global-set-key [C-prior]  'isearch-repeat-backward)
(global-set-key [C-next]   'isearch-repeat-forward)
(global-set-key [pause]    'isearch-repeat-forward)

(global-set-key [f9]     'save-buffer)
(global-set-key [f10]    'save-buffers-kill-emacs)
(global-set-key [f11]    'kill-region)
(global-set-key [f12]    'kill-line)
(global-set-key [f2]     'other-window)
(global-set-key [f3]     'delete-other-windows)
(global-set-key [f4]     "|")
(global-set-key [insert] 'yank)
(global-set-key [remove] 'kill-line)
(global-set-key [select] 'kill-region)

(setq default-frame-alist
          '((top . 200) (left . 400)
            (width . 100) (height . 50)
            (pointer-color . "yellow")
            (cursor-color . "white")
            (cursor-type . box)
            (foreground-color . "white")
            (background-color . "rgb:2418/4a7f/5a9f")
            (font . "-*-courier-medium-r-*-*-18-*-*-*-*-*-*-*")
            ))

(setq initial-frame-alist '((top . 10) (left . 30)))

(global-set-key [C-f1]   "\\")
(global-set-key [C-f2]   "@")
(global-set-key [C-f3]   "~")
(global-set-key [C-f4]   "#")
(global-set-key [f5]   "\{")
(global-set-key [f6]   "\[")
(global-set-key [f7]   "\]")
(global-set-key [f8]   "\}")

(global-set-key [C-f11]  "^")
(global-set-key [C-f12]  "|")

(cond
 ((fboundp 'global-font-lock-mode)
  (setq font-lock-face-attributes
        '((font-lock-comment-face       "Coral")
          (font-lock-string-face        "LightSalmon")
          (font-lock-keyword-face       "LightSteelBlue")
          (font-lock-function-name-face "LightSkyBlue")
          (font-lock-variable-name-face "LightGoldenrod")
          (font-lock-type-face          "PaleGreen")
          (font-lock-reference-face     "Aquamarine")
          )
        )
  (require 'font-lock)
  (setq font-lock-maximum-decoration t)
  (global-font-lock-mode t)
  )
 )

(setq line-number-mode t)
(setq column-number-mode t)
(transient-mark-mode t)

(put 'upcase-region 'disabled nil)


Voici le c:/emacs/site_lisp/default.el pour emacs sur PC il y a les definitions de disques type Unix e: et f: voir DOS/Unix

(global-set-key "\M-s"   'replace-string)

(global-set-key [C-cancel] 'isearch-forward)
(global-set-key [C-prior]  'isearch-repeat-backward)
(global-set-key [C-next]   'isearch-repeat-forward)
(global-set-key [pause]    'isearch-repeat-forward)

(global-set-key [f9]     'save-buffer)
(global-set-key [f10]    'save-buffers-kill-emacs)
(global-set-key [f11]    'kill-region)
(global-set-key [f12]    'kill-line)
(global-set-key [f2]     'other-window)
(global-set-key [f3]     'delete-other-windows)
(global-set-key [insert] 'yank)
(global-set-key [remove] 'kill-line)
(global-set-key [select] 'kill-region)
 

(setq default-frame-alist
          '((top . 200) (left . 400)
            (width . 100) (height . 40)
            (cursor-color . "white")
            (cursor-type . box)
            (foreground-color . "white")
            (background-color . "rgb:2418/4a7f/5a9f")
            (font . "-*-Courier New-normal-i-*-*-17-82-c-*-*-ansi-")))

(setq initial-frame-alist '((top . 10) (left . 30)))

(global-set-key [C-f1]   "\\")
(global-set-key [C-f2]   "@")
(global-set-key [C-f3]   "~")
(global-set-key [C-f4]   "#")
(global-set-key [f5]   "\{")
(global-set-key [f6]   "\[")
(global-set-key [f7]   "\]")
(global-set-key [f8]   "\}")

(global-set-key [C-f11]  "^")
(global-set-key [C-f12]  "|")
 

(cond
 ((fboundp 'global-font-lock-mode)
  (setq font-lock-face-attributes
 '((font-lock-comment-face       "Coral")
   (font-lock-string-face        "LightSalmon")
   (font-lock-keyword-face       "LightSteelBlue")
   (font-lock-function-name-face "LightSkyBlue")
   (font-lock-variable-name-face "LightGoldenrod")
   (font-lock-type-face          "PaleGreen")
   (font-lock-reference-face     "Aquamarine")
   )
 )
  (require 'font-lock)
  (setq font-lock-maximum-decoration t)
  (global-font-lock-mode t)
  )
 )

(setq line-number-mode t)
(setq column-number-mode t)
(transient-mark-mode t)

(load "untranslate")
(add-untranslated-filesystem "e:")
(add-untranslated-filesystem "E:")
(add-untranslated-filesystem "f:")
(add-untranslated-filesystem "F:")