Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Emacs Text Editor User Guide: Line Editing and Movement, Study Guides, Projects, Research of Printing

Instructions on how to edit lines and move the cursor in the Emacs text editor. It covers various commands for moving the cursor, deleting text, and inserting new lines. It also explains how to use recursive editing levels and indentation in Lisp mode.

What you will learn

  • How do you delete text in Emacs?
  • What is the purpose of the 'CR1.1' sequence in Emacs files?
  • What is recursive editing and how is it used in Emacs?
  • How does Lisp mode indentation work in Emacs?
  • What commands are used to move the cursor to the beginning and end of a line in Emacs?

Typology: Study Guides, Projects, Research

2021/2022

Uploaded on 09/27/2022

ekagarh
ekagarh 🇺🇸

4.6

(33)

271 documents

1 / 220

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
___ASIIE
9.
~ ~
~ ~ ~ ~ ~ ~ ~ ~ ~~?! WEFRIGOGNZTO
AEADADESI.POR
MPLE
IN FORMT
S
4
TITEno
ulogyr
SquareI-
to.
COTRL
N
ICEI
NAME
AND ADDRESS
,-..
F3..RORTAMLZTP J_,TS
Advanced Research
Projects
Agency
(/
June
1I80
1400
Wilson
Blvd
1-NMg'F0AE
Arlington, Virginia
22209
218
14.
MONITORING
AGENCY
NAME
& AODRESS(If
different
fromi
ControIlnI
0Office)
It.
SECURITY
CLASS.
(of
lti
report,
Office
of
Naval
Research
UNCLASSIFIED
Information
Systems
______________
Arlington,
Virginia
22217
ISa.
OCkASSI
PICATION/
DOWNGRAING
IS.
DISTRIBUTION STATEMENT
(of
this
Report)
Distribution
of
thisdoc-ument
is
unlimited.
17.
DISTRIBUTION
STATEMENT
(of
the
abstract
enteged
in
Block
20,
It
different
from
Repot)
IS.
SUPPLEMENTARY
NOTES
.0
O.24980
None
'
19.
KEY
WORDS
(Continue
on
rovers*
aide
If
noc*meary
and
Identify
by
block
number)
Display
Editor
r
)CCT.K..
Reference
Manual
..
,li
Primer
20.
ABSTRACT
(Continue
oni
reverse
olds,
If
neoeeeapy mid
Identify
by
block
number)
C...-
rThis
manual
documents
the
use
and
simple
customization
of
the
display
editor
LU
EMACS
with
the
ITS
operating
system.
The
reader
is
not
expected
to
be
a
programmer.
Even simple
customizations
do
not
require
programming
skill,
but the
user
who
is
not
interested
in
customizing
can
ignore
the
scattered
customization
hints.
This
is
primarily
a
reference
manual,
but
can
also
be
used
A
primer.
DDI'Af317
EDITION
OF
I
NOV
65
IS
ONSOLETE
UNCLASSIFIED
J
SECURITY
CLASSIFICATION
OF
THIS PAGE
(W11hon
Dere
Kniered)
pf3
pf4
pf5
pf8
pf9
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Emacs Text Editor User Guide: Line Editing and Movement and more Study Guides, Projects, Research Printing in PDF only on Docsity!

___ASIIE

9. ~ ~ ~~ ~ AEADADESI.POR ~ ~ ~ ~ ~ ~~?! WEFRIGOGNZTOMPLE IN FORMT S

4 TITEnoulogyr SquareI-

COTRL (^) to. N ICEI NAME AND ADDRESS ,-.. F3..RORTAMLZTP J_,TS

Advanced (^) Research (^) Projects (^) Agency (^) (/ (^) June 1400 Wilson Blvd 1I

Arlington, Virginia 22209 1-NMg'F0AE

14. MONITORING AGENCY NAME & AODRESS(If different fromi ControIlnI^218

0Office) It. SECURITY CLASS. (^) (of lti report,

Office of Naval Research UNCLASSIFIED

Information Systems ______________

Arlington, Virginia 22217 ISa. OCkASSI PICATION/ DOWNGRAING

IS. DISTRIBUTION STATEMENT (^) (of this Report)

Distribution of thisdoc-ument is unlimited.

17. DISTRIBUTION STATEMENT (^) (of the abstract enteged in Block (^) 20, It different from Repot)

IS. SUPPLEMENTARY NOTES .0 O.

None (^) '

19. KEY WORDS (^) _(Continue on rovers aide If nocmeary and_** (^) Identify by block number)

Display Editor r (^) )CCT.K.. Reference (^) Manual (^) ..,li Primer

20. ABSTRACT (Continue onireverse olds, If neoeeeapy mid Identify by block number) C...- rThis manual documents (^) the use and simple customization (^) of the display editor LU EMACS with the ITS (^) operating system. The reader is not (^) expected to be a programmer. Even (^) simple customizations do not require (^) programming skill, but the user (^) who is not interested in customizing can (^) ignore the scattered customization (^) hints. This is primarily a (^) reference manual, but can also be used (^) A primer.

DDI'Af317 (^) EDITION OF I NOV (^65) IS ONSOLETE (^) UNCLASSIFIED (^) J SECURITY CLASSIFICATION (^) OF THIS PAGE (W11hon Dere Kniered)

DISCLAIMER NOTICE

THIS DOCUMENT IS BEST QUALITY

PRACTICABLE. THE COPY FURNISHED

TO DTIC CONTAINED A SIGNIFICANT

NUMBER OF PAGES WHICH DO NOT

REPRODUCE LEGIBLY.

k -,- Table of Contents

[A

21.1. 21.2. (^) II low low to to (^) TeilMake i'MACS a Tags^ Youile forWan,^ a^ Program to Use TAGS^101102 f

P'reface

P~reface

TIJiS mnanual documlenits thle usc and simple custoanizahion of the display editor EMACS with Ithe

ITlS opcrating system. The reader is 1101 expected to be a programmer. liven simple custoanim~tio1s do not

equ~ire programmig skill. but the uscr %%ho is not interested (^) in custoiiing call ignore thle scattcrcd cIustillid'atio1 hints.

U'his (^) is primad ly I recfeience mantii but call also be used as a primer. However, I recommend that tile newveonier first use the on-line. icarti-by-doing tutorial TF ACHEI NI ACS. by typing :IiACI I EMACS~cr> v.hik' in I IACIR N.* With it, you (^) learn FIMACS by using FMACS oni a specially designed file %liiLh decibes L 0tII Mands, tells vou wlieuiit) try thiemiad theii explains (lhe results you sce. 'Ibfis givcs aI more vivid iatlrodaLtioll than11 a printed mnalual.

Onilit scading. ou neved not make any attempt ito memome chapters~ I and 2, which desribe the flulit lm~l c' 'it cll ni )l the Ilaitana il id tIile g~el aet-. appea iance (^) of die FiMACS display screen. It is en ough to be ia.re of What questions ace anlswel ed in these chapters. so you canl relir b~ack wheni youl later bccomne

  • intelmested in thle mnsweis. Ater acadig the B~asic Editing chapter you %houmld practice the commiands there. The next Fmw chapters descli ie fundamental techniques and concepts MIMh are refcrred to agdin and again. It is best to understand them dhoaliughly. (^) exper-imenting -with them if necessary.

Ill find thle docunlientafion onl a pat icular command, look ill the (^) index if you know what the command is. IfIvon know (^) vaguel3 what the command does, look in (lie command index. The conunand index contains a line or talc) about each comimnd, and aI cross-reference to the sccti-m of thle manual which describes thle command it-, mtore detail. Related commands are grouped together. 11licre is aliso) a glossary, with a cross reacrence for each tei an.

The mlanlual is ;-vailable in three formns: the puli~held form, thie I III' forml, and thle I NFO forml. The

published form is pa ;;tcd b% thie At ificial Intelligence lab. Thec 1.11 flin; isavailable oat linie for p)riittitg 011

unsophisticaled harid copy devices such as terminals and line printers 'ibe INFO forain is Imi on-line perasal with the INF:O progiani. All three frms are substantiatlly the sline. Thlere are also two versions of tlie text: mte fit' us~e with I''S. and onie for use with T'wenex. DEC's "TOPS-20" system. (^) Bloth versions irc available in all Ithree forms.

I'NICS savilalefor-(list (^) rihutimn for use on Tenex and lwenex systetms (it does not nanl onI Iotionis-lO, Am h ovrinol iiot be easy). Mail usa 2400 foot (^) mag tape if you want it. It does not cost aiything

niust send back aty (^) inprocmctas you mtake ito IMACS. itaclading any libraries you write, and that you mnust not redistribuate tile system except exactly (^) as you got it, comtplete. (You canl also distribute your

I 2 IiMACS^ Manuial^ flr^ VITS^ Users

custoiiitioIns, separately,) It is~patluetic to.Iiear.from -sitcs-.whiclh reccivcdinco~mplcte copieslacking the

souirces. as;k ijg inc years la tcr wliehcr sourccs are, available.

For informiation on-die underlying philosophy bFFMACS-and-thc.Icssons lcancdfrom^ its^ development.^ -

write to nic^ fora^ copy^ of^ Al^ memo)519,^ "JiMACS,^ the^ FxtcnsileCustomiyiblcScfIU)ocunienting^ Display

  • FEdibor", or sead Arpanet inail to RMSCYMITl-Al

Yours in-hack :ng.

( X >

Riclmard.M. Stailmara

NIIT Artificial Intelligence L ab 545 Tch Sqiiarc.-n 913 Canmbridge, MIA 02139 (617) 253-

4 I-MACS^ Manual^ lbr^ IFS-Users

might wish to learni^ how.^ Sce^ the^ file^ INIFO;CONV^ >,for^ advicco(ilIcarning^ TECO.^ 'Ibis^ manual^ does^ not even try^ to^ explain^ how^ to^ writc^ TECO^ programs,^ but^ it^ does^ contain^ some^ notes^ which^ arc^ useful^ primarily^ to the extension writer.

T--

'The Organization of the Screen 5

1.The Organization of the Screen

i-MACS divides the .ercen into seeral areas. each of which contains itsown sorts of infornation. The bigest area. of^ course,^ is^ the^ one^ in^ which you^ usually^ see^ the^ text^ you^ are^ editing.^ 'Ile^ tenninal's^ cursor tLsu~dl) appears in the middle of the text, showing 'he position (f "point". thc location at which editing takes place. While (lie cursor appcars to point al a character, point should be thought of as beiween to characters: it points b'firie the charactcr that the cursor appears on top of. Terninals have only one cursor. and when oUtut iSiil progress it must appear where the typing is bcing done. Ibis does not mcan that point is moving. Itis onli that FNIACS has no wa. to show you the location of point except u hell^ tie^ erninal^ is^ idle.

"lhc C-X ct ullllll;liultells jou precisely %thatis in ih text. if it isnot clear frmn ii:c dipla%. (Ify p arc a beginner. don't worry if'.ou don't understand this paragralh). It prints the row and coluin ol he hx.ation of the ctursor onl the screen. and the numeric code for the charactcr after the cursor. See section IIA Iqillingi. page 47.

,llic toi lines of the screen are usually availahle for text but are sometimes pre-empted by an "error mesage". which says that sonic comnmand you giae was illegal or used improperly, or^ b)^ typeout^ from^ a command (such as. a fisting of a file directory). "lhe error message or typeout appears there for your ifrmation. but it is not part of the file you are editing, and it gos away if you -ype any command. Ifyou Want to make it go away iummiediately but not do anything else. you can type a Space. (Usuamlly a Space inserts itself. but when there is an errorn messge or typeout on the ,cren it does nothing but get rid of that.) The terininars ctror always appears at the end of the error mtesage or typeoit. but this does not mean that point has mnoted. The cursor moves back to tlhe location (if point after the error nts.a.e or typeout goes ziway.

A few lines at the botton of the screen compose what is called "the echo area". "hlihoing" means printing out the commands that you type. EIMACS commands are usually not echoed at all, but if you pause for more than a second in the middle^ of a^ nmulti-character^ command^ then^ the^ whole^ command^ (including^ what^ you have typed so far) Fs echoed. Ibis behavior is designed to give confidint users optimum response. while giving nervous users information on u h.t they arc doing.

IMACS also uses the echo area for reading and displaying the arguments for some commands. such as E searches. ad for printing hifirmation in rspomse It)ccrtai in Iads.

lhe lint above he echo area is known as the "nmiodc line". It is the line that usually starts with "I-MACS

(oil it lig)". Its pllqo e is to^ tell^ what^ is^ guing^ oi^ in the^ I"MACS.^ and^ to^ show^ any^ risco.is^ Why^ coilIInands

may not bc imerprtcd intie stantlard way. "bic mode line is %cry iniportfanL and .Xyou are surprised by how lIM.\CS reacs to youir comiands you should look there for colightenmenL

I'he Organization ol the Screen 7

"file" is (li niamei ofithc file thlat you cire editing. It is the last file that was Visited in thc buffer yott arc in.

If "(RO)' (for "read only") appears after the filcnamlc. it mecans that if you visit anothier file ill thle same buffier thcn changes you hiavc miade to this file will bc lost unilcss you have explicitly asked to sa've them. See section 13.1 [Visiting], page 55, for niorc information. If therc is no "(RO)" and YOU Visit anlOOMe ile in the samec butffbr, EMACS will offer to save your changes First, if there arc any changcs.

T'he star at the end of the niode line means thiat there are chianges in thie buffer whiich have not been saved inthe file. If, Ithe file has nlot been chaniged sinlce it was read in or saved, there is no star.

"pos" tells you whlether there is additional text ab~ove the top of the screen, or below the b~ottom. If your File is smiall andl it is all onl the screen, --p~os-- is omnitted. Othierwise, it is --TlOP-- if you are looking at the begin n11ing of' thie ile. --130OT-- i f you are look ing atl the end of the File, or' --nnl%-- where Ill is tile Percentage of thie file aboN e the top of the screen.

Somct-nIes you will see -MORIF- instead of --imni%--. 'Ilhis happens when typeout fro coiniand is too long tfiontesienImeans that if you type a Space the next sci cenflul of in forinauion will be p~rited. If you are not interested, typing anything but at Space Will cauise thle rest 01'thle output ito be discarded. Tlyping atRuLboul will discat d thle onutput and do noth i ig else. 'I ypi ng any othier cininand will (discard the rest oif the otput and lalso do thle commiland. Wheni the output is discarded, "FH I IlI)" is printed after ticle

So mutchi foi- whiat the miode line says at top level. When the miode linc doesn't start Wilit "EMACS" and

2doesn't lokanythiing like the breakdown given above, theni IiMACS is not at top level, and your typing will

not be un(Ieistood in thle uIsuail Way. 'Ihis is because you am'e inside a subsystem, such ats INFO (See section 6.1 [Subsystems), page 25.), or in a recursive editing level, suchI as Edit Options (See^ section^ 6. [Recursive Fditingj, page 26.). TIhe miode line tells you what commnand you are inside.

If you ar'e accustomecd to othie' display editors, you mnay be surprise() that iM ACS does not always display thle pagPe numnber and line numnbet' of^ point^ in^ the^ inode^ line.^ 'l'his^ is^ because^ tli'.^ text^ is^ stored^ iii^ a^ way^ which makes it (Iifficult to comipute this information. D isplaying themn all the timec would be too slow to be borne. When you want to know the page and line numnber' of point,^ you^ inus~t^ ask^ flor^ thle^ inibrinatiol^ Withi^ thle^ M-X What Page commnand. Sesection 18 jl1'ages], page 79. I lowevet', once you are adjusted to JEMACS, you will r'arely hiave any reason to be concerned Withi page nunlem's or line numibers..

5 __ ____ ____ ____~ 4

mg

8 I-MACS-MantladI^

for fl'S-Users

Aw

-- -A

10 VIMACS^ Manual^ tor^ ITS^ Users

distinction between ASCII Control and EMACS Control, except to realize that EMACS uses some "Control" characters which arc not on your keyboard.

In addition to the 9-bit command character set,^ there^ is^ one extra^ character^ called^ Help.^ It^ cannot^ be combined with Control or Meta. Its use is to ask for documentation, at any time. Like the the 9-bit characters, the I leip character has its own key on an ideal keyboard, but must be represented by something else on other keyboards. The circumlocution we use is Control-_ H (two characters). 'Ilic code use; internally for I^ lelp^ is4!10^ (octal). We have given some command characters special names which we always capitalize. "Return" or "<crY" stands for the carriage return character, code 015 (all charactcr codcs are in octal). Note that C-R mcans thc character Conttol-R. never Rcturn. "Rubout" is the character with code 177, labeled "l)ciete" on some kc boards. "Ahniode"^ isthe^ character^ with^ code^ 033,^ sometimes^ labeled^ ".scape".^ Other^ command char'cters with special names ac Tab (code 011). Iackspace (code 010). L.inefeed (code 012). Space (code 0140). I:xcl ("!". code 0,11). Comma (code 054), and Period (code 056). Control is represented in the numcric code for a character by 200. and Meta by 400; thus, hleta-iPeriod is code 456 in^ the^ 9-bit^ character^ set.

2.2. Prefix Characters

A non-ideal keyboard can only send certain Control characters, and may completely lack the ability to send Meta characters. 'lo use these commands on such keyboards, you need to use two-character circumlocuitioais starting with a "bit prefix" character which turns on the Control or Meta bit it, the second characicr. The Altmode character turns on the Meta bit, so Altmode X can be used to type a Meta-X. and Alunode Control-O can be used to type a C-M-O. Altnode is known as "the Metizer". Other bit prelix ch:aracters arc C-- for Control, and C-C for Control and Meta together. Thus, C-- < is a way of typing a Control-<, and C-C < can lC used to type C-M-<. Because C-^ isawkward to type on most keyboards, we ha c tried to minimize the number of cormnands For which you will need it.

There is another prefix character, Control-X which is used as the beginning of a large set of two-characier commands known as "C-X commands". C-X is not a bit prefix character, C-X A is not a circumlocution for any single characterand it mutst be typed ats two characters oil anly terminal.

~~2.3. Cotmmands, Fuctions, and Variabfles

Most o' ihe #i'MA(.'S commnlands documented herein are nicmher of this 9-hit character set. Others arc pairs of characters from that set. I lowever, I.MACS doesn't really delic commands directly. Instead, IMACS delines "fiunctiors", which have long names such as "R Down Real I.ine", and then the functions are connected to "commands" such as C-N through a dispatch table. When we say that C-'. moves the cursor

  • I-----

Character (^) Set and Command Input Conventions (^1)

dlown a line we ;ire glossing over a distinction %%hich is iniluportant for (^) ordinary use. but essential for customizationl: it is [lie function -R Down Real LIn.m which knows hlow to mlove (^) down at line. and C-N moves

down ~j linc becauve it is connected to that function. Wc usually ignore this subtlety to keep things simiple. TPo

oihe the cxtcnsion-writcr thc informnation lie necds, we statc the namic (^) of thc function which really does the "ork in parentheses after mentioning thle command name. For example: (^) "C-N (-R lDown Real in.e) moves tile cutior down ;, line". In)tile FMACS (^) wall chart, the function names arc used as a formi of vcry brief documentation for the command characters. See section 5.2 [Nunctions], (^) page 21.

The "R " whirh appears at (^) thle front oftheli functio~n name is simply part of the name. Bly convention, aj Cei maini class of, Iunct ions ham e nam11es whlich stall t with (^) "Rt"

WVhile %e are h ujcto( u~ri nbit'sWihyt (^) htl otb fgindoi' a

VillableMumle%aiabeisit Fo".A mineuse to emeber t vltic FNACS ontin variablesble .%hcharethicso (^) thiat you can change themn if you want to cuistomize. The %;triable's value is examined by %otne (^) c01mi 1,aud, and changing the valuec makes thc command behave differently. Until you are intereslcd in

%tIStOIllIMI Its, YOU Lill ignOre Ois~ informaitioni. Wheni you are ready to be interested, read thle basic

inforril! on on .variables, amnd (^) thenl the information onl individual variables will make sense. See section 22. IVamiab!,s1, page 114.

2.4. Notational C'onventions for ASCII Ch1,1aces

Cont(;ol cllaracicrs, in files, your IiMAC-,S buo ich. or *UlCO programs, arc ut dinary ASCII (^) chiaractet ' and

-ire recprc.'ented as upa..row or caret l'Ilowe~d by thle corresp~onding non-control character: control-ti is

representcd ats t IF. *1 he special 9-bit character set applies only to typing FIMACS commands.

CR1 F irs (lie traditionzli erni for acairriage return followed by a inefeed. TFhiis sequence of two characters

I'S what scparates iiv:. in tcxt ix ing edited. Normally, EMACS commands make tiis sequceIC appear to be a

single .* aracter, but i'CO t-ode must deal wvith thle realities. A return or atlinefeed which is not part of it CR!iscaled Stry".IiACS (^) tusualiy trca.,s mhem as part of thie line and displays themn as TM and -ti.

Other A.CII charactzrs with special names include tab (control-I, 01l), backspace (controi-l-l, 010), uimifeel ;lm~od~(031).spae(unt '~ J,012. (~l0. ad i 1 abnt I77.Imb anld c')mtrol-I are different. as 9-bit it uatm,11d Libm (cr5. hNoIwhi mnlm ed Ito '\S( II Ilhey become thie saanw. Our consention (^) is that Ilallics (II'

Most coniti oh hlm~~ whenl preso-t ;i thle I ACS buffer arc (displayedi with a caret; thus, -A f1or ASCII

?A. Rubout isLflsplay~d as 1,i:ccluse (^) Iby stretching thie meaning of' "control" it canl be interpreted as ASCII

IV T Rmv

Basic Editing Commands (^) 1

3. Basic Editing Commiands

We nlow give tile basics of how to enter text, make corrections, and savc thc text in at ife. If this material is

new to you. you might learn it more easily by running tlicTF'IACI IFiMACS program.

3.1. Inserting 'ext

Tlo insett printing characters into (tic text you are editing, just type them. Normally (when FIMACS is at

top lcelc). fihe%, arc inserted int (lie text ait (hie cursor, which mo(ves for%%aid. Any characters aftcr thle cursor

nlme fbi mard too. It' thc cursor is in between af 100 and a BA R, typing XX produces and disolays l{OONX HA with file Cursor before thie "BI". 'luis miethod of insertion works fior prinfhing characteis anol space. but other Characters act as editing comnmandls and do not insert themselves. Iftyou need to insert it

control character. Altnode. hi) or Ru bout, you muist (fliote it by typ~ing 'lhe C-Q command first. "C" refers

to the Contool lbit. See section 2 fCharacteisl, page 9.

I()correct text youl have just inset ted, you can use Ruhouit. Rulout deletes th chcli-ter bibe thiecursor (nlot thle onle that the cuIlsor is oil top of or- tifder, that is thle chat acter afleir thie cursor). 'llhe cursor and all chara-,ctet s flter-itiimove backwairds. YIotican rutl) oit a liebounidariy by typimig tbont when thectirs(,. is at thle beginniing ofa linle. -o enlda linle and start typing (^) at new one, typc Return (-R CRI.F). (^) You canl also type Retinin to break anl exidting linle into two. A Rubout after atReturn will unldo it. Return really inserts two characters, at carriage

~ettii if amnd a ineeed (at CR1 I.F. but almnost everything in IiMACS makes them look like just one characmr.

which you can think ohas afline-separator character.

If you add too many characters to onec line, without breaking it with atRclurn, the line will grow to occupyt two (or- more) lines onl the screen, with a " at thie extremec right inargin of all but thle last of thenil. 'I'lie "I" says that the^ following^ screen^ line^ is^ not^ really^ a^ (distinictfine^ inl^ the^ file,^ but^ just^ the^ "continuiation"^ of^ a^ line

~ too long to fit thle Sceen.

3.2. Movitng 'IThe Cursor

To (10 iumoic thai1m insert Charactet s. youl have^ to^ know^ how^ to^ imove^ the^ cursor.^ I^ keie^ are^ afre.w^ of^ theA -. tomtttttalIfs fill doing t~at.

C-A Moves to [lime hleginiulitg of'the line.

jC-1:^ CIAf^ MovesMoves^ toForward^ thie^ end over,^ or^ the one^ line.V character.

14 1-.MACS Mani'al for ITS Users

C-Il Moves backward over one character.

C-N Moves down one line. verticaily. If you stirt in the middle of one line, you end in the

middle of the next. From the last line of text. it creates a new line.

C-P Moves tip one fine. vertically.

C-I. Clears the screen and reprints everything. C-U C-I. reprints just the line that the cursor is on. C-T Transposes t, mracters (the ones before and after the cursor). M-< Moves to tl( of your text. M-> Motes to the e, ofyour text.

3.3. Erasing Text

Rubout I)clete the character" hefor the cursor.

C-i ) I)elete the character after tile cursor.

C-K Kill to the end of the line. on already know about tie Ruotit command whichldeletes the character before the cursor. Another collnllind. Control-I). deletes the character after the ctrsor. causing tie rest of the text on tie line to shift left.

I fContmol-i ) is typed at tie end ofa line, that line and tile next line are joined together.

To erase a larger amount of text, use the Control-K command, which kills a line at a time. lfControl-K is done at the beginning or middle of a line. it kills all the text up to the end oil the line. IfControl-K is done at the end ofa line, it joins that line and the next line.

See :ccti)I 9.1 Killingi, page 35. for more flexible ways of killing text.

:' 3.4. Files

The Commands aove are sufficient for creating text in the EMACS buffer. Tlhe more advanced EMACS

conmads j,,t make things easier. But to keep any text permanently you must put it ina file. You do that

by Choosing afilelaim, Stich as FOO, and typing C-X C-V FOO<cr). "ll'is "visits" the file FOO (actually,

FOO > on your work:ing directory) so that its contents appear on the screen for editing. You can make

changes, and then "save" tie file by typing C-X C-S. 1his makes the changes penanent and actually

w changes tile Me FOO.^ Until^ then,^ ie changes^ are^ only^ inside^ your^ IMACS,^ and^ tile^ file^ FOO^ is^ not^ really changed. If the file FOO doesn't exist. and yon want to create it. visit it as if it did exist. When you tsave your -

text with C-X C-S the file will be created.

Ofcolrse, there isa lotnmore to learn aolut using files. Scesection l3jlFiles]. page55.