CS 342 Lecture -*- Outline -*- * Emacs editor ** how to use it To learn about emacs, best way is to use the tutorial: emacs C-h t (control-h, then t) At any time, can get help by C-h. Exit by C-x C-c. ** State of an editor What should the state be? (distinguish files, buffers, windows) Default directory (pwd, cwd) File contents (find-file, save-buffer, save-some-buffers) Buffers name (list-buffers, rename-buffer) buffer contents (scroll-up, scroll-down, etc.) file name (set-visited-file-name, write-file) mode [major, minor] (displayed in mode line) clean/written flag [shows as ** when written] (not-modified) point, mark (what-cursor-position, exchange-point-and-mark,...) Window buffer (switch-to-buffer) screen location (split-window-vertically, kill-window, ...) mode line display of clean/written flag display of buffer name display of mode position indication point [location of cursor, before a given character] (...) Echo area text for messages/prompts Command History [undo, redo] (repeat-complex-command, undo) Kill Ring (yank, yank-pop, deletion commands) (Registers) (Buffer selection history) (Key bindings) (Mark ring) (Variable values)