home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / tiexplorer.zip / vtcurs.lsp < prev   
Lisp/Scheme  |  1986-09-22  |  4KB  |  88 lines

  1.  
  2. ;;; -*- Mode: Lisp; Package: User; Base: 10.; Patch-File: T -*-
  3.  
  4. ;;;                           RESTRICTED RIGHTS LEGEND
  5.  
  6. ;;;Use, duplication, or disclosure by the Government is subject to
  7. ;;;restrictions as set forth in subdivision (b)(3)(ii) of the Rights in
  8. ;;;Technical Data and Computer Software clause at 52.227-7013.
  9. ;;;
  10. ;;;                     TEXAS INSTRUMENTS INCORPORATED.
  11. ;;;                              P.O. BOX 2909
  12. ;;;                           AUSTIN, TEXAS 78769
  13. ;;;                                 MS 2151
  14. ;;;
  15. ;;; Copyright (c) 1986, Texas Instruments Incorporated.  All rights reserved.
  16.  
  17. ;;; Written 5/16/86 10:34:33 by FORD,
  18. ;;; Reason: Fix (:METHOD VT100-ESCAPE-SEQUENCE-MIXIN :PROCESS-ESCAPE-BRACKET-NUMERIC-NUMERIC-SEMICOLON-SEQUENCE)
  19. ;;; to properly process the second leading zero in escape sequences like 01H.
  20. ;;; while running on B from band LOD2
  21. ;;; with System 2.44, Compiler 2.5, File System 2.1, Universal Command Loop 2.0, Window System 2.5, Input Editor 2.0, ZMACS 2.5, Error Handler 2.0, Suggestions 2.1, Debug Utilities 2.7, Explorer-Net 2.6, Telnet 2.2, Vt100 2.0, File Server 2.0, Net-Config 2.2, Font Editor 2.2, Mailer 2.4, Mail-Reader 2.4, Streamer-Tape 2.7, Local-File 2.15, System-Log 2.2, Serial-Parallel 2.8, Printer 2.0, Glossary 2.0, IMAGEN 2.1, NVRAM 2.3, User Profile Utility 2.1, IP 1.15, Experimental Code Management Interface 2.22, Experimental Explorer Bug System 20.0, microcode 287, FAN23-MCR287-AUS.
  22.  
  23.  
  24.  
  25. #!Z
  26. ; From file PROCESS-ESCAPE-SEQUENCE.LISP#> VT100; A:
  27. #10R TELNET#:
  28. (COMPILER-LET ((PACKAGE (PKG-FIND-PACKAGE "TELNET"))
  29.                          (SI:LISP-MODE :ZETALISP)
  30.                          (*READTABLE* SI:STANDARD-READTABLE)
  31.                          (SI:*READER-SYMBOL-SUBSTITUTIONS* NIL))
  32.   (COMPILER#:PATCH-SOURCE-FILE "SYS: VT100; PROCESS-ESCAPE-SEQUENCE.#"
  33.  
  34.  
  35. (DEFMETHOD (vt100-escape-sequence-mixin
  36.          :PROCESS-ESCAPE-BRACKET-NUMERIC-NUMERIC-SEMICOLON-SEQUENCE) (ch)
  37.   (cond ((= ch #/r)               ; ESC [ num num ; num num r
  38.      (setq scroll-ending-line       ; Scrolling regions
  39.            (min ending-line (tv:sheet-number-of-inside-lines vt100-pane)))
  40.      (setq scroll-starting-line starting-line-completed-value)
  41.      (if (= scroll-ending-line 0)
  42.          (setq scroll-ending-line (tv:sheet-number-of-inside-lines vt100-pane)))
  43.      (setq top-of-scroll scroll-starting-line)
  44.      (setq bottom-of-scroll scroll-ending-line)
  45.      (send vt100-pane ':set-cursorpos 0 0 ':character)
  46.      (send self ':reset))
  47.     ((or (= ch #/H) (= ch #/f))    ; Direct cursor addressing
  48.      ; ESC [ 14 ; H   ESC [ 14 ; 1  H   ESC [ 14 ; 12 H
  49.      ; And the same sequences with 'f'
  50.      (send self ':move-to-direct-cursor-position
  51.            starting-line-completed-value column)
  52.      (send self ':reset))
  53.     (escape-bracket-numeric-numeric-semicolon-numeric-flag
  54.      ;This is the second of the two digits, so now make a two digit value
  55.      (cond ((and test-for-three-digits-flag    ; Check for "00", ie, ESC [ 10;007H
  56.              (= escape-bracket-numeric-numeric-semicolon-numeric-ch #/0))
  57.         (setq test-for-three-digits-flag nil)
  58.         (setq escape-bracket-numeric-numeric-semicolon-numeric-numeric-ch ch)
  59.         (setq ending-line
  60.               (make-two-digit-value
  61.             escape-bracket-numeric-numeric-semicolon-numeric-ch
  62.             escape-bracket-numeric-numeric-semicolon-numeric-numeric-ch))
  63.         (setq column ending-line))
  64.            (t (setq escape-bracket-numeric-numeric-semicolon-numeric-numeric-ch ch)
  65.           (setq ending-line
  66.             (make-two-digit-value
  67.               escape-bracket-numeric-numeric-semicolon-numeric-ch
  68.               escape-bracket-numeric-numeric-semicolon-numeric-numeric-ch))
  69.           (setq column ending-line))))
  70.     ((and (>= ch #/0) (<= ch #/9))
  71.      ;This is the first of the two digits
  72.      (setq test-for-three-digits-flag t)
  73.      (setq escape-bracket-numeric-numeric-semicolon-numeric-ch ch)
  74.      (setq column (- ch #/0))
  75.      (setq escape-bracket-numeric-numeric-semicolon-numeric-flag t)
  76.      (cond ((=  starting-line-second-ch 99.)
  77.         (setq ending-line
  78.               (make-two-digit-value
  79.             escape-bracket-numeric-semicolon-numeric-ch
  80.             escape-bracket-numeric-numeric-semicolon-numeric-ch))
  81.         (setq starting-line (- starting-line #/0)))
  82.            (t NIL)))
  83.     (t
  84.      (send self ':reset))))
  85. ))
  86.  
  87.  
  88.