CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Tools of Web Development 1: Module D: Using Emacs
N241: Fundamentals of Web Development Copyright ©2004 Department of Computer & Information Science Why learn a text editor? Text editors are the lifeblood of programmingText editors are the lifeblood of programming You’ll need to be able to easily cut, paste, import, modify, automate textYou’ll need to be able to easily cut, paste, import, modify, automate text You need to be able to do this on any environment, even unixYou need to be able to do this on any environment, even unix
N241: Fundamentals of Web Development Copyright ©2004 Department of Computer & Information Science Why Emacs? Not the only good choiceNot the only good choice (VI, VIM are other good options)(VI, VIM are other good options) Works on many platformsWorks on many platforms Works with or without a GUIWorks with or without a GUI Extremely powerfulExtremely powerful
N241: Fundamentals of Web Development Copyright ©2004 Department of Computer & Information Science Basic Emacs Assumptions No mouse!No mouse! No particular keyboardNo particular keyboard No particular GUI environmentNo particular GUI environment Runs through telnet (as well as directly)Runs through telnet (as well as directly)
N241: Fundamentals of Web Development Copyright ©2004 Department of Computer & Information Science Keyboard commands Much more reliable without a mouseMuch more reliable without a mouse Much faster for experienced usersMuch faster for experienced users Harder to memorize, but most have mneumonicsHarder to memorize, but most have mneumonics
N241: Fundamentals of Web Development Copyright ©2004 Department of Computer & Information Science Control combinations Most keyboards have a control keyMost keyboards have a control key Most important commands are mapped to controlMost important commands are mapped to control Abbreviation in emacs is c-Abbreviation in emacs is c- Ctl-h (help) is usually indicated c-hCtl-h (help) is usually indicated c-h
N241: Fundamentals of Web Development Copyright ©2004 Department of Computer & Information Science Emergency Exit command If in doubt, use Ctrl-G (c-g)If in doubt, use Ctrl-G (c-g) It’s the ‘get me out of here’ commandIt’s the ‘get me out of here’ command Use it where you would use ESC in typical programsUse it where you would use ESC in typical programs
N241: Fundamentals of Web Development Copyright ©2004 Department of Computer & Information Science Meta combinations Emacs has a huge number of commandsEmacs has a huge number of commands Some of these are mapped to another control keySome of these are mapped to another control key Different keyboards have different keysDifferent keyboards have different keys (alt, diamond, flower, whatever)(alt, diamond, flower, whatever) Meta commands are indicated with m-Meta commands are indicated with m-
N241: Fundamentals of Web Development Copyright ©2004 Department of Computer & Information Science Using Escape key for meta tags Emacs will always recognize the escape key as metaEmacs will always recognize the escape key as meta Press and release escape before continuing sequencePress and release escape before continuing sequence
N241: Fundamentals of Web Development Copyright ©2004 Department of Computer & Information Science Calling a command by name If you know a command’s name, you can call it up directly.If you know a command’s name, you can call it up directly. EG auto-fill-mode turns word wrap on or off, but I can never remember the key sequenceEG auto-fill-mode turns word wrap on or off, but I can never remember the key sequence M-x auto-fill-mode automatically invokes the commandM-x auto-fill-mode automatically invokes the command
N241: Fundamentals of Web Development Copyright ©2004 Department of Computer & Information Science Questions?