Merge from vendor branch LIBSTDC++:
[dragonfly.git] / contrib / nvi / docs / internals / autowrite
1 #       @(#)autowrite   8.3 (Berkeley) 2/17/95
2
3 Vi autowrite behavior, the fields with *'s are "don't cares".
4
5 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 Commands that are affected only by autowrite:
7
8 Command File            Autowrite?      Action:
9         modified?
10 -----------------------------------------------
11 ^Z      Y               Y               Write file and suspend.
12 ^Z      Y               N               Suspend.
13 ^Z      N               *               Suspend.
14
15 # This behavior is NOT identical to :edit.
16 ^^      Y               Y               Write file and jump.
17 ^^      Y               N               Error.
18 ^^      N               *               Jump.
19
20 # The new nvi command ^T (:tagpop) behaves identically to ^].
21 # This behavior is identical to :tag, :tagpop, and :tagpush with
22 # force always set to N.
23 ^]      Y               Y               Write file and jump.
24 ^]      Y               N               Error.
25 ^]      N               *               Jump.
26
27 # There's no way to specify a force flag to the '!' command.
28 :!      Y               Y               Write file and execute.
29 :!      Y               N               Warn (if warn option) and execute.
30 :!      N               *               Execute.
31
32 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
33 Commands that are affected by both autowrite and force:
34
35 NOTE: the "force" flag is never passed on, i.e. the write
36 to the file caused by the autowrite flag is never forced.
37
38 Command File            Autowrite?      Force?  Action:
39         modified?                       (!)
40 -------------------------------------------------------
41 # The first rule (YYY) is historic practice, but seems wrong.
42 # In nvi, :next and :prev commands behave identically to :rewind.
43 :next   Y               Y               Y       Write changes and jump.
44 :next   Y               Y               N       Write changes and jump.
45 :next   Y               N               Y       Abandon changes and jump.
46 :next   Y               N               N       Error.
47 :next   N               *               *       Jump.
48
49 :rewind Y               Y               Y       Abandon changes and jump.
50 :rewind Y               Y               N       Write changes and jump.
51 :rewind Y               N               Y       Abandon changes and jump.
52 :rewind Y               N               N       Error.
53 :rewind N               *               *       Jump.
54
55 # The new nvi commands, :tagpop and :tagtop, behave identically to :tag.
56 # Note, this behavior is the same as :rewind and friends, as well.
57 :tag    Y               Y               Y       Abandon changes and jump.
58 :tag    Y               Y               N       Write changes and jump.
59 :tag    Y               N               Y       Abandon changes and jump.
60 :tag    Y               N               N       Error.
61 :tag    N               *               *       Jump.
62
63 # The command :suspend behaves identically to :stop.
64 :stop   Y               Y               Y       Suspend.
65 :stop   Y               Y               N       Write changes and suspend.
66 :stop   Y               N               Y       Suspend.
67 :stop   Y               N               N       Suspend.
68 :stop   N               *               *       Suspend.
69
70 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
71 Commands that might be affected by autowrite, but aren't:
72
73 Command File            Autowrite?      Force?  Action:
74         modified?                       (!)
75 -------------------------------------------------------
76 #:ex, and :vi (executed while in vi mode) behave identically to :edit.
77 :edit   Y               *               Y       Abandon changes and jump.
78 :edit   Y               *               N       Error.
79 :edit   N               *               *       Jump.
80
81 :quit   Y               *               Y       Quit.
82 :quit   Y               *               N       Error.
83 :quit   N               *               *       Quit.
84
85 :shell  *               *               *       Execute shell.
86
87 :xit    Y               *               *       Write changes and exit.
88 :xit    N               *               *       Exit.