home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / info / histshel.not < prev    next >
Encoding:
Text File  |  1994-09-02  |  7.9 KB  |  185 lines

  1. This is an extract of a wish list I sent Rob Friefeld a few weeks 
  2. ago.  Rob is working on a new ZCPR3 history shell that will be 
  3. full-screen, so one will (optionally) be able to not only recall 
  4. but actually see at a glance the last, say, 23 or so commands 
  5. issued and then move to the cursor to the one desired for 
  6. execution.  When I heard he was working on such a program I was 
  7. reminded of a feature I had long wanted to see in a command 
  8. shell.  I wrote him a note detailing my wish, thinking however 
  9. that it was too far out and sophisticated to be done on our 8-bit 
  10. machines.  He responded, unbelievably, that he feels it could be 
  11. done in about 100-150 bytes.  He was, however, concerned about 
  12. code size and was interested to know how valuable such a feature 
  13. would be for others, and requested I make this note public for 
  14. the purpose of soliciting comment from other history-shell users. 
  15. I herewith do so.  Please note that I believe the implementation 
  16. of such a feature would be an extraordinary advance for ZCPR3.  
  17. Your comments are very strongly solicited; I will forward them to 
  18. Rob.
  19.  
  20.                                          - Rick Charnes
  21.                                          January 1, 1989
  22.  
  23. [...]
  24.  
  25. (3) This is the trickiest.  I'm sure you're going to say it's 
  26. impossible.  But I'm hoping you're like a Marine for whom "the 
  27. difficult we do immediately, the impossible takes a little 
  28. longer."
  29.  
  30. In my use of ZCPR3 I have settled into a regular and consistent 
  31. pattern of issuing multiple commands, separated by a semicolon, 
  32. from the command line.  It is silly to limit the use of our 
  33. wonderful MCL buffer to aliases and the like; it is fairly easy 
  34. for me to anticipate my next 1 or 2 or 3 moves.  Just now I was 
  35. about to issue a multiple command and I was frustrated at my 
  36. inability to do something that has bothered me for quite a while 
  37. and I thought that this time I'd at least describe it to someone. 
  38. I'm sure it's a fairly regular and common thing, but I've never 
  39. heard anyone bring it up for public discussion.
  40.  
  41. All I was doing was renaming a file, then loading it up for 
  42. editing with VDE:
  43.  
  44. RENAME DAY.CMD TODAY.CMD;VDE TODAY.CMD
  45.  
  46. OK.  ** I'M TIRED OF HAVING TO TYPE THAT SECOND 'TODAY.CMD'.  ***
  47.  
  48. There are of course a number of ways one can deal with this and 
  49. keep the string of characters 'TODAY.CMD' somewhere in memory or a 
  50. disk file or on the shell stack, so that you don't need to retype 
  51. it.  You can make an alias (I actually wrote and released one 
  52. probably two years ago, called RCOM, short for Repeat COMmand).  
  53. You can use, as I often do, Dreas Nielsen's FOR.COM and 
  54. PERFORM.COM, that I guess respectively store it on and then 
  55. access it from the shell stack:
  56.  
  57.          FOR TODAY.CMD;PERFORM RENAME DAY.CMD $X$|VDE $X
  58.  
  59. (The '$X' 'holds' the name of the 'FOR'-ed string and the '$|' is 
  60. PERFORM.COM's substitute command separator)
  61.  
  62. Etc., etc.  But the worst problem with the above approaches is 
  63. not even that they involve an extra step and command and some 
  64. consequent and inevitable slowness due to extra disk access 
  65. (which I wouldn't mind that much and would accept as the price to 
  66. pay for the feature), but that THEY REQUIRE YOU TO KNOW BEFORE 
  67. YOU START TYPING YOUR FIRST COMMAND THAT YOU *ARE* GOING TO LATER 
  68. DO SOME SORT OF ITERATION.  
  69.  
  70. Generally I don't.  It just hit me AFTER I'd typed
  71.  
  72.                     RENAME DAY.CMD TODAY.CMD
  73.  
  74. that I was next going to enter:
  75.  
  76.                           VDE TODAY.CMD
  77.  
  78. If I'd decided *beforehand* I could have used FOR and PERFORM, 
  79. though these programs of Dreas' that access the named shell 
  80. variables are sometimes noted for their slowness.  Or with my 
  81. RCOM alias which takes as its first parameter the file that is 
  82. going to be repeated and the second as a token to one of the 
  83. command verbs I could have done:
  84.  
  85. RCOM TODAY.CMD DAY.CMD RENAME VDE
  86.  
  87. But the point is that THIS ALL ACTS AS A DRAG TO ONE'S 
  88. SPONTANEITY IN USING THE COMPUTER.
  89.  
  90. So, I was thinking: how could a command editor/history shell play 
  91. a role in this?  We have been quite adept at packing these 
  92. programs with a good number of nifty features.  Any chance this 
  93. kind of thing could be added?  Some scheme whereby the program 
  94. AUTOMATICALLY, AS THE USER IS TYPING, "records" the keystrokes 
  95. (I guess it would have to be to memory, rather than a disk file) 
  96. and allows him to access these very same keystrokes later IN THE 
  97. SAME COMMAND LINE?
  98.  
  99. If it would have to take up TPA -- and I imagine it would since 
  100. we cannot have yet opened up a file since we haven't yet hit <CR> 
  101. -- I for one would be willing to sacrifice a k or two for this 
  102. feature.  
  103.  
  104. I am reminded of a program that was floating about a year or two 
  105. ago called ZX.  It was written by a fellow named Mike Yarus of 
  106. Boulder, Colorado in January 1986.  It's not a ZCPR program (the 
  107. Z' stands for horiZontal sort because that's how it does its 
  108. directory function, but rather an all-purpose CP/M 
  109. directory/copy/erase/rename utility.  It's one of those many 
  110. actors that have come and go on the great CP/M utility stage.  
  111. It had a really nifty feature, though, that I've never seen 
  112. duplicated anywhere since: "filename memory," in which recently 
  113. used filenames can be re-entered with a single keystroke during 
  114. later operations.  A '1' represents the first parameter of the 
  115. previous operation, a '2' the second.  So if the user first 
  116. entered:
  117.  
  118. ZX JOE.LTR JOSEPH.LTR R   ; the 'r' parameter is for R)ename
  119.  
  120. then 
  121.  
  122. ZX 2 SECOND.FIL C         ; the 'c' is for C)opy
  123.  
  124. would then rename JOSEPH.LTR to SECOND.FIL
  125.  
  126. I never really used it much -- never did like the horiZontal 
  127. sort -- but I always liked the "filename memory" idea.  In the 
  128. documentation Mike mentions "The stored filenames are kept in a 
  129. seldom-used place.  But they are in memory, of course..."
  130.  
  131. Of course what I'm suggesting for the command editor/history 
  132. shell would be different and probably harder to do, since I'm 
  133. talking about writing stuff to memory even before the user hits 
  134. the carriage return and the command processor is invoked.  But 
  135. ideally I would like, in my example above which started me on 
  136. this whole thing, to be able to enter something like:
  137.  
  138. RENAME DAY.CMD TODAY.CMD;VDE 3
  139.  
  140. where the 3 would represent the 3rd token on the command line, so 
  141. it would translate into 'VDE TODAY.CMD'.  Or $3, or something 
  142. like that, if we were worried about files named '3'.  Nice would 
  143. be defining tokens as anything separated by EITHER a semicolon OR 
  144. a space, so that:
  145.  
  146. VDE LOVE.LTR;RENAME PROG.ASM PROG.Z80;VDE 5
  147.  
  148. would call up VDE to edit PROG.Z80. 
  149.  
  150. Or, of course:
  151.  
  152. VDE LOVE.LTR;RENAME PROG.ASM PROG.Z80;1 5
  153.  
  154. would do the same thing.
  155.  
  156. This is all off the top of my head and I have no idea if this 
  157. kind of instant 'character recording' and playback is possible on 
  158. our humble machines.  2k TPA?  3k TPA?  50k?  Shell stack?  I 
  159. don't know.
  160.  
  161. Dreas Nielsen works always within the SH.COM shell (he never 
  162. bothered with the low-grade history shells such as HSH and EASE), 
  163. wherein if LOVE.LTR is already and previously assigned (inside 
  164. SH.VAR) to the shell variable 'L', for instance, then:
  165.  
  166. RENAME LIKE.LTR %L;VDE %L
  167.  
  168. entered at the command line already works turns into:
  169.  
  170. RENAME LIKE.LTR LOVE.LTR;VDE LOVE.LTR
  171.  
  172. As I point out in my upcoming TCJ article, running inside SH.COM 
  173. is like having RESOLVE.COM permanently running without it being 
  174. there at all.  But this of course requires forethought and 
  175. planning: LOVE.LTR must have already been previously stored as a 
  176. shell variable to the SH.VAR file.  My idea is to have the 
  177. recording done as the user types...
  178.  
  179. Well, I've just been doing a lot of work with named shell 
  180. variables and they're on my mind.  They're probably not 
  181. appropriate to this job at all; the concept and syntax just got 
  182. me thinking.
  183.  
  184. Semper fidelis.
  185.