CS/CE 218 units -*-Outline-*- * advanced emacs features advert: not the details, but an indication of what's there that will be useful ** modes specialized ways of using emacs, specific to each buffer. Q: how can you tell what mode a buffer has? (displayed in the mode line) examples: fundamental, mail, text, Outline, C, LISP, etc. use mode comment in first line of file: -*-Outline-*- *** Outline mode major mode for editing outlines with selective display. Headings are lines which start with asterisks: one for major headings, two for subheadings, etc. Lines not starting with asterisks are body lines. Can make bodies temporarily invisible, to see the grand structure, can edit while this is done These lecture notes are in Outline format *** mail **** reading mail (rmail) Q: Why might you want to read mail from an editor? reads unix mail, allows you to store it in various files (organization) keeps track of whether you have replied to a message, etc. **** sending mail Q: What commands would you think would be available to send mail? understands format of messages, with subject, etc. can yank text from mail being read (by rmail) *** C programs Q: What should an editor do to help you edit code? (make a list) understand brackets, know how to indent code, allow customization of indentation provides support for compiling programs, with error messages in another window. allows you to find functions supports change logging integrated with the debugger... *** info hypertext-like database, accessed through emacs has entries on emacs, gcc, gdb, etc. ** customization, the .emacs file .emacs file is read before you start editing don't need to have one. *** minor modes variants on pre-defined major modes e.g., auto-fill-mode makes lines filled in text *** variables --------------- ; turn off dangereous zap-to-char key (put 'zap-to-char 'disabled t) ; M-z (setq find-file-run-dired nil) ; never run dired --------------- commands to describe and set variables on-line too *** keyboard macros useful for making up macros, start typing and see it work. *** making permenant macros make up a keyboard macro then name it, and put it in your .emacs file (call-last-kbd-macro and insert-kbd-macro) design it using emacs lisp see examples in /usr/local/emacs/lisp/*.el