home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MISC / TNH_PC.ZIP / ALBERT.NL next >
Encoding:
Text File  |  1987-01-14  |  10.1 KB  |  317 lines

  1. Personal Editor
  2.  
  3.               Jim Albert
  4.       Endicott Owego User Group
  5.  
  6. Personal Editor (PE) is both my
  7. absolute favorite piece of PC
  8. software, and my all-time favorite
  9. text editor.  (I am including
  10. mainframe editors in the comparison,
  11. so I hope this endorsement will not
  12. be taken lightly.)
  13.  
  14. On to the review, then.
  15.  
  16. Personal Editor is a full-screen
  17. text editor for the PC.  For those
  18. of you who don't know, 'full screen'
  19. means that the editor provides a
  20. `window' into the file within which
  21. the cursor may be freely moved and
  22. changes made just like writing on
  23. paper.  The alternative, a 'line
  24. editor' (like EDLIN) limits the user
  25. to a sequence of commands affecting
  26. individual lines of the file.  The
  27. term 'text editor' means that it is
  28. designed to produce straightforward
  29. files of characters rather than
  30. finished documents.  The latter type
  31. of editors are usually called 'word
  32. processors' (like EasyWriter).
  33. Personal Editor is suitable for a
  34. variety of tasks including
  35. programming, preparation of network
  36. messages, and simple database
  37. operations, but must be combined
  38. with a 'text formatter' like
  39. SCRIPT/PC.
  40.  
  41. Two additional characterizations
  42. must be made to put Personal Editor
  43. into its proper category before
  44. getting down to particulars: First,
  45. it is a 'keystroke oriented' rather
  46. than a 'command oriented' editor.
  47. This means that in most cases
  48. operations are performed by striking
  49. special keys - vector or function
  50. keys, or 'ordinary' keys modified by
  51. ALT or CTRL - rather than typing a
  52. 'command' composed of regular
  53. characters on a special part of the
  54. screen. XEDIT, EDGAR, and ESPF are
  55. all 'command' editors.
  56.  
  57. Second, it is what I refer to as a
  58. 'two-dimensional' rather than a
  59. 'one-dimensional' editor.  Like
  60. XEDIT on VM/SP, Personal Editor's
  61. view of files is that they are
  62. two-dimensional arrays of
  63. characters, so many per record
  64. 'across'  and multiple records
  65. 'down'.  (I suspect this view of
  66. files derives from punch-card
  67. technology). What this means to the
  68. user is that 'unused' space on the
  69. screen is potentially useable - like
  70. blank paper - and that the CRs at
  71. the end of records are invisible
  72. implementation details ('return' is
  73. viewed as a cursor movement key).
  74. Many non-IBM editors, on the other
  75. hand, take an essentially
  76. one-dimensional view of a file;
  77. i.e., the file is viewed as one long
  78. string of characters, punctuated
  79. here and there with very real CRs.
  80. Such editors follow the convention
  81. of starting a new screen line every
  82. time they encounter one of these,
  83. but they don't really have a concept
  84. of a file being a sequence of
  85. records.  (I suspect that this view
  86. of all things derives primarily from
  87. telegraph technology.)  To the user
  88. of such editors, this means that
  89. blank space on the screen may be
  90. 'outside' the file and you can't
  91. move the cursor there at all.  The
  92. 'return' key, on the other hand,
  93. actually enters a CR into the file
  94. (effectively 'splitting' a line).
  95. CRs can be erased, as well.
  96.  
  97. The next characteristic I would like
  98. to mention is, as far as I am aware,
  99. unique to Personal Editor: The
  100. mapping of editing 'functions' onto
  101. keys (or key combinations) is
  102. entirely user-controllable.  For
  103. example, the left-arrow key moves
  104. the cursor 1 character left - but
  105. only because the default profile
  106. relates the key 'left' with the
  107. function named '[left]'.  The user
  108. can in principle change this
  109. mapping.  There is, of course, a
  110. reasonable set of defaults provided
  111. - which leads to a useful
  112. digression: One of the first things
  113. I tried was a re-mapping of the
  114. keyboard to suit my fancy: for
  115. example, 'Ctrl-PgUp' makes more
  116. sense to me as a way of getting to
  117. the top of the file than the default
  118. 'Ctrl-Home'.
  119.  
  120. One of the nicest things about
  121. Personal Editor is that it is fast,
  122. response time on all trivial
  123. operations is undetectable.
  124. Personal Editor is also very natural
  125. to use, although some learning is
  126. involved before you remember which
  127. key does what.  As noted before,
  128. there are no 'surprises' associated
  129. with the behavior of the 'return'
  130. key or blank space.
  131.  
  132. Personal Editor also has a 'serious'
  133. level of capacity.  On a 128K
  134. machine it has 68660 bytes available
  135. in main store - and it can handle
  136. bigger files than that by creating a
  137. 'spill file' on diskette.  Proof of
  138. the pudding?  Would you believe I
  139. use PE to edit a Newsletter, with
  140. everything except inserts and the
  141. Library list in at once? Most of the
  142. 'big editor' features are present -
  143. HELP, split and join lines, locate,
  144. global and local changes, repeat
  145. execution of commands, editing up to
  146. 20 files at once, etc.  No, it can't
  147. do everything - no SORT, for example
  148. - but there are some nice features
  149. you may not have seen before, like
  150. 'undelete' and paragraph reflow.
  151.  
  152. One group of features is worth at
  153. least a paragraph on its own - the
  154. block moves.  There are three ways
  155. of 'marking' an area of text: 'line'
  156. marks a group of lines, 'character'
  157. marks a string of characters,
  158. possibly spread over multiple lines,
  159. and 'block' marks a rectangular area
  160. by indicating two opposite corners.
  161. In each case, the area marked is
  162. clearly indicated by displaying it
  163. in reverse video.  Having marked an
  164. area, it is then possible to operate
  165. on it - you can move it, copy it,
  166. clear it to blanks (or whatever you
  167. like), delete it entirely, or shift
  168. it right or left.  The block marks
  169. are something else again - but
  170. terrific for moving columns of stuff
  171. around, table manipulation, and the
  172. like.  Except for move and delete,
  173. the area remains marked until
  174. explicitly unmarked, so it is
  175. possible for example to make
  176. multiple copies of an area.  A final
  177. note on blocks - unlike the prefix
  178. operators in XEDIT they do work
  179. between multiple simultaneous files,
  180. resulting in by far the nicest
  181. approach to 'getfile' and 'putfile'
  182. operations I have encountered.  To
  183. include a piece of another file in
  184. the one you are editing, there is no
  185. line counting involved - edit both
  186. files, line-mark the area you want,
  187. and block-copy it into the target
  188. file.  To extract a piece of a file,
  189. you just edit a nonexistent file and
  190. move or copy into it.
  191.  
  192. Now -  back to those re-definable
  193. keys.  There are three ways to do
  194. it: You can just issue a command,
  195. for example
  196.  
  197.   def left = [right]
  198.  
  199. would cause the left-arrow key to
  200. move the cursor right.  More
  201. usefully,
  202.  
  203. def s-f7 = [shift left][shift left]
  204.            [shift left][shift left]
  205.  
  206. would change the standard key for a
  207. left block shift (shift-F7) to do
  208. its thing four characters at a crack
  209. instead of one - possibly a very
  210. attractive modification for a Pascal
  211. or C programmer, who could use it to
  212. re-align blocks of indented code
  213. after moving them.  However, this
  214. would only last for the duration of
  215. the session, and next time you'd
  216. have to type the whole dreary mess
  217. in again.  Well, if you are very
  218. sure that you want to make the
  219. change both permanently and for all
  220. environments, you could just modify
  221. the profile dataset that contains
  222. the default key definitions, PE.PRO.
  223. (Excuse me, someone in the back row
  224. wants to know if there is also a
  225. 'PE.KEY' file.  Strange question -
  226. but the answer is no, there isn't.)
  227. If you aren't convinced that you
  228. want to modify PE.PRO, or if you
  229. have different reassignments in mind
  230. for different environments, the
  231. third method is what I would really
  232. recommend: You can build a file of
  233. definition commands with some other
  234. name, and invoke it after you enter
  235. the edit session with the MACRO
  236. command.  (Incidentally, there is a
  237. command area for things that have to
  238. be typed out, like definitions and
  239. global changes.  You get there and
  240. back with the Esc key.)  A couple of
  241. examples I use: for GML operations,
  242. I have Alt-1, Alt-2, and Alt-3 set
  243. up to enter 'highlighted phrase'
  244. tags.  For example, Alt-2 enters '
  245. on the line, leaving it with the
  246. cursor under the second colon and
  247. the editor in insert mode.  I do
  248. something similar for comments in C
  249. - very handy and you can't forget to
  250. close the comment!  On a somewhat
  251. fancier scale, I have a 'paired
  252. brackets' macro for C which enters a
  253. left bracket, drops down a line,
  254. indents two spaces, enters a right
  255. bracket, inserts a blank line above,
  256. and leaves the cursor properly
  257. indented.  Even this isn't quite as
  258. fancy as you can get - the standard
  259. key assignment to turn on 'input
  260. mode' actually redefines the
  261. 'return' to incorporate the
  262. operations of adding a blank line
  263. and matching the indent above.
  264.  
  265. OK, you say, sounds pretty good.  Is
  266. there anything about this editor you
  267. don't like?  Sure.  Top of the list
  268. has to do with tab characters -
  269. assuming the ANSI standard of a tab
  270. stop every 8 spaces - to save space.
  271. Not a bad idea if you are going to a
  272. compiler, but a lot of things tend
  273. to gag on the tab characters.  The
  274. compression can be overridden, but
  275. since it is the last operand in the
  276. command, it is only at the expense
  277. of typing the name of the file each
  278. time you do a file.  A second
  279. problem which doesn't strike
  280. everyday is that when you have
  281. overflowed to a 'spill file' things
  282. sometimes get very slow.  In
  283. particular, a 'file' or a 'save'
  284. from a spill file is a
  285. get-up-and-walk-around proposition.
  286. Finally, it is worth noting that the
  287. key definition macro facility has
  288. all of its sophistication invested
  289. in high-powered functions (like
  290. 'move the cursor under the first
  291. non-blank character of the line
  292. above') and has no looping, testing,
  293. or parameter passing capability.
  294. (If it did, it would be possible to
  295. redefine a key to fix problem #1.)
  296. All in all, I'm not complaining.
  297.  
  298. On to the bottom line, then:  Should
  299. you or shouldn't you?  I think you
  300. should!  Anyone who ventures beyond
  301. the fringes of BASIC and VisiCalc,
  302. whether it be to program in
  303. Assembler, Pascal, or C, to edit BAT
  304. files or keep lists of things, to
  305. format electronic mail (which needs
  306. paragraph reflow but not
  307. pagination), or wants to do
  308. correspondence or documentation
  309. using a text formatter will find
  310. Personal Editor a friendly and
  311. powerful workhorse. I have seen no
  312. other editor for the PC which would
  313. make me even take a second look.  I
  314. recommend you check out Personal
  315. Editor and get your DOS a 'right
  316. hand man'.
  317.