xref: /csrg-svn/bin/ed/ed.1 (revision 43083)
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)ed.1	6.3 (Berkeley) 06/11/90
7.\"
8.Dd
9.Dt ED 1
10.Os ATT 7th
11.if t .ds q \(aa
12.if n .ds q '
13.Sh NAME
14.Nm ed
15.Nd text editor
16.Sh SYNOPSIS
17.Nm ed
18.Op Fl
19.Op Fl x
20.Op Ar file
21.Sh DESCRIPTION
22.Nm Ed
23is the standard text editor.
24.Pp
25If a
26.Ar file
27argument is given,
28.Nm ed
29simulates an
30.Ic e
31command (see below) on the named file; that is to say,
32the file is read into
33.Nm ed 's
34buffer so that it can be edited.
35.Tp Fl x
36An
37.Ic x
38command is simulated first to handle an encrypted file.
39.Tp Fl
40Suppresses the printing
41of explanatory output
42and should be used
43when the standard input is
44an editor script.
45.Tp
46.Pp
47.Nm Ed
48operates on a copy of any file it is editing; changes made
49in the copy have no effect on the file until a
50.Ic w
51(write) command is given.
52The copy of the text being edited resides
53in a temporary file called the
54.Ar buffer  .
55.Pp
56Commands to
57.Nm ed
58have a simple and regular structure: zero or
59more
60.Ar addresses
61followed by a single character
62.Ar command ,
63possibly
64followed by parameters to the command.
65These addresses specify one or more lines in the buffer.
66Missing addresses are supplied by default.
67.Pp
68In general, only one command may appear on a line.
69Certain commands allow the
70addition of text to the buffer.
71While
72.Nm ed
73is accepting text, it is said
74to be in
75.Ar input mode .
76In this mode, no commands are recognized;
77all input is merely collected.
78Input mode is left by typing a period
79.Sq Ic \&.
80alone at the
81beginning of a line.
82.Pp
83.Nm Ed
84supports a limited form of
85.Ar regular expression
86notation.
87A regular expression specifies
88a set of strings of characters.
89A member of this set of strings is said to be
90.Ar matched
91by the regular expression.
92In the following specification for regular expressions
93the word `character' means any character but newline.
94.Tw Ds
95.Tp 1.
96Any character except a special character
97matches itself.
98Special characters are
99the regular expression delimiter plus
100.Sq Li \e\[
101and sometimes
102.Sq Li ^*$ .
103.Tp 2.
104A
105.Sq Ic \&.
106matches any character.
107.Tp 3.
108A
109.Sq Li \e
110followed by any character except a digit or
111.Li (\)
112matches that character.
113.Tp 4.
114A nonempty string
115.Op Ar s
116or
117.Cx \&(
118.Op \&^ Ar s
119.Cx \&)
120.Cx
121matches any character in (or not in)
122.Ar s .
123In
124.Ar s ,
125.Sq Li \e
126has no special meaning, and
127may only appear as
128the first letter.
129A substring
130.Ar a\-b ,
131with
132.Ar a
133and
134.Ar b
135in ascending ASCII order, stands for the inclusive
136range of ASCII characters.
137.Tp 5.
138A regular expression of form 1\-4 followed by * matches a sequence of
1390 or more matches of the regular expression.
140.Tp 6.
141A regular expression,
142.Ar x ,
143of form 1\-8, bracketed
144.Cx Li \e(
145.Ar x
146.Li \e)
147.Cx
148matches what
149.Ar x
150matches.
151.Tp 7.
152A \e followed by a digit
153.Ar n
154matches a copy of the string that the
155bracketed regular expression beginning with the
156.Cx Ar n
157.Cx \'th
158.Cx
159.Li \e(
160matched.
161.Tp 8.
162A regular expression of form 1\-8,
163.Ar x ,
164followed by a regular expression of form 1\-7,
165.Ar y
166matches a match for
167.Ar x
168followed by a match for
169.Ar y ,
170with the
171.Ar x
172match being as long as possible while still permitting a
173.Ar y
174match.
175.Tp 9.
176A regular expression of form 1\-8 preceded by
177.Sq Li ^
178(or followed by
179.Sq Li $ ) ,
180is constrained to matches that
181begin at the left (or end at the right) end of a line.
182.Tp 10.
183A regular expression of form 1\-9 picks out the
184longest among the leftmost matches in a line.
185.Tp 11.
186An empty regular expression stands for a copy of the
187last regular expression encountered.
188.Tp
189.Pp
190Regular expressions are used in addresses to specify
191lines and in one command
192(see
193.Ar s
194below)
195to specify a portion of a line which is to be replaced.
196If it is desired to use one of
197the regular expression metacharacters as an ordinary
198character, that character may be preceded by
199.Sq Li \e .
200This also applies to the character bounding the regular
201expression (often
202.Sq Li \&/ )
203and to
204.Sq Li \e
205itself.
206.Pp
207To understand addressing in
208.Nm ed
209it is necessary to know that at any time there is a
210.Ar current line.
211Generally speaking, the current line is
212the last line affected by a command; however,
213the exact effect on the current line
214is discussed under the description of
215the command.
216Addresses are constructed as follows.
217.Tw Ds
218.Tp 1.
219The character
220.Sq Ic \&.
221addresses the current line.
222.Tp 2.
223The character
224.Cx `
225.Ic $
226.Cx \'
227.Cx
228addresses the last line of the buffer.
229.Tp 3.
230A decimal number
231.Ar n
232addresses the
233.Cx Ar n
234.Cx \'th
235.Cx
236line of the buffer.
237.Tp 4.
238.Cx `\(fm
239.Ar x
240.Cx \'
241.Cx
242addresses the line marked with the name
243.Ar x  ,
244which must be a lower-case letter.
245Lines are marked with the
246.Ar k
247command described below.
248.Tp 5.
249A regular expression enclosed in slashes
250.Cx `
251.Li /
252.Cx \'
253.Cx
254addresses
255the line found by searching forward from the current line
256and stopping at the first line containing a
257string that matches the regular expression.
258If necessary the search wraps around to the beginning of the
259buffer.
260.Tp 6.
261A regular expression enclosed in queries
262.Cx `
263.Li ?
264.Cx \'
265.Cx
266addresses
267the line found by searching backward from the current line
268and stopping at the first line containing
269a string that matches the regular expression.
270If necessary
271the search wraps around to the end of the buffer.
272.Tp 7.
273An address followed by a plus sign
274.Cx `
275.Li +
276.Cx \'
277.Cx
278or a minus sign
279.Cx `
280.Li \-
281.Cx \'
282.Cx
283followed by a decimal number specifies that address plus
284(resp. minus) the indicated number of lines.
285The plus sign may be omitted.
286.Tp 8.
287If an address begins with
288.Cx `
289.Li +
290.Cx \'
291.Cx
292or
293.Cx `
294.Li \-
295.Cx \'
296.Cx
297the addition or subtraction is taken with respect to the current line;
298e.g.
299.Cx `
300.Li \-5
301.Cx \'
302.Cx
303is understood to mean
304.Cx `
305.Li .\-5
306.Cx \'
307.Cx
308.Nm .
309.Tp 9.
310If an address ends with
311.Cx `
312.Li +
313.Cx \'
314.Cx
315.Cx `
316.Li \-
317.Cx \',
318.Cx
319then 1 is added (resp. subtracted).
320As a consequence of this rule and rule 8,
321the address
322.Cx `
323.Li \-
324.Cx \'
325.Cx
326refers to the line before the current line.
327Moreover,
328trailing
329.Cx `
330.Li +
331.Cx \'
332.Cx
333and
334.Cx `
335.Li \-
336.Cx \'
337.Cx
338characters
339have cumulative effect, so
340.Cx `
341.Li \-\-
342.Cx \'
343.Cx
344refers to the current
345line less 2.
346.Tp 10.
347To maintain compatibility with earlier versions of the editor,
348the character
349.Cx `
350.Li ^
351.Cx \'
352.Cx
353in addresses is
354equivalent to
355.Cx `
356.Li \-
357.Cx \'.
358.Cx
359.Tp
360.Pp
361Commands may require zero, one, or two addresses.
362Commands which require no addresses regard the presence
363of an address as an error.
364Commands which accept one or two addresses
365assume default addresses when insufficient are given.
366If more addresses are given than such a command requires,
367the last one or two (depending on what is accepted) are used.
368.Pp
369Addresses are separated from each other typically by a comma
370.Cx `
371.Li ,
372.Cx \'
373.Cx
374They may also be separated by a semicolon
375.Cx `
376.Li ;
377.Cx \'
378.Cx
379In this case the current line
380.Cx `
381.Li .
382.Cx \'
383.Cx
384.Nm .
385is set to
386the previous address before the next address is interpreted.
387This feature can be used to determine the starting
388line for forward and backward searches
389.Cx \&(`
390.Li /
391.Cx \'
392.Cx
393.Cx `
394.Li ?
395.Cx \').
396.Cx
397The second address of any two-address sequence
398must correspond to a line following the line corresponding to the first address.
399The special form
400.Cx `
401.Li \&%
402.Cx \'
403.Cx
404is an abbreviation for the address pair
405.Cx `
406.Li 1,$
407.Cx \'.
408.Cx
409.Pp
410In the following list of
411.Nm ed
412commands, the default addresses
413are shown in parentheses.
414The parentheses are not part of
415the address, but are used to show that the given addresses are
416the default.
417.Pp
418As mentioned, it is generally illegal for more than one
419command to appear on a line.
420However, most commands may be suffixed by `p'
421or by `l', in which case
422the current line is either
423printed or listed respectively
424in the way discussed below.
425Commands may also be suffixed by `n',
426meaning the output of the command is to
427be line numbered.
428These suffixes may be combined in any order.
429.Tw Ds
430.Tp Cx \&(
431.Ic .
432.Cx \&)
433.Ic a
434.Cx
435.Tp <text>
436.Tp Ic \&.
437The append command reads the given text
438and appends it after the addressed line.
439.Sq Ic \&.
440is left
441on the last line input, if there
442were any, otherwise at the addressed line.
443Address `0' is legal for this command; text is placed
444at the beginning of the buffer.
445.Tp Cx \&(
446.Ic \&.
447.Cx \&,
448.Ic \&.
449.Cx \&)
450.Ic \&c
451.Cx
452.Tp <text>
453.Tp Ic \&.
454The change
455command deletes the addressed lines, then accepts input
456text which replaces these lines.
457.Sq Ic \&.
458is left at the last line input; if there were none,
459it is left at the line preceding the deleted lines.
460.Tp Cx \&(
461.Ic \&.
462.Cx \&,
463.Ic \&.
464.Cx \&)
465.Ic \&d
466.Cx
467The delete command deletes the addressed lines from the buffer.
468The line originally after the last line deleted becomes the current line;
469if the lines deleted were originally at the end,
470the new last line becomes the current line.
471.Tp Cx Ic \&e
472.Cx \&\ \&
473.Ar filename
474.Cx
475The edit
476command causes the entire contents of the buffer to be deleted,
477and then the named file to be read in.
478.Sq Ic \&.
479is set to the last line of the buffer.
480The number of characters read is typed.
481.Ar filename
482is remembered for possible use as a default file name
483in a subsequent
484.Ic r
485or
486.Ic w
487command.
488If
489.Ar filename
490is missing, the remembered name is used.
491.Tp Cx Ic E
492.Cx \&\ \&
493.Ar filename
494.Cx
495This command is the same as
496.Ic e ,
497except that no diagnostic results when no
498.Ic w
499has been given since the last buffer alteration.
500.Tp Cx Ic f
501.Cx \&\ \&
502.Ar filename
503.Cx
504The filename command prints the currently remembered file name.
505If
506.Ar filename
507is given,
508the currently remembered file name is changed to
509.Ar filename .
510.Tp Cx \&(
511.Ic \&1
512.Cx \&,
513.Ic \&$
514.Cx \&)
515.Ic \&g
516.Ar/regular expression/command list
517.Cx
518In the global
519command, the first step is to mark every line which matches
520the given regular expression.
521Then for every such line, the
522given command list is executed with
523.Cx `
524.Ic \&.
525.Cx \'
526.Cx
527initially set to that line.
528A single command or the first of multiple commands
529appears on the same line with the global command.
530All lines of a multi-line list except the last line must be ended with
531.Cx `
532.Ic \&\e
533.Cx \'.
534.Cx
535.Ic A ,
536.Ic i,
537and
538.Ic c
539commands and associated input are permitted;
540the
541.Cx `
542.Ic \&.
543.Cx \'
544.Cx
545terminating input mode may be omitted if it would be on the
546last line of the command list.
547The commands
548.Ic g
549and
550.Ic v
551are not permitted in the command list.
552.Tp Cx \&(
553.Ic .
554.Cx \&)
555.Ic i
556.Cx
557.Tp <text>
558.Tp Ic \&.
559This command inserts the given text before the addressed line.
560.Cx `
561.Ic \&.
562.Cx \'
563.Cx
564is left at the last line input, or, if there were none,
565at the line before the addressed line.
566This command differs from the
567.Ic a
568command only in the placement of the
569text.
570.Tp Cx \&(
571.Ic \&.
572.Cx \&,
573.Ic \&.+1
574.Cx \&)
575.Ic \&j
576.Cx
577This command joins the addressed lines into a single line;
578intermediate newlines simply disappear.
579.Cx `
580.Ic \&.
581.Cx \'
582.Cx
583is left at the resulting line.
584.Tp Cx \&(
585.Ic .
586.Cx \&)
587.Ic k
588.Ar x
589.Cx
590The mark command marks the addressed line with
591name
592.Ar x ,
593which must be a lower-case letter.
594The address form
595.Cx `\(fm
596.Ar x
597.Cx \'
598.Cx
599then addresses this line.
600.Tp Cx \&(
601.Ic \&.
602.Cx \&,
603.Ic \&.
604.Cx \&)
605.Ic \&l
606.Cx
607The list command
608prints the addressed lines in an unambiguous way:
609non-graphic characters are
610printed in two-digit octal,
611and long lines are folded.
612The
613.Ar l
614command may be placed on the same line after any non-i/o
615command.
616.Tp Cx \&(
617.Ic \&.
618.Cx \&,
619.Ic \&.
620.Cx \&)
621.Ic \&m
622.Ar a
623.Cx
624The move command repositions the addressed lines after the line
625addressed by
626.Ar a  .
627The last of the moved lines becomes the current line.
628.Tp Cx \&(
629.Ic \&.
630.Cx \&,
631.Ic \&.
632.Cx \&)
633.Ic \&p
634.Cx
635The print command prints the addressed lines.
636.Cx `
637.Ic \&.
638.Cx \'
639.Cx
640is left at the last line printed.
641The
642.Ic p
643command
644may
645be placed on the same line after any non-i/o command.
646.Tp Cx \&(
647.Ic \&.
648.Cx \&,
649.Ic \&.
650.Cx \&)
651.Ic \&P
652.Cx
653This command is a synonym for
654.Ic p .
655.Tp Ic q
656The quit command causes
657.Nm ed
658to exit.
659No automatic write
660of a file is done.
661.Tp Ic Q
662This command is the same as
663.Ic q ,
664except that no diagnostic results when no
665.Ic w
666has been given since the last buffer alteration.
667.Tp Cx \&(
668.Ic $
669.Cx \&)
670.Ic r
671.Cx \&\ \&
672.Ar filename
673.Cx
674The read command
675reads in the given file after the addressed line.
676If no file name is given,
677the remembered file name, if any, is used
678(see
679.Ic e
680and
681.Ic f
682commands).
683The file name is remembered if there was no
684remembered file name already.
685Address `0' is legal for
686.Ic r
687and causes the
688file to be read at the beginning of the buffer.
689If the read is successful, the number of characters
690read is typed.
691.Cx `
692.Ic \&.
693.Cx \'
694.Cx
695is left at the last line read in from the file.
696.Tp Cx \&(
697.Ic \&.
698.Cx \&,
699.Ic \&.
700.Cx \&)
701.Ic \&s
702.Ar/regular expression/replacement/
703.Cx \&\tor
704.Cx
705.Tp Cx \&(
706.Ic \&.
707.Cx \&,
708.Ic \&.
709.Cx \&)
710.Ic \&s
711.Ar/regular expression/replacement/
712.Ic \&g
713.Cx
714The substitute command searches each addressed
715line for an occurrence of the specified regular expression.
716On each line in which a match is found,
717all matched strings are replaced by the replacement specified,
718if the global replacement indicator
719.Ic \&g
720appears after the command.
721If the global indicator does not appear, only the first occurrence
722of the matched string is replaced.
723It is an error for the substitution to fail on all addressed lines.
724Any punctuation character
725may be used instead of
726.Cx `
727.Ic \&/
728.Cx \'
729.Cx
730to delimit the regular expression
731and the replacement.
732.Cx `
733.Ic \&.
734.Cx \'
735.Cx
736is left at the last line substituted.
737An ampersand
738.Cx `
739.Ic \&&
740.Cx \'
741.Cx
742appearing in the replacement
743is replaced by the string matching the regular expression.
744The special meaning of
745.Cx `
746.Ic \&&
747.Cx \'
748.Cx
749in this context may be
750suppressed by preceding it by
751.Cx `
752.Ic \&\e
753.Cx \'.
754.Cx
755The characters
756.Cx `
757.Ic \&\e
758.Ar n
759.Cx \'
760.Cx
761where
762.Ar n
763is a digit,
764are replaced by the text matched by the
765.Cx Ar n
766.Cx \'th
767.Cx
768regular subexpression
769enclosed between
770.Cx `
771.Ic \&\e\&(
772.Cx \'.
773.Cx
774and
775.Cx `
776.Ic \&\e\&)
777.Cx \'.
778.Cx
779When
780nested, parenthesized subexpressions
781are present,
782.Ar n
783is determined by counting occurrences of
784.Cx `
785.Ic \&\e\&(
786.Cx \'.
787.Cx
788starting from the left.
789Lines may be split by substituting new-line characters into them.
790The new-line in the
791replacement string
792must be escaped by preceding it by
793.Cx `
794.Ic \&\e
795.Cx \'.
796.Cx
797One or two trailing delimiters may be omitted,
798implying the
799.Ic p
800suffix.
801The special form
802.Ic s
803followed by
804.Ar no
805delimiters
806repeats the most recent substitute command
807on the addressed lines.
808The
809.Ic s
810may be followed by the letters
811.Ic r
812(use the most recent regular expression for the
813left hand side, instead of the most recent
814left hand side of a substitute command),
815.Ic p
816(complement the setting of the
817.Ic p
818suffix from the previous substitution), or
819.Ic g
820(complement the setting of the
821.Ic g
822suffix).
823These letters may be combined in any order.
824.Tp Cx \&(
825.Ic \&.
826.Cx \&,
827.Ic \&.
828.Cx \&)
829.Ic \&t
830.Ar a
831.Cx
832This command acts just like the
833.Ic m
834command, except that a copy of the addressed lines is placed
835after address
836.Ad a
837(which may be 0).
838.Cx `
839.Ic \&.
840.Cx \'
841.Cx
842is left on the last line of the copy.
843.Tp Cx \&(
844.Ic \&.
845.Cx \&,
846.Ic \&.
847.Cx \&)
848.Ic \&u
849.Cx
850The undo command restores the buffer to it's state
851before the most recent buffer modifying command.
852The current line is also restored.
853Buffer modifying commands are
854.Ic a , c , d , g , i , k , m , r , s , t ,
855and
856.Ic v .
857For purposes of undo,
858.Ic g
859and
860.Ic v
861are considered to be a single buffer modifying command.
862Undo is its own inverse.
863When
864.Nm ed
865runs out of memory
866(at about 8000 lines on any 16 bit mini-computer
867such as the PDP-11)
868This full undo is not possible, and
869.Ic u
870can only undo the effect of the most recent
871substitute on the current line.
872This restricted undo also applies to editor scripts
873when
874.Nm ed
875is invoked with the
876.Fl
877option.
878.Tp Cx \&(
879.Ic \&1
880.Cx \&,
881.Ic \&$
882.Cx \&)
883.Ic \&v
884.Ar/regular expression/command list
885.Cx
886This command is the same as the global command
887.Ic g
888except that the command list is executed
889.Ic g
890with
891.Cx `
892.Ic \&.
893.Cx \'
894.Cx
895initially set to every line
896.Em except
897those
898matching the regular expression.
899(1, $)\w filename
900.Tp Cx \&(
901.Ic \&1
902.Cx \&,
903.Ic \&$
904.Cx \&)
905.Ic \&w
906.Cx \&\ \&
907.Ar filename
908.Cx
909The write command writes the addressed lines onto
910the given file.
911If the file does not exist,
912it is created.
913The file name is remembered if there was no
914remembered file name already.
915If no file name is given,
916the remembered file name, if any, is used
917(see
918.Ic e
919and
920.Ic f
921commands).
922.Cx `
923.Ic \&.
924.Cx \'
925.Cx
926is unchanged.
927If the command is successful, the number of characters written is
928printed.
929.Tp Cx \&(
930.Ic \&1
931.Cx \&,
932.Ic \&$
933.Cx \&)
934.Ic \&W
935.Cx \&\ \&
936.Ar filename
937.Cx
938This command is the same as
939.Ic w ,
940except that the addressed lines are appended to the file.
941.Tp Cx \&(
942.Ic \&1
943.Cx \&,
944.Ic \&$
945.Cx \&)
946.Ic \&wq
947.Cx \&\ \&
948.Ar filename
949.Cx
950This command is the same as
951.Ic w
952except that afterwards a
953.Ic q
954command is done,
955exiting the editor
956after the file is written.
957.Tp x
958A key string is demanded from the standard input.
959Later
960.Ic r , e
961and
962.Ic w
963commands will encrypt and decrypt the text
964with this key by the algorithm of
965.Xr crypt  1  .
966An explicitly empty key turns off encryption.
967.Ic \&1
968.Ic \&+1
969.Cx \&)
970.Ic \&z
971.Cx \&\ \ \&or,
972.Cx
973.Tp Cx \&(
974.Ic \&1
975.Ic \&+1
976.Cx \&)
977.Ic \&z
978.Ar n
979.Cx
980This command scrolls through the buffer starting at the addressed line.
98122 (or
982.Ar n ,
983if given)
984lines are printed.
985The last line printed becomes the current line.
986The value
987.Ar n
988is sticky, in that it becomes the default for
989future
990.Ic z
991commands.
992.Tp Cx \&(
993.Ic \&$
994.Cx \&)
995.Ic \&=
996.Cx
997The line number of the addressed line is typed.
998.Cx `
999.Ic \&.
1000.Cx \'
1001.Cx
1002is unchanged by this command.
1003.Tp Cx Ic \&!
1004.Cx <shell\ command>
1005.Cx
1006The remainder of the line after the `!' is sent
1007to
1008.Xr sh  1
1009to be interpreted as a command.
1010.Cx `
1011.Ic \&.
1012.Cx \'
1013.Cx
1014is unchanged.
1015.Tp Cx \&(
1016.Ic \&.+1
1017.Cx \&,
1018.Ic \&.+1
1019.Cx \&)
1020.Cx <newline>
1021.Cx
1022An address alone on a line causes the addressed line to be printed.
1023A blank line alone is equivalent to
1024.Ic .+1
1025it is useful
1026for stepping through text.
1027If two addresses are present with no
1028intervening semicolon,
1029.Nm ed
1030prints the range of lines.
1031If they are separated by a semicolon,
1032the second line is printed.
1033.Tp
1034.Pp
1035If an interrupt signal (ASCII DEL) is sent,
1036.Nm ed
1037prints
1038.Sq Li ?interrupted
1039and returns to its command level.
1040.Pp
1041Some size limitations:
1042512 characters per line,
1043256 characters per global command list,
104464 characters per file name,
1045and, on mini computers,
1046128K characters in the temporary file.
1047The limit on the number of lines depends on the amount of core:
1048each line takes 2 words.
1049.Pp
1050When reading a file,
1051.Nm ed
1052discards ASCII NUL characters
1053and all characters after the last newline.
1054It refuses to read files containing non-ASCII characters.
1055.Sh FILES
1056.Dw edhup
1057.Di L
1058.Dp Pa /tmp/e*
1059.Dp Pa edhup
1060work is saved here if terminal hangs up
1061.Dp
1062.Sh SEE ALSO
1063.Xr ex 1 ,
1064.Xr sed 1 ,
1065.Xr crypt 1
1066.br
1067B. W. Kernighan,
1068.Em A Tutorial Introduction to the ED Text Editor
1069.br
1070B. W. Kernighan,
1071.Em Ar Advanced editing on UNIX
1072.Sh HISTORY
1073The
1074.Nm ed
1075command appeared in Version 6 AT&T UNIX.
1076.Sh DIAGNOSTICS
1077.Sq Li name
1078for inaccessible file;
1079.Sq Li ?self-explanatory message
1080for other errors.
1081.Pp
1082To protect against throwing away valuable work,
1083a
1084.Ic q
1085or
1086.Ic e
1087command is considered to be in error, unless a
1088.Ic w
1089has occurred since the last buffer change.
1090A second
1091.Ic q
1092or
1093.Ic e
1094will be obeyed regardless.
1095.Sh BUGS
1096The
1097.Ic l
1098command mishandles
1099.Li DEL .
1100.br
1101The
1102.Ic undo
1103command causes marks to be lost on affected lines.
1104.br
1105The
1106.Ic x
1107command,
1108.Fl x
1109option,
1110and
1111special treatment of hangups
1112only work on UNIX.
1113