================== Emacs for the win! ================== CSE 501 Technology Presentation Mike Prentice ([[mailto:mjp44@buffalo.edu][mjp44@buffalo.edu]]) Oct 14, 2010 * What is a text editor? ** A text editor edits text Text is the plain, raw characters of a text file. - Source code files - HTML - Text files - Encodings: ASCII, ISO-Latin-1, UTF-8 ** A word processor edits markup Word processors such as MS Word use codes that control formatting. These codes are typically hidden. Aside: WordPerfect "reveal codes" MS Word files are binary. - Older: Proprietary format - docx: zipped up container of XML files XML files are the text that a text editor would handle. Contains all the formatting instructions, etc. docx is the file that Word opens and displays to you. ** An IDE does "project management" ... as long as your project conforms to what the IDE expects. Aside: a note about Eclipse, Java, C++, plugins * Why should you care? - Aside from tinkering... - Editing text is a job for a text editor - Viewing the text that is actually there in the file - Text editing and document formatting - Document formatting is the domain of word processing - Editing source code files is the domain of text editors - LaTeX: Document formatting as source code ... whoa, I know Kung Fu - Control! ... and the Control key * Why is Emacs a good text editor? - Large library of existing plugins - Plugins written in elisp, same code as the bulk of the editor ... means the "API" is just functions available ... to the editor and plugins equally! ** Cross-Platform Support - Mac OS X: Aquamacs [[http://aquamacs.org/]] - Windows - Linux - Lispbox [[http://www.gigamonkeys.com/lispbox/]] ** Highly hacktastic ... Ahem, I believe you mean *customizable* ... Why yes, I believe I do. ... Hacktacular? ... Please, stop. - Emacs grows with you * Demos - ielm: Interactive Elisp mode - REPL: Read Eval Print Loop - tab-completion - shell - run-ruby, run-python, run-haskell - slime clojure - Source control: git and magit-status - CVS, SVN also supported - mike-make-beamer - My own function, show elisp code - Show yasnippets expansion, codeframe - Keyboard macros ** Emacs over SSH - X11: emacs & - Eliza demo - Text-only: emacs -nw * How do I get started? ** Check out the Help menu - Emacs manual - Emacs tutorial - Emacs Lisp introduction & reference ... Emacs Lisp? ("elisp" for short) ** Tutorial - M-x help RET t - What is M-x? - Meta key - Alt (Windows), Option (Mac) Diamond key (Sun workstation keyboards) ** Emacs help - M-x help - Aquamacs: F1 bound to help - All of these have tab completion - Keybindings: k - Functions: f RET - Variables: v RET - Apropos: a RET - Mode help: m - What is a mode? ** Emacs starter kit [[http://github.com/technomancy/emacs-starter-kit]] - Emacs defaults are "interesting" - Starter kit helps get started with some useful modes and bindings out of the box. ** Some vocabulary - Font-lock == syntax highlighting - Frame == window - Window == pane or panel - Buffer == document - Buffer is the actual text data - Shell, REPL, file, scratchpad, etc. * CSEGSA meeting 6pm 242 Bell * Real Programmers: [[http://xkcd.com/378/]]