home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / k / ksh48.zip / ReadMe.sjg < prev    next >
Text File  |  1992-02-06  |  3KB  |  89 lines

  1. HORIZONTAL SCROLLING
  2. ====================
  3.  
  4. I have migrated my 3.2 ksh edit.c mods into the 3.3 ksh
  5. This file describes the mods in general and really only applies
  6. (at this stage) to emacs-mode.  I have not touched vi-mode apart
  7. from making it use pprompt() so that '!' is correctly expanded
  8. as in emacs-mode.
  9.  
  10. I would prefer to see both vi.c and emacs.c use a common set of
  11. primatives in edit.c - but that looks like a lot of work.
  12.  
  13. Basically my mods affect the functions that move the cursor
  14. about and redraw the edit line.
  15.  
  16. The input buffer "buf" is pointed to by "xbuf" and its end is
  17. pointed to by "xend".  The current position in "xbuf" and end of
  18. the edit line are pointed to by "xcp" and "xep" respectively.
  19. I have added "xbp" which points to the start of a display window
  20. within "xbuf".
  21.  
  22. [A] starting position
  23.  
  24. buf
  25. |<-------- $COLUMNS --------->|
  26. |    |<---- x_displen ------->|
  27. | PS1|
  28.      +==========+==============--------+.......+
  29.      |\          \                      \       \
  30.   xbuf xbp        xcp                    xep     xend
  31.  
  32. [B] scrolled
  33.  
  34. buf
  35. |           |<----- COLUMNS -------->|
  36. |           |<----- x_displen ------>|
  37. |
  38. +-----------+==========+==============--------+.......+
  39.  \           \          \                      \       \
  40.   xbuf        xbp        xcp                    xep     xend
  41.  
  42. In the above -------- represents the current edit line while
  43. ===== represents that portion which is visible on the screen.
  44. Note that initially xbp == xbuf and PS1 is displayed.
  45. PS1 uses some of the screen width and thus "x_displen" is less
  46. than $COLUMNS.
  47.  
  48. Any time that "xcp" moves outside the region bounded by "xbp"
  49. and "xbp" + "x_displen", the function x_adjust() is called to
  50. relocate "xbp" appropriately and redraw the line.
  51.  
  52. Excessive I/O is avoided where possible.  x_goto() for instance
  53. calculates whether the destination is outside the visible
  54. region, and if so simply adjusts "xcp" and calls x_adjust()
  55. directly.  Normally though x_adjust() is called from x_putc().
  56.  
  57. The above mechanism has be updated to use a function x_lastcp()
  58. that returns a pointer that accurately  reflects the last
  59. visible char in the edit buffer.  That is a more accurate
  60. version of xbp + x_displen which does not account for TABS.
  61.  
  62. Other changes
  63. =============
  64.  
  65. I have also added some emacs mode functions.
  66. M-[0-9]
  67.     Set a numeric arg (positive only).
  68.     Used by all word related commands.
  69. M-_
  70. M-.
  71.     Retrieve word from previous command (default is last
  72.     word).  Use M-[1-9] to select word.
  73. M-u
  74. M-l
  75. M-c
  76.     UPPER,lower,Capitalize word.
  77.  
  78.  
  79. Commands like delete-word now push the deleted text so that it
  80. may be yanked back into place.
  81.  
  82. BUGS?
  83. =====
  84.  
  85. There are bound to be some.  Please report same to me:
  86.  
  87. Simon J. Gerraty    <sjg@zen.void.oz.au>
  88.  
  89.