home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 500s / rfc569.txt < prev    next >
Text File  |  1992-10-14  |  18KB  |  374 lines

  1. Network Working Group                                   Mike Padlipsky
  2. RFC 569/ NET-USING Memo 1                                    NET-USING
  3. NIC # 18972                                           October 15, 1973
  4.  
  5.  
  6.  
  7.              NETED: A Common Editor for the ARPA Network
  8.  
  9. BACKGROUND
  10.  
  11. At the recent Resource Sharing Workshop, there was a somewhat
  12. surprising degree of consensus on what I had anticipated would the
  13. least popular aspect of the my "Unified User-Level Protocol" proposal:
  14. A number of the attendees agreed without argument that it would be
  15. a good thing to have "the same" context editor available on all
  16. Servers -- where "the same" refers, of course, to the user interface.
  17. We even agreed that "NETED" seemed to be a plausible common name.  In
  18. view of the fact that the rest of the proposal didn't seem to capture
  19. anybody's imagination, though, it seemed to be a useful notion to
  20. separate out the common editor and make it the subject of a
  21. stand-alone proposal.
  22.  
  23. My resolve to come up with the following was further strengthened at
  24. the the organizing meeting of the Network User Interest Group, which
  25. followed the Workshop.  Being primarily concerned with user issues,
  26. this group was downright enthusiastic about the prospect of a common
  27. editor.  Indeed, this proposal has been reviewed by the group and is
  28. endorsed by it.
  29.  
  30. REASONS
  31.  
  32. The need for a common editor might well be obvious to many readers.
  33. They are encouraged to skip this section, which is for the benefit of
  34. those who don't already see the light.
  35.  
  36. In the first place, it's almost axiomatic that to use a time-sharing
  37. system, you have to be able to create files (/"datasets"/"segments").
  38. Even if you're only using the Network to send "mail", you'd still like
  39. to be able to create a file separately, so as to be able to edit it
  40. before sending.  And if you want to write a program -- or even make a
  41. "runoff" source file -- you simply must be able to use some editor
  42. command on the system at hand.
  43.  
  44. Unfortunately, there are even more editors than there are systems;
  45. and each one has it own conventions and peculiarities.  So "Network
  46. users" (who use several Servers, as opposed to those who use the
  47. Network only to access a particular system all the time) are faced
  48. with the unpleasant chore of developing several sets of incompatible
  49. reflexes if they want to get along.  This can certainly be done.  It
  50. has been by a number of members of the Network Working Group.
  51.  
  52.  
  53. NETED SPEC                                                        p.2
  54.  
  55. The real kicker, however, comes when we consider the needs of those
  56. users -- who are coming into the Network community in ever-increasing
  57. numbers -- who are not professional programmers.  They just want to
  58. get some work done, "on the Net" (that is, irrespective of which
  59. operating system they might be talking to).  They are likely to be
  60. appalled rather than amused by having to learn a dozen ways of getting
  61. to first base.  Therefore, it seems clear than not only do we need a
  62. common editor, but we also need a simple common editor.
  63.  
  64. CHOICES
  65.  
  66. Simplicity is not the only criterion for rejecting the apparently
  67. "obvious" choice of either TECO or QED.  (That it is a strong factor
  68. is indicated by the old test of "Consider explaining it to a naive
  69. secretary -- now consider explaining it to a corporation president.")
  70. Perhaps even worse is the problem of "dialects".  That is, features
  71. vary across implementations, and settling on a common set of features
  72. (or dialect) is likely to be a very hard task, for programmers tend to
  73. get very fond of their familiar goodies.  Besides, both TECO and QED
  74. have their own strong (/fanatic) advocates, who's probably never be
  75. willing to settle for the other one.  Further, not every system has
  76. both, and implementing the other is a fairly large job even if the NWG
  77. could agree on which (and how much).
  78.  
  79. At any rate, the difficulties seem overwhelming when it comes to
  80. choosing a high-powered editor as the common editor.  Therefore, I
  81. tried to think of a nice low-powered editor, and it suddenly occurred
  82. to me that I not only knew of one, but it was even fairly well
  83. documented (!).  The editor in question is known on Multics as "eds"
  84. (the same member of the "ed" family of editors which started on
  85. CTSS), a line-oriented context editor (no "regular expressions", but
  86. also no line numbers).  It is used as an extended example of
  87. programming in the Multics environment in Chapter 4 of the Multics
  88. Programmers' Manual, which gives an annotated PL/I listing of the
  89. actual working program.  It is simple to learn and should be quite
  90. easy to implement,  PL/I version serves as a detailed model with only
  91. equivalent system calls and choice of language to worry about.  I urge
  92. its adoption as the common Network editor, to be known on all
  93. participating Servers as "NETED" and/or "neted".
  94.  
  95. DOCUMENTATION
  96.  
  97. In view of the fact that if "eds"/NETED is adopted only perhaps a
  98. dozen members of the NWG will actually have to implement one, it seems
  99. wasteful to distributed some 30 pages of the MPM to everyone --
  100. especially since most of the parties concerned have access to an MPM
  101. already.  (Another problem solved by not including it here is that of
  102. whether I'd be violating copyright by doing so.)  The exact reference
  103. is pp. 24-54 of Chapter 4 of Part I of the Multics Programmer's
  104. Manual.
  105.  
  106.  
  107. NETED SPEC                                                        p. 3
  108.  
  109. Anybody who needs a copy can let me know.  Although the emphasis in
  110. the document is, naturally enough, on the Multics-specific aspects, I
  111. believe that the listing is clear enough to serve as a model to
  112. implementors without any great difficulty.  If we do get to the
  113. implementation stage, I'll be glad to try to explain any non-obvious
  114. system calls, either individually or in a follow-up memo.  But even
  115. though we "initiate" where you "open", or we " call los_$read_ptr"
  116. where you "IOT TTY" (or something), it shouldn't cause much trouble.
  117. For that matter, some implementers might prefer to ignore the existing
  118. program and simply work from the function specifications (below).
  119.  
  120. LIMITATIONS
  121.  
  122. It became abundantly clear during the course of the review of this
  123. document by the User Interest Group that the limitations of NETED must
  124. be acknowledged (even insisted upon) and explained here.  In the first
  125. place, it must be emphasized that it is not being proposed as "THE"
  126. Network editor.  Rather, it is an insistently simple-minded editor for
  127. two major reasons:  1) it is meant for use mainly by non-professional
  128. programmers, and 2) more important still, it is meant to be extremely
  129. easy to implement.  Therefore, it seems far more important to go with
  130. the published program, with all its warts, than to specify the
  131. addition of new, undebugged features.  The idea is to make it
  132. implementable in man-days by an average to average-plus programmer
  133. instead of in man-weeks by a superstar programmer.
  134.  
  135. In the second place, the very act of adding new features is fraught
  136. with peril.  To take some examples from the comments I received during
  137. the review phase:  In the first draft, I inadvertently failed to
  138. document the mechanism by which the ability to "go backwards" (i.e.,
  139. to reverse the direction of the current-line pointer described below)
  140. is actuated.  Several reviewers argued strongly for the inclusion of
  141. such a mechanism; but, not knowing it was already "in" the code I
  142. argued -- successfully -- for leaving it out, on the grounds that we
  143. should stick to what's in the existing code, which is known to work as
  144. published.  Even what to call such a new request would have been
  145. debatable -- should it be "-" and become the only non-alphabetic name?
  146. should it be "b" for "bottom"?  should "n" (for "next") become "+"?
  147. And so on.  Although this particular issue turned out be a false
  148. alarm, I've left it in to emphasize the sort of pitfalls we can get
  149. into by haggling over particular "features".  Another familiar feature
  150. is some sort of "read" request so that the file name need not be
  151. specified as an argument to the command.  Then, of course, one would
  152. also want a "create" or "make" request.  And perhaps a file delete
  153. request?  It keeps going on and on.  The point, I think, is that if we
  154. allow ourselves to go into "tinker mode" we could spend as many years
  155. striving to achieve consensus on what features to add as we've spent
  156. on Telnet or FTP ... and still not please everyone.  Therefore, I urge
  157. the NWG to accept the contention that having a working model to use as
  158.  
  159.  
  160.  
  161. NETED SPEC                                                     p. 4
  162.  
  163. a pattern is more  important than any particular additional features
  164. (even  though I myself find "=" for "what's the current line's
  165. number?" annoying to live without).
  166.  
  167. RESPONSES
  168.  
  169. For the benefit of those who don't want to plow through the functional
  170. spec, this seems to be a good spot to indicate what appropriate
  171. responses to this proposal would be.  Ideally, I'd like to hear from a
  172. responsible system programmer at, say, TENEX, CCN, UCSD, UCSB,
  173. AMES-67, one of the DEC 10/50 Hosts, and from any of the experimental
  174. Servers who happen to be interested, that they think it's a fine idea
  175. and why don't I log in next week to try their NETEDs.  Next most
  176. desirable would be agreement in principle followed by specific
  177. inquiries about "eds".  I would hope that haggling over specific
  178. features wouldn't occur (as we're not trying to do a definitive
  179. editor, just an easy, commonly implemented one based on an existing
  180. implementation), but unfortunately I can't legislate such haggles out
  181. of existence.  At the very least, I'd hope to either hear or see
  182. reasoned arguments why it's not worth doing.  As usual, phone, mail
  183. "mail" ("map.cn" in sndmsg, or "map cn" in "mail" on Multics) or RFC's
  184. are the assumed media for responding.
  185.  
  186. USAGE
  187.  
  188. (The following is intended to serve double-duty, as both a functional
  189. spec now and -- with the addition of some examples -- a "users'
  190. manual" later.  So if it seems to "tutorial", I'm sorry.  And if it
  191. doesn't seem tutorial enough -- assuming the addition of examples --
  192. please let me know.)
  193.  
  194. As is typical of "context editors," the NETED command is used both for
  195. creating new files and for altering already existing files -- where
  196. "files" are named collections of character encoded data in the storage
  197. hierarchy of a time-sharing system.  Consequently, NETED operates in
  198. two distinct "modes" -- called "input mode" and "edit mode".
  199.  
  200. When NETED is used to create a file (that is, when it is invoked from
  201. command level with an argument which specifies the name of a file
  202. which does not already exist in the user's "working directory"), it is
  203. automatically in input mode.  It will announce this fact by outputting
  204. a message along the lines of "File soandso not found.  Input."  Until
  205. you take explicit action to leave input mode, everything you type will
  206. go into the specified file.  (Actually, it goes into a "working copy"
  207. of the file, and into the real file only when you indicate a desire to
  208. have that happen.) To leave input mode, type a line consisting of only
  209. a period and the appropriate new-line character:  ".<NL>", where <NL>
  210. is whatever it takes to cause a Telnet New-Line to be generated from
  211. your terminal
  212.  
  213.  
  214.  
  215. NETED SPEC                                                        p. 5
  216.  
  217. After leaving input mode, you are in edit mode.  Here, you may issue
  218. various "requests" which will allow you to alter the contents of the
  219. (working) file, re-enter input mode if you wish, and eventually cause
  220. the file to be stored.  Note that edit mode is entered automatically
  221. if the argument you supplied to NETED specified an existing file.
  222. Regardless of how it was entered, being in edit mode is confirmed by
  223. NETED's outputting a message of the form "Edit".  Editing is performed
  224. relative to (conceptual) pointer which specifies the current line, and
  225. many requests pertain to either moving the pointer or changing the
  226. contents of the current line.  (When edit mode is entered from input
  227. mode, the pointer is at the last line input; when entered from command
  228. level, the pointer is at the "top" of the file.)
  229.  
  230. NETED's edit mode requests follow, in order intended to be helpful.
  231. Two important reminders:  the requests may only be issued from edit
  232. mode, and each one "is a line" (i.e., terminates in a new line /
  233. carriage return / linefeed is appropriate to the User Telnet being
  234. employed).  SYNTAX NOTE:  If the request takes an argument, there must
  235. be at least one space (blank) between request's name and the argument.
  236.  
  237. 1.  n m
  238.  
  239. For unsigned m, the n(ext) request causes the pointer to be moved
  240. "down" m lines.  If m is negative, the pointer is moved "up" m lines.
  241. If m is not specified, the pointer is moved one line.  If the end of
  242. the file is reached, an "End of file reached by n m" message is output
  243. by NETED; the pointer is left "after" the last line.
  244.  
  245. 2.  l string
  246.  
  247. The l(ocate) request causes the pointer to be moved to the net line
  248. containing the character string "string" (which may contain blanks);
  249. the line is output.  If no match is found, a message of the form "End
  250. of file reached by l string" will be output (and the pointer will
  251. have returned to the top of the file).  The search will not wrap
  252. around the end of the file; however, if the string was above the
  253. starting position of the pointer, a repetition of the locate request
  254. will find it, in view of the fact that the pointer would have been
  255. moved to the top of the file.  To find any occurrence of the string --
  256. rather than the next occurrence -- it is necessary to move the pointer
  257. to the top of the file before doing the locate (see following
  258. request).
  259.  
  260. 3.  t
  261.  
  262. Move the pointer to the top of the file.
  263.  
  264.  
  265.  
  266. NETED SPEC                                                       p. 6
  267.  
  268. 4.  b
  269.  
  270. Move the pointer to the bottom of the file and enter input mode.
  271.  
  272. 5.  "."
  273.  
  274. Leave the pointer where it is and enter input mode.  (First new line
  275. goes after current old line.)
  276.  
  277. 6.  i string
  278.  
  279. The i(nsert) request cause a line consisting of string (which will
  280. probably contain blanks) to be inserted after the current line.  The
  281. pointer is moved to the new line.  Edit mode is not left.
  282.  
  283. 7.  r string
  284.  
  285. The r(eplace) request causes a line consisting of string (probably
  286. containing blanks) to replace the current line.
  287.  
  288. 8.  p m
  289.  
  290. The p(rint) request causes the current line and the succeeding m - i
  291. lines to be output.  If m is not specified, only the current line will
  292. be output.  End of file considerations are the same as with "n".
  293.  
  294. 9.  c /s1/s2/ m g
  295.  
  296. The c(hange) request is quite powerful, although perhaps a bit complex
  297. to new users.  In the line being pointed at, the string of characters
  298. s1 is replaced by the string of characters s2.  If s1 is void, s2 will
  299. be inserted at the beginning of the line; if s2 is void, s1 will be
  300. deleted from the line.  Any character not appearing within either
  301. character string may be used in place of the slash (/) as a delimiter.
  302. If a number, m, is present, the request will affect m lines, starting
  303. with the one being pointed at.  All lines in which a change was made
  304. are printed.  The pointer is left at the last line scanned.  If the
  305. letter "g" is absent (after the final delimiter) only the first
  306. occurrence of s1 within a line will be changed.  If "g" (for "global")
  307. is present, all occurrences of s1 within a line will be changed.  (If
  308. s1 is void, "g" has no effect.)  NOTE WELL:  blanks in both strings
  309. are significant and must be counted exactly.  End of file
  310. considerations are the same as with "n".
  311.  
  312. 10.  d m
  313.  
  314. The d(elete) request causes m lines, including the current one, to be
  315. deleted from the working copy of the file.  If m is not specified, only
  316. the current line is deleted.  The pointer is left at a null line above
  317. the first undeleted line.  End of file considerations are the same as
  318. with "n".
  319.  
  320.  
  321.  
  322. NETED                                                           p. 7
  323.  
  324. 11.  w
  325.  
  326. Write out the working copy into the storage hierarchy but remain in
  327. NETED.  (Useful for those who fear crashes and don't want to lose all
  328. the work performed.)
  329.  
  330. 12.  save
  331.  
  332. Write out the working copy into the storage hierarchy and exit from
  333. NETED.
  334.  
  335. Additional specs:
  336.  
  337. a.  On Multics, type-ahead is permitted.  This approach is recommended
  338. for all versions of NETED, but is of course not required as various
  339. Servers' NCP Implementations may prohibit it; however:
  340.  
  341. b.  If an error is detected, the offending line is output, and pending
  342. typeahead (if any) must be discarded (to guard against the possibility
  343. of the pending request's being predicated on the success of erroneous
  344. request).
  345.  
  346. c.  The command is not reinvokable, in the sense that work is lost if
  347. you "quit" out of it via the Telnet Interrupt Process command or its
  348. equivalent; indeed, quitting out is the general method of negating
  349. large amounts of incorrect work and retaining the original file
  350. intact.
  351.  
  352. (When the time comes, I'll be glad to furnish examples for the users'
  353. manual version; but for now, that's all there is.)
  354.  
  355. NOTE
  356.  
  357. It really does work, unsophisticated though it may be.  I think that
  358. it's sufficient to get new users going, and necessary to give them a
  359. fighting chance.  It would even be of utility within the NWG, for
  360. those of us who don't like having to learn new editors all the time.
  361. If anybody wants to try it, I'll make a version available to
  362. "anonymous users" (see the Multics section in the Resource Notebook if
  363. you don't already know how to get in our sampling account), under the
  364. name "neted".  (*) (If you do try it, please delete files when done
  365. with them.)
  366.  
  367.  
  368. ______________
  369.  
  370. (*)  Knowledgeable Multics users with their own accounts can instead
  371. link to >udd>cn>map>neted.  It is also there under the names "eds" if
  372. you want to save typing a couple of characters.
  373.  
  374.