home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / mutt / wscroll.mut < prev    next >
Text File  |  1988-03-01  |  1KB  |  42 lines

  1.   ;; wscroll.mut : horzontal window scrolling
  2.   ;; scroll-right, scroll-left
  3.   ;;   Manually scroll the current window horizontally.
  4.   ;;   Trys to keep the cursor on screen to prevent the update routines
  5.   ;;     from undoing the scroll.
  6.   ;; cursor-is-right, cursor-is-left
  7.   ;;   Shift the window so that the cursor is at the right or left
  8.   ;;     margin (if possible).
  9.   ;; C Durland
  10.  
  11. (defun
  12.   scroll-right
  13.   {
  14.     (int n)(n (window-ledge -1))
  15.     (if (== (- (current-column) n)(screen-width))
  16.     (previous-character))
  17.     (window-ledge -1 (if (> n 0)(- n 1)(0)))
  18.   }
  19.   scroll-left
  20.   {
  21.     (int n)(n (+ (window-ledge -1) 1))
  22.     (if (== (current-column) n)(next-character))
  23.     (window-ledge -1 n)
  24.   }
  25.   cursor-is-left
  26.   {
  27.     (int n)
  28.     (if (< (n (- (current-column) 2)) 0) (n 0))
  29.     (window-ledge -1 n)
  30.   }
  31.   cursor-is-right
  32.   {
  33.     (int n)
  34.     (n (- (current-column)(screen-width) -1))    ; screen column
  35.     (if (< n 0) (n 0))
  36.     (window-ledge -1 n)
  37.   }
  38. )
  39.  
  40. ;(bind-to-key "cursor-is-left" "^X<")
  41. ;(bind-to-key "cursor-is-right" "^X>")
  42.