;ELC ;;; compiled by jwz@thalidomide on Tue Apr 5 00:54:24 1994 ;;; from file /th/jwz/emacs19/lisp/packages/terminal.el ;;; emacs version 19.10 Lucid (beta11). ;;; bytecomp version 2.23; 22-dec-93. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (byte-code "!!" [provide terminal require ehelp] 2) (defvar terminal-escape-char 30 "\ *All characters except for this are passed verbatim through the terminal-emulator. This character acts as a prefix for commands to the emulator program itself. Type this character twice to send it through the emulator. Type ? after typing it for a list of possible commands. This variable is local to each terminal-emulator buffer.") (defvar terminal-scrolling t "\ *If non-nil, the terminal-emulator will `scroll' when output occurs past the bottom of the screen. If nil, output will `wrap' to the top of the screen. This variable is local to each terminal-emulator buffer.") (defvar terminal-more-processing t "\ *If non-nil, do more-processing. This variable is local to each terminal-emulator buffer.") (defvar terminal-redisplay-interval 5000 "\ *Maximum number of characters which will be processed by the terminal-emulator before a screen redisplay is forced. Set this to a large value for greater throughput, set it smaller for more frequent updates but overall slower performance.") (byte-code "!!!! \"\"WI#Te+) \"\"HX#HTId)########(!#)!))) \"\"WI#Te+(!#####)MM" [boundp terminal-more-break-insertion "*** More break -- Press space to continue ***" terminal-escape-map nil terminal-map terminal-more-break-map make-keymap map set-keymap-name -1 make-string 1 0 i s meta-prefix-char 256 define-key te-pass-through 48 57 digit-argument "b" switch-to-buffer "o" other-window "e" te-set-escape-char " " redraw-display "" te-flush-pending-output "m" te-toggle-more-processing "x" te-escape-extended-command "?" te-escape-help char-to-string help-char te-escape-command-alist (("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)) te-more-break-unwind te-more-break-help " " te-more-break-resume te-more-break-flush-pending-output " " te-more-break-advance-one-line te-escape-p #[(event) " ! ! ! ! !U ! != ! ! ! !U ! !=ȇ $  U)ȇ" [eventp terminal-escape-char key-press-event-p event event-modifier-bits event-key button-press-event-p event-button nil event-to-character t c] 6] te-escape #[nil " !\"\"   ! ! r !  !\"+!!\" )!)" [t prefix-arg format "Emacs Terminal escape> %d " prefix-numeric-value "Emacs Terminal escape> " prompt cursor-in-echo-area message "%s" next-command-event e button-release-event-p te-escape-p unread-command-event lookup-key terminal-escape-map read-key-sequence c eventp nil copy-event last-command-event -259 terminal-escape-char te-pass-through call-interactively] 5 nil nil]] 5) (fset 'te-escape-help #[nil "! !!)" [message "Terminal emulator escape help..." single-key-description terminal-escape-char char with-electric-help #[nil " %!!! ##!!!\"!\"@A!\"؉O!@@!!!!)AE)݇" [princ format "Terminal-emulator escape, invoked by \"%s\"\nType \"%s\" twice to send a single \"%s\" through.\n\nOther chars following \"%s\" are interpreted as follows:\n" char substitute-command-keys "\\{terminal-escape-map}\n" "\nSubcommands of \"%s\" (%s)\n" where-is-internal te-escape-extended-command terminal-escape-map t fboundp sortcar copy-sequence te-escape-command-alist string< sort #[(a b) "@ @" [a b] 2] l documentation "Not documented" doc string-match "\n" 0 " \"" "\":\n " write-char 10 nil] 8]] 2 "\ Provide help on commands available after terminal-escape-char is typed." nil]) (byte-code "MM" [te-escape-extended-command #[nil " $)ȍ)" [t completion-ignore-case completing-read "terminal command: " te-escape-command-alist nil c foo (byte-code " \n\n@@\n@A!\"j\nAg)" [c te-escape-command-alist l throw foo call-interactively nil] 5)] 6 nil nil] te-escape-extended-command-unread #[nil " " [last-command-event unread-command-event te-escape-extended-command] 1 nil nil]] 2) (fset 'te-set-escape-char #[(c) " !! ! $ ! !# !\" !! !\" " [te-escape-p c message "\"%s\" is escape char" eventp terminal-escape-char event-to-character nil t "\"%s\" is now escape; \"%s\" passes though" single-key-description "\"%s\" is now escape" local-unset-key vector local-set-key te-escape] 5 "\ Change the terminal-emulator escape character." (byte-code "!  ! !u *C" [t cursor-in-echo-area message "Set escape character to: " next-command-event e button-release-event-p] 2)]) (fset 'te-stuff-string #[(string) " \n\"" [process-send-string te-process string] 3 "\ Read a string to send to through the terminal emulator as though that string had been typed on the keyboard. Very poor man's file transfer protocol." "sStuff string: "]) (fset 'te-set-output-log #[(name) "!!!q p! )! !\"" [name "" nil te-log-buffer message "Output logging off." get-buffer get-buffer-create fundamental-mode buffer-disable-undo erase-buffer "Recording terminal emulator output into buffer \"%s\"" buffer-name] 4 "\ Record output from the terminal emulator in a buffer." (byte-code "?p!\"#C" [te-log-buffer read-buffer "Record output in buffer: " format "%s output-log" buffer-name nil] 6)]) (fset 'te-tofu #[nil "!" [te-set-output-log nil] 2 "\ Discontinue output log." nil]) (byte-code "MMM" [te-toggle #[(sym arg) " UJ? WĪL" [sym arg 1 0 nil t] 3] te-toggle-more-processing #[(arg) " \"Ī!\nƉ" [message te-toggle terminal-more-processing arg "More processing on" "More processing off" -1 te-more-count] 4 nil "p"] te-toggle-scrolling #[(arg) " \"Ī!" [message te-toggle terminal-scrolling arg "Scroll at end of page" "Wrap at end of page"] 4 nil "p"]] 2) (fset 'te-enable-more-processing #[nil "!" [te-toggle-more-processing t] 2 "\ Enable ** MORE ** processing" nil]) (fset 'te-disable-more-processing #[nil "!" [te-toggle-more-processing nil] 2 "\ Disable ** MORE ** processing" nil]) (fset 'te-do-scrolling #[nil "!" [te-toggle-scrolling t] 2 "\ Scroll at end of page (yuck)" nil]) (fset 'te-do-wrapping #[nil "!" [te-toggle-scrolling nil] 2 "\ Wrap to top of window at end of page" nil]) (fset 'te-set-redisplay-interval #[(arg) "]É" [arg 1 terminal-redisplay-interval 0 te-redisplay-count] 3 "\ Set the maximum interval (in output characters) between screen updates. Set this number to large value for greater throughput, set it smaller for more frequent updates (but overall slower performance." "NMax number of output chars between redisplay updates: "]) (byte-code "#M" [put te-more-break-unread suppress-keymap t #[nil " !! ! #  )" [te-escape-p last-command-event 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-count te-more-break-unwind nil terminal-more-processing te-pass-through] 4 nil nil]] 4) (fset 'te-more-break-resume #[nil "! " [message "Continuing from more break" te-more-break-unwind] 2 "\ Proceed past the **MORE** break, allowing the next page of output to appear" nil]) (fset 'te-more-break-help #[nil "!!!" [message "Terminal-emulator more break help..." sit-for 0 with-electric-help #[nil "!#!#!!!!̇" [princ "Terminal-emulator more break.\n\n" format "Type \"%s\" (te-more-break-resume)\n%s\n" where-is-internal te-more-break-resume terminal-more-break-map t documentation substitute-command-keys "\\{terminal-more-break-map}\n" "Any other key is passed through to the program\nrunning under the terminal emulator and disables more processing until\nall pending output has been dealt with." nil] 7]] 2 "\ Provide help on commands available in a terminal-emulator **MORE** break" nil]) (fset 'te-more-break-advance-one-line #[nil " " [1 te-more-count te-more-break-unwind] 1 "\ Allow one more line of text to be output before doing another more break." nil]) (fset 'te-more-break-flush-pending-output #[nil " " [te-more-break-unwind te-flush-pending-output] 1 "\ Discard any output which has been received by the terminal emulator but not yet proceesed and then proceed from the more break." nil]) (fset 'te-flush-pending-output #[nil "A!  \" \"D !!)" [te-pending-output message "(There is no output pending)" te-pending-output-length length "Flushing %d chars of pending output" 0 format "\n*** %d chars of pending output flushed ***\n" te-update-pending-output-display te-process-output nil sit-for] 4 "\ Discard any as-yet-unprocessed output which has been received by the terminal emulator." nil]) (fset 'te-pass-through #[nil " !! A! $\n \n\"\")!" [te-escape-p last-command-event call-interactively te-escape terminal-more-processing te-pending-output te-set-more-count nil event-to-character t c process-send-string te-process make-string 1 te-process-output] 6 "\ Send the last character typed through the terminal-emulator without any interpretation" nil]) (byte-code "MMMMM" [te-set-window-start #[nil "p! ! ? `eZ TY e\" d`Z TY d T_ZZ\"*" [get-buffer-window w window-height h te-width set-window-start -1 nil] 6] te-pending-output-length #[nil "@A \n @G\\ At\n*" [te-pending-output tem length] 3] te-more-break #[nil "!!`! !!\n!!  E \n\" !p=!mu``\\|c)!!\"" [te-set-more-count t make-local-variable te-more-old-point te-more-old-local-map current-local-map use-local-map terminal-more-break-map te-more-old-filter process-filter te-process te-more-old-mode-line-format mode-line-format "-- **MORE** " mode-line-buffer-identification "%-" set-process-filter #[(process string) " !q\n C) " [process-buffer process te-pending-output string te-update-pending-output-display] 2] te-update-pending-output-display window-buffer selected-window message "More break " terminal-more-break-insertion 1 te-width run-hooks terminal-more-break-hook sit-for 0 throw te-process-output] 3] te-more-break-unwind #[nil " ! \" b ! m u`` G\\|\" b *!" [use-local-map te-more-old-local-map set-process-filter te-process te-more-old-filter te-more-old-point te-more-old-mode-line-format mode-line-format set-buffer-modified-p buffer-modified-p nil buffer-read-only terminal-more-break-insertion 1 insert-char 32 te-width 259259 te-more-count te-newline te-process-output t] 3] te-set-more-count #[(newline) "`eZT\n T U  SU  ťW ZV Z VŪZ)" [te-width line newline te-height te-more-count 2 10 1] 3]] 2) (fset 'te-newline #[nil " \nSW!\n= mee\\|eb!dbcu``\\|\"y " [nil terminal-more-processing te-more-count 0 te-set-more-count t te-more-break te-width terminal-scrolling delete-char 1 10 insert-char 32 te-set-window-start] 3 "\ Move down a line, optionally do more processing, perhaps wrap/scroll, move to start of new line, clear to end of line."]) (fset 'te-down-vertically-or-scroll #[nil "imee\n\\|eb!dbc\n\"yy!) " [column nil te-width delete-char 1 10 insert-char 32 0 move-to-column te-set-window-start] 3 "\ Move down a line vertically, or scroll at bottom."]) (byte-code "MMMMMMMMMMMMMMMMMMMMM" [te-move-to-position #[nil " Z Z\n V Ve\n T_\\\\b*Ɖ" [te-get-char 32 x y te-width te-height -1 te-more-count] 4] te-clear-rest-of-line #[nil "``Z`` \\| [\"*" [nil n insert-char 32] 3] te-clear-rest-of-screen #[nil " m?u` Z`| \"f)" [te-clear-rest-of-line nil 1 te-width insert-char 32] 3] te-clear-screen #[nil " \n W\nT\"cm)dSd|ebȉ " [erase-buffer 0 i te-height insert-char 32 te-width 10 -1 te-more-count] 3] te-insert-lines #[nil "nƊ`eZ TZZ Z ^d T_Zd|`d=cWT \" =icd,‰ " [te-height te-width -1 line te-get-char 32 n 0 i 10 insert-char te-more-count] 3] te-delete-lines #[nil "n`eZ TZZ Z ^`` T_\\d^|dbWT \" =icd,‰ " [te-height te-width -1 line te-get-char 32 n 0 i insert-char 10 te-more-count] 4] te-beginning-of-line #[nil "y" [0 nil] 1] te-backward-char #[nil "n?!" [backward-char 1] 2] te-forward-char #[nil "l?u" [1] 1] te-delete #[nil "n?`S`|cu" [32 -1] 2] te-beep #[nil " " [beep] 1] te-insert-spaces #[nil "` Z`Z^X [!b \"b*" [p te-get-char 32 nil n 0 delete-char insert-char] 4] te-delete-char #[nil "` Z`Z^X \"b !b*" [p te-get-char 32 nil n 0 insert-char delete-char] 4] te-losing-unix (lambda nil) te-output-tab #[nil "`y`Z\n\"Z`Z^\\b+" [p 0 x 8 logand 7 nil l] 5] te-filter #[(process string) "p !q b!!qdb\n! !q \nC p !=! !q`*" [obuf ((set-buffer obuf)) process-buffer process te-saved-point bufferp te-log-buffer buffer-name nil insert-before-markers string te-pending-output te-update-pending-output-display te-process-output window-buffer selected-window] 4] te-process-output #[(preemptable) "Í  !=?!p=l`\"d*" [t preemptable te-process-output (byte-code "A( @A@ H T G=AABA@  \nV\nWl =\n\"ABB S  !\nc! = # G!\nc` `\nZ\\^\nb =`` Z\\| = G= Oc G=AAB ZT!)\n= ֞Aת\n؞A ! \" ." [nil matchpos char start ostring string buffer-read-only te-pending-output 0 te-update-pending-output-display 31 255 make-string 1 te-newline delete-char te-redisplay-if-necessary string-match "[--]" end 16 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)) preemptable input-pending-p throw te-process-output t] 7) selected-window s w next-window window-buffer set-window-point] 4] te-get-char #[nil "A@A@ \nH\nT G=AAB\n*ō" [te-pending-output string start 0 char (byte-code " !Î \" !*" [process-filter te-process filter ((set-process-filter te-process filter)) set-process-filter #[(p s) "G=DH\"" [s 1 te-pending-output throw char 0] 4] accept-process-output] 3)] 3] te-redisplay-if-necessary #[(length) " ZXp != !" [te-redisplay-count length 0 window-buffer selected-window waiting-for-user-input-p te-update-pending-output-display sit-for terminal-redisplay-interval] 3] te-update-pending-output-display #[nil "A W \\ɥ\") !" [te-pending-output "" te-pending-output-info te-pending-output-length length 1500 format "(%dK chars output pending) " 512 1024 set-buffer-modified-p buffer-modified-p] 5] te-sentinel #[(process message) " != !!?p !q db  ͱ) != db!)" [process-status process run buffer-name process-buffer b nil buffer-read-only fundamental-mode delete-blank-lines delete-horizontal-space "\n*******\n" message "*******\n" waiting-for-user-input-p recenter -1] 3]] 2) (defvar te-stty-string "stty -nl new dec echo" "\ Command string (to be interpreted by \"sh\") which sets the modes of the virtual terminal to be appropriate for interactive use.") (defvar explicit-shell-file-name nil "\ *If non-nil, is file name to use for explicitly requested inferior shell.") (fset 'terminal-emulator #[(buffer program args &optional width height) " !\n !Z !Z \n \n \n#D )p!!\"!!f!\"\\)܏ !!&!*###" [switch-to-buffer buffer width window-width selected-window 1 height window-height terminal-mode te-width te-height format "Emacs terminal %dx%d: %%b " te-pending-output-info mode-line-buffer-identification nil buffer-read-only te-clear-screen process get-buffer-process y-or-n-p "Kill process %s? " process-name delete-process error "Process %s not killed" err (byte-code "\n Ū$̰ !pB BD& p#%P! P!B#%%\"\")" [format "emacs-virtual:co#%d:li#%d:%s:km:" te-width te-height terminal-scrolling "" "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:" termcap fboundp start-subprocess "terminal-emulator" program args channel-type terminal filter te-filter buffer sentinel te-sentinel modify-environment "TERM" "emacs-virtual" "TERMCAP" te-process start-process "/bin/sh" "-c" "%s; exec %s TERM=emacs-virtual %s %s" te-stty-string te-quote-arg-for-sh exec-directory "env" "TERMCAP=" mapconcat " " set-process-filter set-process-sentinel] 16) ((error (byte-code " \n@\nA\"" [fundamental-mode signal err] 3))) t inhibit-quit use-local-map terminal-map run-hooks terminal-mode-hook message "Entering emacs terminal-emulator... Type %s %s for help" single-key-description terminal-escape-char mapconcat where-is-internal te-escape-help terminal-escape-map " "] 9 "\ Under a display-terminal emulator in BUFFER, run PROGRAM on arguments ARGS. ARGS is a list of argument-strings. Remaining arguments are WIDTH and HEIGHT. BUFFER's contents are made an image of the display generated by that program, and any input typed when BUFFER is the current Emacs buffer is sent to that program an keyboard input. Interactively, BUFFER defaults to \"*terminal*\" and PROGRAM and ARGS are parsed from an input-string using your usual shell. WIDTH and HEIGHT are determined from the size of the current window -- WIDTH will be one less than the window's width, HEIGHT will be its height. To switch buffers and leave the emulator, or to give commands to the emulator itself (as opposed to the program running under it), type Control-^. The following character is an emulator command. Type Control-^ twice to send it to the subprogram. This escape character may be changed using the variable `terminal-escape-char'. `Meta' characters may not currently be sent through the terminal emulator. Here is a list of some of the variables which control the behaviour of the emulator -- see their documentation for more information: terminal-escape-char, terminal-scrolling, terminal-more-processing, terminal-redisplay-interval. This function calls the value of terminal-mode-hook if that exists and is non-nil after the terminal buffer has been set up and the subprocess started. Presently with `termcap' only; if somebody sends us code to make this work with `terminfo' we will try to use it." (byte-code "!q! !=p!!) !!\"!ӚD!*!B" [get-buffer-create "*terminal*" buffer-name boundp te-process process-status run generate-new-buffer append explicit-shell-file-name getenv "ESHELL" "SHELL" "/bin/sh" default-s read-shell-command format "Run program in emulator: (default %s) " s "" nil te-parse-program-and-args] 7)]) (byte-code "M#" [te-parse-program-and-args #[(s) "\n\" \n #\n ȕOĕ\nG=\n OBW@A*D\n\"\n! \nPDD\nD" [string-match "\\`\\([a-zA-Z0-9-+=_.@/:]+[ ]*\\)+\\'" s nil 0 p l "\\([a-zA-Z0-9-+=_.@/:]+\\)\\([ ]+\\)*" 1 "[ ]" file-exists-p shell-file-name "-c" "exec "] 5] put terminal-mode mode-class special] 4) (fset 'terminal-mode #[nil " p! \n!! !!!!!!!!!!C!e!!!!!!݉" [kill-all-local-variables buffer-disable-undo terminal-mode major-mode "terminal" mode-name (": %s") mode-line-process t buffer-read-only truncate-lines make-local-variable terminal-escape-char default-value terminal-scrolling terminal-more-processing terminal-redisplay-interval te-width te-height te-process te-pending-output 0 te-saved-point te-pending-output-info "" inhibit-quit te-log-buffer nil te-more-count -1 te-redisplay-count meta-prefix-char] 2 "\ Set up variables for use f the terminal-emualtor. One should not call this -- it is an internal function of the terminal-emulator"]) (fset 'te-quote-arg-for-sh #[(fuckme) "\n\"\n\n\"\n!Ɖ \nGY\n# \nOP  \nO\nTOR TJ Q+" [string-match "\\`[a-zA-Z0-9-+=_.@/:]+\\'" fuckme "[$]" prin1-to-string "" 0 stupid cretin harder "[\"\\$]" nil "\\" "\""] 7])