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