Text Editor - Emacs2
Search backward; pushing
againsearches for the next occurrence.
Cancel the current search or go back topreviously found search item if searchwas done again.
replacestringReplacesalloccurrencesof ﬁrst string with second string.
Replace the ﬁrst string with the secondstring, but query for each occurrence (
goes to next,
ESC-x spell buffer
Check spelling of the current buffer.
ESC-x spell word
Check spelling of the word at the point.
Capitalizes character at the point andmakes rest of word lowercase.
Move forward one word.
Changes word to uppercase from thepoint to the end of the word.
Help and Useful Commands
Stops current command.
Undo the last keystroke.
is a number).
Using Emacs to Edit Files
EmacsisapowerfultexteditorinUNIX.FromwithinEmacsitispossibletocompileprograms,readnews,read mail, and execute UNIX commands, making itpractically an operating system of its own. As withany program that seems to be able to do everything,Emacs contains some rather obscure controlcommands to get things done more quickly. In ordertoquicklyﬁndanyutilityinEmacs,itisnecessarytodosomememorization.Userswhowishtoavoidthisshoulduseanothertexteditor,likePico,thatiseasierto use but does less than Emacs.
Emacs is invoked at the UNIX prompt by typing
. If the ﬁle exists, its contents areplaced in the resulting Emacs screen. If the ﬁle doesnot exist, a blank screen appears and a ﬁle is createdas soon as information is typed on the screen.
Note:IfyouareusinganX-Windowsenvironment(asundesktop, X-win32 on the PC, or X11 on a Mac), you can return to the command prompt after startingemacsbytyping
tostorethedata.Several buffers can be in operation at once, and anynumber can be displayed on the screen at one time,but the beginning Emacs user will probably limithimself to using one buffer at a time. The
isdeﬁned as where cursor is presently located in thecurrentbuffer.A
canbesetsothatthepointcanbe placed elsewhere in the buffer. The area betweenthe mark and the point is known as the
.Operationscanbeappliedtoregions(e.g.spellcheck,copy, deletion, etc.) or to an entire buffer.
Moving Around in an Emacs Buffer
In most situations, moving the point (cursor) aroundin the buffer is as simple as using the arrow keys.However, there are alternate keys available for thosewho cannot or would rather not use the arrow keys.Mostofthecontrolkeycombinationsaredesignedtobe memorable, but the beginning user often ﬁndsthem non-intuitive. Examples are
to move to the previousline, and
to move to the next line. AmorecomprehensivelistofkeystrokesisgivenintheQuick Reference section given earlier.
Saving Your Work
By default, Emacs automatically saves your work atregular intervals. Auto-saved ﬁles are named
, to distinguish them from regularly-savedﬁles.Whenyousaveaﬁle,emacsalsosavesanunmodiﬁed version as
. At any timeduring an Emacs session, you can force Emacs toperform a save with the key combination
(for save). You caneasily tell if the current buffer contains unsaved