# (find-es "emacs" "emacs_ee_tutor") # (find-es "emacs" "waclena1") # (find-es "emacs" "emacs-faq") # (find-enode "Key Index") # (find-elinode "Top") # (find-elnode "Top") # (find-enode "Keys") # (find-elnode "Command Loop") # (find-elnode "Building Emacs") # (find-node "(emacs-faq)Top") # (find-node "(emacs-faq)Hiding #ifdef lines") # (find-fline "Generate" "info2www cgi") # [P [ENODE Top]] # [P [ELNODE Top]] # [P [ELINODE Top]] # [P [EFAQNODE {Hiding #ifdef lines}]] procj KEY1 {txt} { regexp {(.*[!-~]) +(--.*)} $txt -> key descr format "%-8s %s" $key $descr } proc KEYLIST {args} { PRE1 [join $args "\n"] } proc IGNORE {args} {} procj GSK1 {txt} { AL {.emacs key_bindings} $txt } proc GSKMY {} { return "(see my [GSK1 .emacs])" } proc PICM {} { return "(in picture mode)" } htmlize {an emacs tutorial from the eev point of view} { [HLIST1 {Standard texts and tutorials:} [J [L http://www.wcnet.org/jzawodn/emacs/emacs.html Jeremy Zawodny's \"Emacs Beginner's HOWTO\"]. You probably already have this in you GNU system with a filename like [TT /usr/doc/HOWTO/en-txt/Emacs-Beginner-HOWTO.txt.gz].] [J [ENODE Top \"The Emacs Editor\"]. [IT THE] Emacs manual, for GNU Emacs 20.] [ELNODE Top \"GNU Emacs Lisp Reference Manual\"]. [ELINODE Top Introduction to Emacs Lisp]. [EFAQNODE Top The Emacs FAQ]. ] [P I'm writing this because my approach to Emacs is quite different from that of the texts above\; for example I believe that the two main keys of Emacs are C-_ ([ENODE {Undo} undo]) and C-x C-e ([ELINODE {Run a Program} eval-last-sexp]\; see also [ENODE {Lisp Eval} this]), and I so always start to teach Emacs beginning by those two keys.] [P This proto-tutorial is incomplete and a mess, but it points to essentially all the Emacs commands and keys that I use, so you can use this page to start exploring the Emacs documentation.] [P If you don't use Emacs and want a non-technical argument (i.e., with no mention of Lisp or undo) on why to use Emacs, try [L http://www.geocities.com/kensanata/emacs-defense.html this posting by Per Abrahamsen]\; for ethical arguments, see the texts in [MYL index.html my page].] [RULE]
[P Emacs is an interactive [ELINODE {List Processing} Lisp] programming environment that most of the time is used as an editor, as an [ENODE {Misc Help} info-file viewer], as an [ENODE Debuggers interface to debuggers] or to read mail and news. It was made to be extensible and has been extended so much that it is now next to impossible to describe it briefly.] [P The purpose of this sort-of-tutorial is not to teach you Emacs step by step and in a definite order\; Emacs is too large to be teached that way (in my opinion, of course\; I've seen quite a few Emacs tutorials, no one of them worked very well for me, and I have no idea of how to make one that really works). Rather, I'll talk about some important topics and give links to some places at the official documentation, which is excellent but far too large. You'll be thrown into the maelstrom. Use your common sense and avoid the more technical pages until you're ready for them.] [P The documentation about Emacs is written in [TEXINODE Top TeXinfo] format. Here I'm using a program called [HREF [INFO2WWW] info2www] to make it accessible to www browsers, but normally you'll access it from Emacs with [ENODE {Help Summary} C-h i] ([INFONODE Help here] are some docs on the keys you'll use inside Emacs' Info [ENODE {Major Modes} Mode]) or with elisp hyperlinks, described below.] [P You need to know a little about [ENODE Keys keys]. [ENODE {User Input} Here] is something more technical, but that explains that you can get M-a by typing either Meta-a (or Alt-a) or Esc a. C-[Q ] means Control-[Q ]. Besides the hundreds of [ENODE {Key Index} key commands] Emacs also has zillions of commands that can be called by their names using [ENODE M-x M-x] (and [Q ] or [Q ] for [ENODE Completion completion])\; some of them are listed at the \"[ENODE {Command Index} Command Index]\" node of Emacs' manual, and most of them have \"[ELNODE Documentation docstring]\" descriptions accessible by [ENODE {Help Summary} C-h C-f]. Note that the commands callable by their names are just Lisp functions with something like \"[ELNODE {Defining Commands} [TT (interactive)]]\" in their code, and that commands are associated to keys by [ELNODE Keymaps keymaps]\; you can always see all active keys and their associated commands by using [ENODE {Help Summary} C-h b] (see also [ENODE {Key Bindings}]).] [P Ok, now for something more down to earth... (saving, entering, leaving. Buffer caveat).] [P Caveats:] [P The concept of \"editing a file\" is not a very basic one to Emacs. You'll notice that often, when you type something wrong, the main editing area splits in two, and the lower part (the lower \"[ENODE {Windows} window]\") displays some long error message, some kind of help text or some other misterious thing. You can [ENODE {Other Window} make the cursor go to that other window], and often you can even edit the text there, but if you try to save the changed text with [ENODE Saving C-x C-s] you'll see that Emacs doesn't know where to save it!] [P (Borrow: keys and keycodes\; add translation tables, modes, TAB=complete/indent, ^G, ^X^C, ^_, arrows and their equivs\; modes: add picture, ins minor mode, dired, info).] [P (Emacs is made to be run once per session on a window or VC\; if you are logged in many machines at the same time ... ange-ftp, see section __. emacsclient, gnuclient, gnudoit).] [P (Windows, frames, buffers, minibuffer, files, keys, describe-bindings, major modes, minor modes, info mode, dired mode, buffer-menu, filename extensions).] [P (Lisp\; C-x C-e\; M-x\; describe-function\; describe-key\; elisp manual, emacs-list-intro\; .emacs\; libraries\; .el files\; preloaded lisp files\; autoloads\; byte compilation).] [P Basic editing keys\; substitutes for arrows, home, pgup, pgdn, del\; undo\; ins\; picture mode\; the region\; tab and completion\; C-g\; mf list\; filling paragraphs\; indenting\; C-s\; macros\; etc).] [H3 Some of my favorite keys:] [KEYLIST [KEY C-_ -- [ENODE {Undo} undo]] [KEY C-x C-e -- [ELINODE {Run a Program} eval-last-sexp] (see also [ENODE {Lisp Eval} this])] [KEY M-x -- [ENODE {M-x} execute-extended-command]] [KEY C-g -- [ENODE {Quitting} keyboard-quit]] "" [KEY C-x C-s -- [ENODE {Saving} save-buffer]] [KEY C-x C-c -- [ENODE {Saving} save-buffers-kill-emacs]] [KEY C-x 1 -- [ENODE {Change Window} delete-other-windows]] [KEY C-x C-f -- [ENODE {Visiting} find-file] (see also: [ENODE Dired Dired])] [KEY C-x 0 -- [ENODE {Change Window} delete-window]] [KEY C-x o -- [ENODE {Other Window} other-window]] [KEY C-x b -- [ENODE {Select Buffer} switch-to-buffer]] [KEY C-x k -- [ENODE {Kill Buffer} kill-buffer]] "" [KEY C-h i -- [ENODE {Misc Help} info]] [KEY C-h k -- [ENODE {Misc Help} describe-key]] [KEY C-h b -- [ENODE {Misc Help} describe-bindings]] [KEY C-h m -- [ENODE {Misc Help} describe-mode]] [KEY C-h l -- [ENODE {Misc Help} view-lossage]] [KEY C-h f -- [ENODE {Misc Help} describe-function]] "" [KEY left -- [ENODE {Moving Point} backward-char]] [KEY right -- [ENODE {Moving Point} forward-char]] [KEY up -- [ENODE {Moving Point} previous-line]] [KEY down -- [ENODE {Moving Point} next-line]] [KEY C-a -- [ENODE {Moving Point} beginning-of-line]] [KEY C-e -- [ENODE {Moving Point} end-of-line]] [KEY M-< -- [ENODE {Moving Point} beginning-of-buffer]] [KEY M-> -- [ENODE {Moving Point} end-of-buffer]] "" [KEY (backspace) -- [ENODE {Erasing} delete-backward-char]] [KEY (del) -- [ENODE {Erasing} delete-char]] [KEY C-k -- [ENODE {Killing by Lines} kill-line]] [KEY C-Spc -- [ENODE {Setting Mark} set-mark-command]] [KEY C-w -- [ENODE {Other Kill Commands} kill-region]] [KEY C-y -- [ENODE {Kill Ring} yank]] [KEY M-w -- [ENODE {Kill Ring} kill-ring-save]] "" [KEY C-x r k -- [ENODE {Rectangles} kill-rectangle]] [KEY C-x r y -- [ENODE {Rectangles} yank-rectangle]] "" [KEY ins -- [ENODE {Minor Modes} overwrite-mode] [GSKMY]] [KEY f6 -- [ENODE {Picture} picture-mode] [GSKMY]] [KEY C-c C-c -- [ENODE {Picture} picture-mode-exit] (in picture mode)] [KEY C-c . -- [ENODE {Insert in Picture} picture-movement-down] [PICM]] [KEY C-c > -- [ENODE {Insert in Picture} picture-movement-right] [PICM]] "" [KEY C-q -- [ENODE {Inserting Text} quoted-insert]] [KEY M-1 -- [ENODE {Arguments} digit-argument]] [KEY C-u -- [ENODE {Arguments} universal-argument]] "" [KEY M-x fundamental-mode -- [ELNODE {Major Modes} fundamental-mode]] [KEY M-x indented-text-mode -- indented-text-mode] [KEY M-x tcl-mode -- tcl-mode] [KEY M-x c-mode -- c-mode] [KEY M-x emacs-lisp-mode -- [ENODE {Lisp Eval} emacs-lisp-mode]] [KEY TAB -- [ENODE {Text Mode} indent-relative] (in text modes)] [KEY TAB -- [ENODE {Basic Indent} indent-for-tab-command] (in program modes)] [KEY ESC . -- [ENODE {Tags} find-tag]] "" [KEY C-s -- [ENODE {Incremental Search} isearch-forward]] [KEY C-r -- [ENODE {Incremental Search} isearch-backward]] [KEY M-C-s -- [ENODE {Regexp Search} isearch-forward-regexp]] [KEY M-C-r -- [ENODE {Regexp Search} isearch-backward-regexp]] [KEY M-% -- [ENODE {Replace} query-replace]] "" [KEY C-x ( -- [ENODE {Keyboard Macros} start-kbd-macro]] [KEY C-x ) -- [ENODE {Keyboard Macros} end-kbd-macro]] [KEY C-x e -- [ENODE {Keyboard Macros} call-last-kbd-macro]] [KEY f5 -- [ENODE {Keyboard Macros} call-last-kbd-macro] [GSKMY]] "" [KEY f4 -- [ELNODE {Refresh Screen} redraw-display] [GSKMY]] [KEY M-x sort-lines -- [ENODE {Sorting} sort-lines]] [KEY M-x sort-columns -- [ENODE {Sorting} sort-columns]] [KEY M-| -- [ENODE {Single Shell} shell-command-on-region]] ] } IGNORE { (find-e20node "Key Index") (defun mf (key) "Prints key and binding in a format suitable for quick refs" (interactive "kCommand: ") (princ (format " [KEY %-8s-- [ENODE {} %s]]\n" (key-description key) (key-binding key)) (current-buffer))) (define-key global-map "\M-g" 'mf) cp -v /usr/info/emacs-e20*.gz /tmp gzip -dv /tmp/emacs-e20*.gz agrep indented /tmp/emacs-e20* }