home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / emacs / lisp / terminal.elc < prev    next >
Text File  |  1991-01-09  |  24KB  |  306 lines

  1.  
  2. (provide (quote terminal))
  3.  
  4. (require (quote ehelp))
  5.  
  6. (defvar terminal-escape-char 30 "\
  7. *All characters except for this are passed verbatim through the
  8. terminal-emulator.  This character acts as a prefix for commands
  9. to the emulator program itself.  Type this character twice to send
  10. it through the emulator.  Type ? after typing it for a list of
  11. possible commands.
  12. This variable is local to each terminal-emulator buffer.")
  13.  
  14. (defvar terminal-scrolling t "\
  15. *If non-nil, the terminal-emulator will `scroll' when output occurs
  16. past the bottom of the screen.  If nil, output will `wrap' to the top
  17. of the screen.
  18. This variable is local to each terminal-emulator buffer.")
  19.  
  20. (defvar terminal-more-processing t "\
  21. *If non-nil, do more-processing.
  22. This variable is local to each terminal-emulator buffer.")
  23.  
  24. (defvar terminal-redisplay-interval 5000 "\
  25. *Maximum number of characters which will be processed by the
  26. terminal-emulator before a screen redisplay is forced.
  27. Set this to a large value for greater throughput,
  28. set it smaller for more frequent updates but overall slower
  29. performance.")
  30.  
  31. (defvar terminal-more-break-insertion "*** More break -- Press space to continue ***")
  32.  
  33. (defvar terminal-escape-map nil)
  34.  
  35. (defvar terminal-map nil)
  36.  
  37. (defvar terminal-more-break-map nil)
  38.  
  39. (if terminal-map nil (let ((map (make-keymap))) (fillarray map (quote te-pass-through)) (setq terminal-map map)))
  40.  
  41. (if terminal-escape-map nil (let ((map (make-keymap))) (fillarray map (quote undefined)) (let ((s "0")) (while (<= (aref s 0) 57) (define-key map s (quote digit-argument)) (aset s 0 (1+ (aref s 0))))) (define-key map "b" (quote switch-to-buffer)) (define-key map "o" (quote other-window)) (define-key map "e" (quote te-set-escape-char)) (define-key map " " (quote redraw-display)) (define-key map "" (quote te-flush-pending-output)) (define-key map "m" (quote te-toggle-more-processing)) (define-key map "x" (quote te-escape-extended-command)) (define-key map "?" (quote te-escape-help)) (define-key map (char-to-string help-char) (quote te-escape-help)) (setq terminal-escape-map map)))
  42.  
  43. (defvar te-escape-command-alist nil)
  44.  
  45. (if te-escape-command-alist nil (setq te-escape-command-alist (quote (("Set Escape Character" . te-set-escape-char) ("Refresh" . redraw-display) ("Record Output" . te-set-output-log) ("Photo" . te-set-output-log) ("Tofu" . te-tofu) ("Stuff Input" . te-stuff-string) ("Flush Pending Output" . te-flush-pending-output) ("Enable More Processing" . te-enable-more-processing) ("Disable More Processing" . te-disable-more-processing) ("Scroll at end of page" . te-do-scrolling) ("Wrap at end of page" . te-do-wrapping) ("Switch To Buffer" . switch-to-buffer) ("Other Window" . other-window) ("Kill Buffer" . kill-buffer) ("Help" . te-escape-help) ("Set Redisplay Interval" . te-set-redisplay-interval)))))
  46.  
  47. (if terminal-more-break-map nil (let ((map (make-keymap))) (fillarray map (quote te-more-break-unread)) (define-key map (char-to-string help-char) (quote te-more-break-help)) (define-key map " " (quote te-more-break-resume)) (define-key map " " (quote redraw-display)) (define-key map "" (quote te-more-break-flush-pending-output)) (define-key map "" (quote te-more-break-advance-one-line)) (setq terminal-more-break-map map)))
  48.  
  49. (defun te-escape nil (interactive) (byte-code "˙È˙¨ ² ˚θ !ȳ !È˝ Â\"˛ˇ— !\"Á#±!É)ȼ½!Ⱦàá\"\"ÂCÉÈâã )ÁOä \"ÉÄOå!+Ç" [s local global terminal-escape-map prefix-arg terminal-escape-char last-command-char nil current-local-map current-global-map ((byte-code "´!Ȉ    !Ç" [global local use-global-map use-local-map] 3)) use-global-map use-local-map read-key-sequence format "Emacs Terminal escape> %d " prefix-numeric-value "Emacs Terminal escape> " message "" string= make-string 1 -259 te-pass-through lookup-key call-interactively] 14))
  50.  
  51. (defun te-escape-help nil "\
  52. Provide help on commands available after terminal-escape-char is typed." (interactive) (byte-code "´Èˆ˜!ȯ    !˘˙!)Ç" [char terminal-escape-char nil message "Terminal emulator escape help..." single-key-description with-electric-help (lambda nil (byte-code "˙¨²%!È˙˚¸!!È˙¨³˝˛    ´#˛#!Èˇ—!Â+—± !¼\"Á1½± !¾\" Äoà @A!Å?áâã\"ÄOäåä!OÉÈ˙ç!È˙ @@!È˙è!È˙!Èéê!)È AÉÈÁ2)È˘Ç" [char terminal-escape-map t l te-escape-command-alist doc nil princ format "Terminal-emulator escape, invoked by \"%s\"
  53. Type \"%s\" twice to send a single \"%s\" through.
  54.  
  55. Other chars following \"%s\" are interpreted as follows:
  56. " substitute-command-keys "\\{terminal-escape-map}
  57. " "
  58. Subcommands of \"%s\" (%s)
  59. " where-is-internal te-escape-extended-command fboundp sortcar copy-sequence string< sort (lambda (a b) (byte-code "´@    @\"Ç" [a b string<] 3)) documentation "Not documented" string-match "
  60. " 0 match-beginning "  \"" "\":
  61.      " write-char 10] 23))] 4))
  62.  
  63. (defun te-escape-extended-command nil (interactive) (byte-code "˜È´¯˘ ˜´$)Ä˙¨Í)Ç" [c completion-ignore-case t te-escape-command-alist nil completing-read "terminal command: " foo (byte-code "ˆ!ÉÈ
  64.     Ä*˜ˆ    @@!\"Â\"¯˘˙    @A!\"Á&    AÉÈÁ)Ç" [c l te-escape-command-alist downcase string= throw foo call-interactively] 8)] 5))
  65.  
  66. (defun te-escape-extended-command-unread nil (interactive) (byte-code "´È    ÉȈ Ç" [unread-command-char last-input-char nil te-escape-extended-command] 2))
  67.  
  68. (defun te-set-escape-char (c) "\
  69. Change the terminal-emulator escape character." (interactive "cSet escape character to: ") (byte-code "ˆÈ    ˜
  70. U¯Á˘˙
  71. !˙!#È
  72. É)Ç" [o terminal-escape-char c nil message "\"%s\" is escape char" "\"%s\" is now escape; \"%s\" passes though" single-key-description] 6))
  73.  
  74. (defun te-stuff-string (string) "\
  75. Read a string to send to through the terminal emulator
  76. as though that string had been typed on the keyboard.
  77.  
  78. Very poor man's file transfer protocol." (interactive "sStuff string: ") (byte-code "´Èˆ    \"Ç" [te-process string nil process-send-string] 3))
  79.  
  80. (defun te-set-output-log (name) "\
  81. Record output from the terminal emulator in a buffer." (interactive (byte-code "ÂˋÁ´ˆ˜¯˘p!\"ˋ#CÇ" [te-log-buffer nil read-buffer "Record output in buffer: " format "%s output-log" buffer-name] 6)) (byte-code "ˋÈ
  82. ?Å ˆ
  83. ˜\"ÂˋÉȯ˘!Á?˙
  84. !Â\"ˋÁ2ʨ
  85. !qȲ È˚p!ȸ )È˙
  86. !Éȯ³˝!\"Ç" [te-log-buffer nil name equal "" message "Output logging off." get-buffer get-buffer-create fundamental-mode buffer-flush-undo erase-buffer "Recording terminal emulator output into buffer \"%s\"" buffer-name] 12))
  87.  
  88. (defun te-tofu nil "\
  89. Discontinue output log." (interactive) (byte-code "¹Èˋ¹!Ç" [nil te-set-output-log] 2))
  90.  
  91. (defun te-toggle (sym arg) (byte-code "˜    !?     Á#    ¯UÂJ?Á#    ˘WÂ\"´Á#ˆLÇ" [sym arg nil t numberp 1 0] 4))
  92.  
  93. (defun te-toggle-more-processing (arg) (interactive "p") (byte-code "ˆÈ˜¯ˋ\"¢Á˙!È    Ä¨ÉÇ" [arg terminal-more-processing te-more-count nil message te-toggle "More processing on" "More processing off" -1] 4))
  94.  
  95. (defun te-toggle-scrolling (arg) (interactive "p") (byte-code "ˋÈ´ˆ˜\"¯Á˘!Ç" [arg nil message te-toggle terminal-scrolling "Scroll at end of page" "Wrap at end of page"] 4))
  96.  
  97. (defun te-enable-more-processing nil "\
  98. Enable ** MORE ** processing" (interactive) (byte-code "ˋÈ´¹!Ç" [t nil te-toggle-more-processing] 2))
  99.  
  100. (defun te-disable-more-processing nil "\
  101. Disable ** MORE ** processing" (interactive) (byte-code "¹Èˋ¹!Ç" [nil te-toggle-more-processing] 2))
  102.  
  103. (defun te-do-scrolling nil "\
  104. Scroll at end of page (yuck)" (interactive) (byte-code "ˋÈ´¹!Ç" [t nil te-toggle-scrolling] 2))
  105.  
  106. (defun te-do-wrapping nil "\
  107. Wrap to top of window at end of page" (interactive) (byte-code "¹Èˋ¹!Ç" [nil te-toggle-scrolling] 2))
  108.  
  109. (defun te-set-redisplay-interval (arg) "\
  110. Set the maximum interval (in output characters) between screen updates.
  111. Set this number to large value for greater throughput,
  112. set it smaller for more frequent updates (but overall slower performance." (interactive "NMax number of output chars between redisplay updates: ") (byte-code "ˆÈ˜]ÉȯÉÇ" [arg terminal-redisplay-interval te-redisplay-count nil 1 0] 2))
  113.  
  114. (put (quote te-more-break-unread) (quote suppress-keymap) t)
  115.  
  116. (defun te-more-break-unread nil (interactive) (byte-code "˜È    U¯˘!Á#˙¨²!˚ #ȸÉȳ È˜˝ )Ç" [last-input-char terminal-escape-char te-more-count terminal-more-processing nil call-interactively te-escape message "Continuing from more break (\"%s\" typed, %d chars output pending...)" single-key-description te-pending-output-length 259259 te-more-break-unwind te-pass-through] 7))
  117.  
  118. (defun te-more-break-resume nil "\
  119. Proceed past the **MORE** break,
  120. allowing the next page of output to appear" (interactive) (byte-code "¹Èˋ´!Ȉ Ç" [nil message "Continuing from more break" te-more-break-unwind] 3))
  121.  
  122. (defun te-more-break-help nil "\
  123. Provide help on commands available in a terminal-emulator **MORE** break" (interactive) (byte-code "¹Èˋ´!Ȉ˜!ȯ˘!Ç" [nil message "Terminal-emulator more break help..." sit-for 0 with-electric-help (lambda nil (byte-code "ˆ˜!Ȉ¯˘˙¨ˋ#²¨!#!Ȉ˚¸!!Ȉ³!È´Ç" [terminal-more-break-map t nil princ "Terminal-emulator more break.
  124.  
  125. " format "Type \"%s\" (te-more-break-resume)
  126. %s
  127. " where-is-internal te-more-break-resume documentation substitute-command-keys "\\{terminal-more-break-map}
  128. " "Any other key is passed through to the program
  129. running under the terminal emulator and disables more processing until
  130. all pending output has been dealt with."] 9))] 4))
  131.  
  132. (defun te-more-break-advance-one-line nil "\
  133. Allow one more line of text to be output before doing another more break." (interactive) (byte-code "ˋÈ´ÉȈ Ç" [te-more-count nil 1 te-more-break-unwind] 2))
  134.  
  135. (defun te-more-break-flush-pending-output nil "\
  136. Discard any output which has been received by the terminal emulator but
  137. not yet proceesed and then proceed from the more break." (interactive) (byte-code "¹Èˋ È´ Ç" [nil te-more-break-unwind te-flush-pending-output] 3))
  138.  
  139. (defun te-flush-pending-output nil "\
  140. Discard any as-yet-unprocessed output which has been received by
  141. the terminal emulator." (interactive) (byte-code "´ÈA?ˆ˜!Á*¯ ˆ˘    \"È˙¨²    \"DÉÈ˚ È¸´!ȳ˙!)Ç" [te-pending-output length nil message "(There is no output pending)" te-pending-output-length "Flushing %d chars of pending output" 0 format "
  142. *** %d chars of pending output flushed ***
  143. " te-update-pending-output-display te-process-output sit-for] 8))
  144.  
  145. (defun te-pass-through nil "\
  146. Send the last character typed through the terminal-emulator
  147. without any interpretation" (interactive) (byte-code "˜È    =Â˙¨!Á'
  148. Ä A?IJ˜!È˚¸³\"\"È˝˘!Ç" [last-input-char terminal-escape-char terminal-more-processing te-pending-output nil te-process t call-interactively te-escape te-set-more-count send-string make-string 1 te-process-output] 7))
  149.  
  150. (defun te-set-window-start nil (byte-code "¯p!Ä ˘!?Å@    ˙`eZ
  151. T\"YÂ$¨e\"Á@    ˙d`Z
  152. T\"YÂ?¨²d˚    
  153. T\"¸#\"Á@˜*Ç" [w h te-width t nil get-buffer-window window-height / set-window-start - * -1] 12))
  154.  
  155. (defun te-pending-output-length nil (byte-code "    @    A
  156. Ä
  157. @G\\
  158. AÉÈÁÈ*Ç" [length te-pending-output tem] 3))
  159.  
  160. (defun te-more-break nil (byte-code "¸¹!ȳˋ!È`Éȳ´!È˝ ÉÈ˛ !ȳ˜!Èˇ!Éȳ˘!È—±EÉȼ½\"Ⱦ Èàá !p=ÄHâã!ÈmÅd    ?ÅdÊäå!Èç``
  161. \\\"È    c)Èèé!Èêë!Èìƹ\"Ç" [t te-more-old-point te-more-old-local-map terminal-more-break-map te-more-old-filter te-process te-more-old-mode-line-format mode-line-format mode-line-buffer-identification terminal-more-break-insertion te-width te-set-more-count make-local-variable current-local-map use-local-map process-filter "--   **MORE**  " "%-" set-process-filter (lambda (process string) (byte-code "ʈ!qȘ    
  162. C\"É)ȯ Ç" [process te-pending-output string process-buffer nconc te-update-pending-output-display] 4)) te-update-pending-output-display window-buffer selected-window message "More break " forward-char 1 delete-region run-hooks terminal-more-break-hook sit-for 0 throw te-process-output] 20))
  163.  
  164. (defun te-more-break-unwind nil (byte-code "³!È˝    
  165. \"È bÈÉÈ˛ˇ !È˙mÅ6Ä6—±!ȼ``G\\\"Ƚ¾    \"È bÈ˙ÉÈà
  166. á ))Èâ¸!Ç" [te-more-old-local-map te-process te-more-old-filter te-more-old-point mode-line-format te-more-old-mode-line-format buffer-read-only nil terminal-more-break-insertion te-width te-more-count t use-local-map set-process-filter set-buffer-modified-p buffer-modified-p forward-char 1 delete-region insert-char 32 259259 te-newline te-process-output] 10))
  167.  
  168. (defun te-set-more-count (newline) (byte-code "˘`eZ    T\"
  169. ÄTÉÈ UÂ ÉÁR SUÂ* ÉÁR˘ ˙\"WÅ8 Z¨VÂC ZÉÁR ¨VÂN˙ÁO²ZÉ)Ç" [line te-width newline te-height te-more-count t / 2 10 1] 5))
  170.  
  171. (defun te-newline nil "\
  172. Move down a line, optionally do more processing, perhaps wrap/scroll,
  173. move to start of new line, clear to end of line." (byte-code "¯ È?Å    SɢWÂ˙´!Á    ˘=Ĩ ÈmÂ>²ee \\\"ÈebÈ Ä;˚¸!ÈdbȳcÁH˝¸!Ȳ`` \\\"È˛ˇ \"È— È± Ç" [terminal-more-processing te-more-count t te-width terminal-scrolling end-of-line 0 te-set-more-count te-more-break delete-region delete-char 1 10 forward-char insert-char 32 beginning-of-line te-set-window-start] 11))
  174.  
  175. (defun te-down-vertically-or-scroll nil "\
  176. Move down a line vertically, or scroll at bottom." (byte-code "i´ ÈmÂ'ˆee    \\\"ÈebȘ¯!ÈdbÈ˘cÈ˙¨    \"Ȳ Á*˚¯!ȸ!)ȳ Ç" [column te-width end-of-line delete-region delete-char 1 10 insert-char 32 beginning-of-line forward-line move-to-column te-set-window-start] 9))
  177.  
  178. (defun te-move-to-position nil (byte-code "˘ ˙Z˘ ˙Z    
  179. VÅ V˜Á$¨e    ²
  180. T\"#b*È˚ÉÇ" [y x te-width te-height nil te-more-count te-get-char 32 + * -1] 8))
  181.  
  182. (defun te-clear-rest-of-line nil (byte-code "Ê`ˋ È`Z´``\\\"Ȉ˜[\"))Ç" [n end-of-line delete-region insert-char 32] 5))
  183.  
  184. (defun te-clear-rest-of-screen nil (byte-code "Êˋ È´ Èm?Ä\"ˆ˜!È´ È¯`Z`\"È˘˙\"ÈÁ)Ç" [te-width te-clear-rest-of-line end-of-line forward-char 1 delete-region insert-char 32] 9))
  185.  
  186. (defun te-clear-screen nil (byte-code "˜ È¯    WÄTÉÈ˘˙
  187. \"ȨcÈÁ)ȲdSd\"ÈebÈ˚ÉÇ" [i te-height te-width te-more-count erase-buffer 0 insert-char 32 10 delete-region -1] 5))
  188.  
  189. (defun te-insert-lines nil (byte-code "n?    ¹ÁQÊ˙
  190. ¨`eZ T\"²#˚ ¸Z    ^³˝d˛ T\"Zd\"È`d=Ä2ˇcÈ WÄOTÉÈ—¸ \"È    =ÅKˇcÈÁ3+)ȲÉÇ" [nil line te-height te-width n i te-more-count - / -1 te-get-char 32 0 delete-region * 10 insert-char] 9))
  191.  
  192. (defun te-delete-lines nil (byte-code "n?    ¹ÁM˙
  193. ¨`eZ T\"²#˚ ¸Z    ^³˝``˛ T\"\\d^\"ÈÊdbÈ WÄKTÉÈˇ¸ \"È    =ÅG—cÈÁ/)+ȲÉÇ" [nil line te-height te-width n i te-more-count - / -1 te-get-char 32 0 delete-region * insert-char 10] 9))
  194.  
  195. (defun te-beginning-of-line nil (byte-code "¹ Ç" [beginning-of-line] 2))
  196.  
  197. (defun te-backward-char nil (byte-code "n?Ĺˋ!Ç" [backward-char 1] 2))
  198.  
  199. (defun te-forward-char nil (byte-code "l?Ĺˋ!Ç" [forward-char 1] 2))
  200.  
  201. (defun te-delete nil (byte-code "n¹Áˋ`S`\"È´cȈ˜!Ç" [nil delete-region 32 forward-char -1] 3))
  202.  
  203. (defun te-beep nil (byte-code "¹ Ç" [beep] 2))
  204.  
  205. (defun te-insert-spaces nil (byte-code "`ˆ ˜Z¯ È`Z^    ˘X´Á$˙    [!ÈbȨ˜    \"Èb*Ç" [p n nil te-get-char 32 end-of-line 0 delete-char insert-char] 6))
  206.  
  207. (defun te-delete-char nil (byte-code "`ˆ ˜Z¯ È`Z^    ˘X´Á#˙˜    \"ÈbȨ    !Èb*Ç" [p n nil te-get-char 32 end-of-line 0 insert-char delete-char] 5))
  208.  
  209. (defun te-losing-unix nil (byte-code "¹Ç" [nil] 1))
  210.  
  211. (defun te-output-tab nil (byte-code "`ˆ È`Z˜¯    ˘\"Z˙ È`Z^
  212. \\b+Ç" [p x l beginning-of-line 8 logand 7 end-of-line] 6))
  213.  
  214. (defun te-filter (process string) (byte-code "p
  215. ²Î˚ !qÈ bȸ!Ä/³!?Â!˘ÉÁ/qÈdbÈcÈ˚ !qÈ˝C\"ÉÈ˛ È    ˇp—± !=!)È˚ !qÈ`É)*Ç" [obuf m meta-flag process te-saved-point te-log-buffer nil string te-pending-output ((byte-code "qÇ" [obuf] 1)) process-buffer bufferp buffer-name nconc te-update-pending-output-display te-process-output window-buffer selected-window] 12))
  216.  
  217. (defun te-process-output (preemptable) (byte-code "ˋÉȘ¯ÍÈ˘ 
  218. ˙ !É=?Ä(¨ !p=Ä$² `\"ÈÁ*Ç" [preemptable t s w te-process-output (byte-code "ˋˋˋˋˋˋAÄP
  219. @A@
  220. HÉÈ TÉ
  221. G=ÂD¸AAB¸A@Éȳ ÁI˝ \"È˛VÄSˇWÂlÂ| ¸=Âp¸—±\"ABBÉÁv˝ S\"ȼ Á
  222. ?Âν±!ÈcȾ±!Á
  223. =ÄÖŃàá
  224. #ÉŃ
  225. G    ½±!ÈcÈ`ÉÈâ È     `Z\\^É    ÈbÈ    =ıˋÉÈã``     Z\\\"È ¸=Äñ    
  226. G=Âô
  227. Áú
  228.     OcÈ    
  229. G=    ¸AABÉÁ˝    \"Ⱦ     ZT!)Á=äå=Â/çè é\"AÅ,êÁ8çë\"AÅ8ê!Ⱦ±!È
  230. ÄLì ÄLÆí¨\"ÈÁ.Ç" [buffer-read-only nil string ostring start char matchpos te-pending-output t end preemptable 0 te-update-pending-output-display setcar 31 255 make-string 1 te-newline delete-char te-redisplay-if-necessary string-match "[--]" end-of-line delete-region funcall 16 assq te-get-char ((61 . te-move-to-position) (99 . te-clear-rest-of-line) (67 . te-clear-rest-of-screen) (15 . te-insert-lines) (11 . te-delete-lines) (1 . te-beginning-of-line) (2 . te-backward-char) (100 . te-delete-char) (95 . te-insert-spaces) (6 . te-forward-char) (7 . te-beep) (10 . te-down-vertically-or-scroll) (12 . te-clear-screen)) te-losing-unix ((10 . te-newline) (127 . te-delete) (13 . te-beginning-of-line) (7 . te-beep) (8 . te-backward-char) (9 . te-output-tab)) input-pending-p throw te-process-output] 23) selected-window next-window window-buffer set-window-point] 7))
  231.  
  232. (defun te-get-char nil (byte-code "AÂ,@A@
  233.     H    TÉ
  234. G=Â#ˆAABÉÁ'˜    \"È*Á/¯˘ÍÇ" [te-pending-output start string 0 setcar char (byte-code "´    !ˆÎ˜    ¯\"È˘    !))Ç" [filter te-process process-filter ((byte-code "´    \"Ç" [te-process filter set-process-filter] 3)) set-process-filter (lambda (p s) (byte-code "G´=Å ´DÉȈ˜¯H\"Ç" [s te-pending-output 1 throw char 0] 4)) accept-process-output] 4)] 4))
  235.  
  236. (defun te-redisplay-if-necessary (length) (byte-code "    ZɈXÄ\"p˜¯ !=Ä\"˘ Ä\"˙ È¨ˆ!È
  237. ÉÇ" [te-redisplay-count length terminal-redisplay-interval 0 window-buffer selected-window waiting-for-user-input-p te-update-pending-output-display sit-for] 7))
  238.  
  239. (defun te-update-pending-output-display nil (byte-code "A? ˆÉÁ'˜ 
  240. ¯WˆÉÁ&˘˙¨
  241. ²\\˚\"\"É)ȸ³ !Ç" [te-pending-output te-pending-output-info length "" te-pending-output-length 1500 format "(%dK chars output pending) " / 512 1024 set-buffer-modified-p buffer-modified-p] 6))
  242.  
  243. (defun te-sentinel (process message) (byte-code "˘!˙=ÅD¨²!!?ÅDpʲ!qȘÉÈ˚ Èdbȸ È³ È˝˛ˇ#)È
  244. ²!=Ä:— ÄCdbȱ¼!)Ç" [process t b buffer-read-only nil message process-status run buffer-name process-buffer fundamental-mode delete-blank-lines delete-horizontal-space insert "
  245. *******
  246. " "*******
  247. " waiting-for-user-input-p recenter -1] 12))
  248.  
  249. (defvar te-stty-string "stty -nl new dec echo" "\
  250. Command string (to be interpreted by \"sh\") which sets the modes
  251. of the virtual terminal to be appropriate for interactive use.")
  252.  
  253. (defvar explicit-shell-file-name nil "\
  254. *If non-nil, is file name to use for explicitly requested inferior shell.")
  255.  
  256. (defun terminal-emulator (buffer program args &optional width height) "\
  257. Under a display-terminal emulator in BUFFER, run PROGRAM on arguments ARGS.
  258. ARGS is a list of argument-strings.  Remaining arguments are WIDTH and HEIGHT.
  259. BUFFER's contents are made an image of the display generated by that program,
  260. and any input typed when BUFFER is the current Emacs buffer is sent to that
  261. program an keyboard input.
  262.  
  263. Interactively, BUFFER defaults to \"*terminal*\" and PROGRAM and ARGS
  264. are parsed from an input-string using your usual shell.
  265. WIDTH and HEIGHT are determined from the size of the current window
  266. -- WIDTH will be one less than the window's width, HEIGHT will be its height.
  267.  
  268. To switch buffers and leave the emulator, or to give commands
  269. to the emulator itself (as opposed to the program running under it),
  270. type Control-^.  The following character is an emulator command.
  271. Type Control-^ twice to send it to the subprogram.
  272. This escape character may be changed using the variable `terminal-escape-char'.
  273.  
  274. `Meta' characters may not currently be sent through the terminal emulator.
  275.  
  276. Here is a list of some of the variables which control the behaviour
  277. of the emulator -- see their documentation for more information:
  278. terminal-escape-char, terminal-scrolling, terminal-more-processing,
  279. terminal-redisplay-interval.
  280.  
  281. This function calls the value of terminal-mode-hook if that exists
  282. and is non-nil after the terminal buffer has been set up and the
  283. subprocess started.
  284.  
  285. Presently with `termcap' only; if somebody sends us code to make this
  286. work with `terminfo' we will try to use it." (interactive (byte-code "ʘ¯!qÈ˘˙¹!?Å?Ũ!²=? pÁ#˚¯!!)¸
  287. Å7³˝!Å7³˛!Å7ˇ—±¼    \"!½ ¾\"ÂL    àDÁOá !*!BÇ" [te-process default-s explicit-shell-file-name s get-buffer-create "*terminal*" buffer-name boundp process-status run generate-new-buffer append getenv "ESHELL" "SHELL" "/bin/sh" read-string format "Run program in emulator: (default %s) " equal "" nil te-parse-program-and-args] 14)) (byte-code "¸È¼ !È?Ľ¾ !àZÉÈ?Ä#á¾ !àZÉÈâ ÈÉÈãä#åDÉ    È¸
  288. ç )ȸ èp!É Änéãêë !\"!Âcì !ÁjÆíë !\"ÈÁG)ȪîïÏÈðñ!ÄÁŁØ!ÈŒà!ÈŁºò!óòôõˇ#ö##ÈˇÉÈæ!Èùú!Ç" [te-process default-s explicit-shell-file-name s buffer width height te-width te-height mode-line-buffer-identification buffer-read-only nil process terminal-escape-char terminal-escape-map t inhibit-quit terminal-map switch-to-buffer window-width selected-window 1 window-height terminal-mode format "Emacs terminal %dx%d: %%b  " te-pending-output-info te-clear-screen get-buffer-process y-or-n-p "Kill process %s? " process-name delete-process error "Process %s not killed" err (byte-code "²˚¸    
  289. ³Á˝$˛ˇ—±¼½&¾à!Â:àáâãäåçpèéêëìBÆBD&ÉÁdíápªî˚ïðñP!ðŁP!ØðBŒ#%%ÉȺ å\"Èò é\")Ç" [termcap te-width te-height terminal-scrolling te-process program args te-stty-string exec-directory concat format "emacs-virtual:co#%d:li#%d:%s" "" "ns:" "cm=^p=%+ %+ :cr=^p^a:le=^p^b:nd=^p^f:" "nw=^j:ce=^pc:cd=^pC:cl=^p^l:bl=^p^g:" "IC=^p_%+ :DC=^pd%+ :AL=^p^o%+ :DL=^p^k%+ :" "LP:NF:" "ic=^p_!:dc=^pd!:al=^p^o!:dl=^p^k!:ho=^p=  :" "im=:ei=:dm=:ed=:mi:do=^p^j:nl=^p^j:bs:" fboundp start-subprocess "terminal-emulator" channel-type terminal filter te-filter buffer sentinel te-sentinel modify-environment "TERM" "emacs-virtual" "TERMCAP" start-process "/bin/sh" "-c" "%s; exec %s TERM=emacs-virtual %s %s" te-quote-arg-for-sh "env" "TERMCAP=" mapconcat " " set-process-filter set-process-sentinel] 20) ((error (byte-code "ˋ È´@A\"Ç" [err fundamental-mode signal] 4))) default-value meta-flag message "Note:  Meta key disabled due to maybe-eventually-reparable braindamage" sit-for "Entering emacs terminal-emulator...  Type %s %s for help" single-key-description mapconcat where-is-internal te-escape-help " " use-local-map run-hooks terminal-mode-hook] 28))
  290.  
  291. (defun te-parse-program-and-args (s) (byte-code "˘˙\"ÂQ´¨ ÄA˘² #Â1 ˚¸!O˚¨!ÉÈ G=Ä-´ÉÈÁ9 ´O´ÉÈ    BÉÈÁ ȳ    !ÉÈ    @    AD*Ál˘˝\"Ä\\˛!?Âi ˇ—PDDÁl´DÇ" [s l nil p shell-file-name t string-match "\\`\\([a-zA-Z0-9-+=_.@/:]+[     ]*\\)+\\'" 0 "\\([a-zA-Z0-9-+=_.@/:]+\\)\\([     ]+\\)*" match-end 1 nreverse "[     ]" file-exists-p "-c" "exec "] 11))
  292.  
  293. (put (quote terminal-mode) (quote mode-class) (quote special))
  294.  
  295. (defun terminal-mode nil "\
  296. Set up variables for use f the terminal-emualtor.
  297. One should not call this -- it is an internal function
  298. of the terminal-emulator" (byte-code "¼ È½p!ȾÉÈàÉÈáÉȘÉȘÉÈâ˘!Èã˘!ÉÈâ˙!Èã˙!ÉÈâ¨!Èã¨!ÉÈâ²!Èã²!É    Èâä!Èâå!Èâç!Èâ˚!ÈèCÉ
  299. Èâ¸!ÈeÉ Èâ³!ÈéÉ Èâê!Èâ˝!È˛ÉÈâˇ!ÈëÉÈâ—!È    ÉÈâ±!È˛ÉÇ" [major-mode mode-name mode-line-process buffer-read-only t truncate-lines terminal-escape-char terminal-scrolling terminal-more-processing terminal-redisplay-interval te-pending-output te-saved-point te-pending-output-info te-log-buffer nil te-more-count te-redisplay-count meta-flag kill-all-local-variables buffer-flush-undo terminal-mode "terminal" (": %s") make-local-variable default-value te-width te-height te-process 0 "" inhibit-quit -1] 23))
  300.  
  301. (defun te-quote-arg-for-sh (fuckme) (byte-code "˘˙\" Á`˘¨\"?²!Á`˚¸¸ GYÂ*¯ÁB˘³ #ÉÂ8ˋÁB
  302. ¯OPÉȯÄZ
  303. O˝ TOR TÉÈÁÈ˛
  304. ˛Q+Ç" [fuckme t harder cretin stupid nil string-match "\\`[a-zA-Z0-9-+=_.@/:]+\\'" "[$]" prin1-to-string "" 0 "[\"\\$]" "\\" "\""] 11))
  305.