;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:41:06 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/eshell/esh-proc.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`esh-proc.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\302\303\304\305\306\307\310\311&\207" [provide esh-proc custom-declare-group eshell-proc nil "When Eshell invokes external commands, it always does so\nasynchronously, so that Emacs isn't tied up waiting for the process to\nfinish." :tag "Process management" :group eshell] 8)
#@53 *A hook that gets run when `eshell-proc' is loaded.
(custom-declare-variable 'eshell-proc-load-hook ''(eshell-proc-initialize) '(#$ . -929) :type 'hook :group 'eshell-proc)
#@68 *The number of seconds to delay waiting for a synchronous process.
(custom-declare-variable 'eshell-process-wait-seconds '0 '(#$ . -1108) :type 'integer :group 'eshell-proc)
#@73 *The number of milliseconds to delay waiting for a synchronous process.
(custom-declare-variable 'eshell-process-wait-milliseconds '50 '(#$ . -1288) :type 'integer :group 'eshell-proc)
#@65 *If non-nil, subjob "Done" messages will display in minibuffer.
(custom-declare-variable 'eshell-done-messages-in-minibuffer 't '(#$ . -1479) :type 'boolean :group 'eshell-proc)
#@739 *If nil, process entries will stick around until `jobs' is run.
This variable sets the buffer-local value of `delete-exited-processes'
in Eshell buffers.

This variable causes Eshell to mimic the behavior of bash when set to
nil.  It allows the user to view the exit status of a completed subjob
(process) at their leisure, because the process entry remains in
memory until the user examines it using \[list-processes].

Otherwise, if `eshell-done-messages-in-minibuffer' is nil, and this
variable is set to t, the only indication the user will have that a
subjob is done is that it will no longer appear in the
\[list-processes\] display.

Note that Eshell will have to be restarted for a change in this
variable's value to take effect.
(custom-declare-variable 'eshell-delete-exited-processes 't '(#$ . -1664) :type 'boolean :group 'eshell-proc)
#@75 *If a termination signal matches this regexp, the terminal will be reset.
(custom-declare-variable 'eshell-reset-signals '"^\\(interrupt\\|killed\\|quit\\|stopped\\)" '(#$ . -2518) :type 'regexp :group 'eshell-proc)
#@363 *Called each time a process is exec'd by `eshell-gather-process-output'.
It is passed one argument, which is the process that was just started.
It is useful for things that must be done each time a process is
executed in a eshell mode buffer (e.g., `process-kill-without-query').
In contrast, `eshell-mode-hook' is only executed once when the buffer
is created.
(custom-declare-variable 'eshell-exec-hook 'nil '(#$ . -2741) :type 'hook :group 'eshell-proc)
#@368 *Called when a process run by `eshell-gather-process-output' has ended.
It is passed two arguments: the process that was just ended, and the
termination status (as a string).  Note that the first argument may be
nil, in which case the user attempted to send a signal, but there was
no relevant process.  This can be used for displaying help
information, for example.
(custom-declare-variable 'eshell-kill-hook ''(eshell-reset-after-proc) '(#$ . -3205) :type 'hook :group 'eshell-proc)
(byte-code "\301B\302\301!\204\f \303\303\207" [current-load-list eshell-current-subjob-p boundp nil] 2)
#@47 A list of the current status of subprocesses.
(defvar eshell-process-list nil (#$ . 3804))
#@39 Initialize the process handling code.
(defalias 'eshell-proc-initialize #[nil "\301\302!\210\303\304\305#\210\303\306\307#\210\303\310\311#\210\303\312\313#\210\303\314\315#\210\303\316\317#\207" [eshell-command-map make-local-variable eshell-process-list define-key [(meta 105)] eshell-insert-process [(control 99)] eshell-interrupt-process [(control 107)] eshell-kill-process [(control 100)] eshell-send-eof-to-process [(control 115)] list-processes [(control 92)] eshell-quit-process] 4 (#$ . 3901)])
#@145 Reset the command input location after a process terminates.
The signals which will cause this to happen are matched by
`eshell-reset-signals'.
(defalias 'eshell-reset-after-proc #[(proc status) ";\205A \306	\"\205A \307db\210\310 \310 \310 `\310 \212b\210n\2063 \311\312\307\"))\210\n?\205@ \313\314!\210db)\207" [status eshell-reset-signals no-hooks eshell-last-input-start eshell-last-input-end eshell-last-output-start string-match nil point-marker "\n" eshell-output-filter run-hooks eshell-post-command-hook eshell-last-output-block-begin eshell-last-output-end string] 3 (#$ . 4418)])
#@45 Wait until PROC has successfully completed.
(defalias 'eshell-wait-for-process #[(&rest procs) "\2055 @\211\305\306!\205 \306	!)\203, 	\n\236\203, \307 \203$ \310 \210\311\f\"\210\202 )A\211\204 \312\207" [procs proc eshell-process-list eshell-process-wait-seconds eshell-process-wait-milliseconds fboundp processp input-pending-p discard-input sit-for nil] 4 (#$ . 5032)])
(defalias 'eshell/wait 'eshell-wait-for-process)
#@35 List processes, if there are any.
(defalias 'eshell/jobs #[(&rest args) "\300\301!\205 \301 \205 \302 \207" [fboundp process-list list-processes] 2 (#$ . 5471)])
#@43 Kill processes, buffers, symbol or files.
(defalias 'eshell/kill #[(&rest args) "\306\211\2034 \n@\307\310!\205 \310!)\204& \n@;\203- \311\312\n@\"\203- \n\313\n@!\240\210\nA\211\204 \203\306 @\307\310!\205D \310!)\203O \314@!\202Q @\211\203\276 \f\204a \315\316!\210\202\276 \f\247\203t \f\317U\203t \315\320\f\"\210\202\276 \f;\203\211 \311\321\f\"\203\211 \322\323\f!!\202\276 \f;\203\254 \324\311\325\f\"\203\243 \326\327\330\331\f\"P!\202\250 \315\332\f\"\210)\202\276 \f\317W\203\271 \322\f!\202\276 \333\f	\"\210)A\211\2048 *\324\207" [args signum ptr proc id case-fold-search SIGINT fboundp processp string-match "^[A-Za-z/][A-Za-z0-9<>/]+$" get-process process-id error "kill: bad signal spec" 0 "kill: bad signal spec `%d'" "^-?[0-9]+$" abs string-to-number nil "^-\\([A-Z]+\\)$" intern "SIG" match-string 1 "kill: bad signal spec `%s'" signal-process] 6 (#$ . 5641)])
#@101 Read the name of a process from the minibuffer, using completion.
The prompt will be set to PROMPT.
(defalias 'eshell-read-process-name #[(prompt) "\301\302\303\304 \"\305\306$\207" [prompt completing-read mapcar #[(proc) "\301!\302B\207" [proc process-name t] 2] process-list nil t] 5 (#$ . 6548)])
#@62 Insert the name of PROCESS into the current buffer at point.
(defalias 'eshell-insert-process #[(process) "\301\302\303!\304#\207" [process insert-and-inherit "#<process " process-name ">"] 4 (#$ . 6856) (list (get-process (eshell-read-process-name "Name of process: ")))])
#@31 Record OBJECT as now running.
(defalias 'eshell-record-process-object #[(object) "\306\307!\205 \307	!)\203# \n\203# \310\311\312!\313!#\314\315\"\210)\f\n\315\211\257B\211\207" [object proc eshell-current-subjob-p string eshell-current-handles eshell-process-list fboundp processp format "[%s] %d\n" process-name process-id eshell-output-filter nil] 5 (#$ . 7137)])
(put 'eshell-record-process-object 'byte-optimizer 'byte-compile-inline-expand)
#@46 Record the process ENTRY as fully completed.
(defalias 'eshell-remove-process-entry #[(entry) "@\304\305!\205\f \305	!)\203( \3068\203( \n\203( \307\310\311\312@!\313@!#!\210\314\"\211\207" [entry proc eshell-done-messages-in-minibuffer eshell-process-list fboundp processp 2 message format "[%s]+ Done %s" process-name process-command delq] 6 (#$ . 7601)])
#@51 Scratch buffer for holding Eshell's input/output.
(defvar eshell-scratch-buffer " *eshell-scratch*" (#$ . 7973))
#@132 A marker that tracks the beginning of output of the last subprocess.
Used only on systems which do not support async subprocesses.
(defvar eshell-last-sync-output-start nil (#$ . 8093))
#@40 Gather the output from COMMAND + ARGS.
(defalias 'eshell-gather-process-output #[(command args) "\306!\203\f \307!\204 \310\311\"\210	\203 \n\202 \312 \313\3136\3137\3138\314\315!\203\345 \316\315\317!\313\320\321!C9\"$\211\211:\314\322!\205M \322!)\203i 	\203i \323\324\325:!\326:!#;\327\313;\"\210):<	\313\211\257=B=)\330p\"\210\331 \203\212 \332\327\"\210\202\217 \332\333\"\210\334\335\"\210\336\337\"\210\314\340!\203\263\340!\211>@6>A7)\341\3426!!\203\301 \3436\344\"6\34586\203\325 7\204\325 \3436\346\"7\34588\203\263\34767#\210\202\263p\331 \313\211\211\211\211?@ABCDE\350F!\204\351 F\352G!q@\353 \210Eq\210\336\337\"\210\316\354\320F`\345G\313\2579\"\"?H\2037F`\313\223\210?\247\203@q\210eb\210`C\355y\356=\203{`B\357CB\"AEq\210D\203k\327\313A\"\210\202p\360A!\210BC@q\210\202GEq\210\361I!\210\362?\247\203\220?\202\221\363!\210\336\364?#\210H\204\242\313F?\247\204\257\310\365?#\210\345..\207" [command eshell-current-subjob-p eshell-delete-exited-processes delete-exited-processes process-environment proc file-executable-p file-regular-p error "%s: not an executable file" eshell-environment-variables nil fboundp start-process apply file-name-nondirectory append expand-file-name processp format "[%s] %d\n" process-name process-id eshell-output-filter set-process-buffer eshell-interactive-output-p set-process-filter eshell-insertion-filter set-process-sentinel eshell-sentinel run-hook-with-args eshell-exec-hook process-coding-system vectorp coding-system-eol-type coding-system-change-eol-conversion dos t unix set-process-coding-system markerp point-marker get-buffer-create erase-buffer call-process-region 1 0 buffer-substring-no-properties eshell-output-object eshell-update-markers eshell-close-handles -1 eshell-kill-hook "%s: external command failed: %s" decoding encoding changed args object string eshell-current-handles eshell-process-list coding-systems exit-status proc-buf line lend lbeg interact-p oldbuf eshell-last-sync-output-start eshell-scratch-buffer eshell-in-pipeline-p eshell-last-output-end] 10 (#$ . 8285)])
#@144 Insert a string into the eshell buffer, or a process/file/buffer.
PROC is the process for which we're inserting output.  STRING is the
output.
(defalias 'eshell-insertion-filter #[(proc string) "\306\307!!\205R \307!q\210	\236\211\205Q \310\n\233\310\n8P\240\210\311\n8?\205Q \310\n8\205Q \310\n8\310\n\233\312\240\210\311\n\233\313\240\210\314\f\312\n\211A@)#\210\311\n\233\312\240\210)\202& )\207" [proc eshell-process-list entry string data x buffer-live-p process-buffer 3 4 nil t eshell-output-object] 5 (#$ . 10462)])
#@129 Generic sentinel for command processes.  Reports only signals.
PROC is the process that's exiting.  STRING is the exit message.
(defalias 'eshell-sentinel #[(proc string) "\305\306!!\205: \306!q\210\307\216	\236\211\2059 \310\216\311\230?\2058 \312\313\"\204, \314\"\210\315\316!\317\n\211A@)#)*\207" [proc eshell-process-list entry string x buffer-live-p process-buffer ((byte-code "\302\303	#\207" [proc string run-hook-with-args eshell-kill-hook] 4)) ((eshell-remove-process-entry entry)) "run" string-match "^\\(finished\\|exited\\)" eshell-insertion-filter eshell-close-handles process-exit-status nil] 5 (#$ . 11000)])
#@208 Interact with a process, using PROMPT if more than one, via FUNC.
If ALL is non-nil, background processes will be interacted with as well.
If QUERY is non-nil, query the user with QUERY before calling FUNC.
(defalias 'eshell-process-interact #[(func &optional all query) "\306\211\n\211\203M @\307\f@!\310>\2038 \204  \311\f8\2048 \2032 \312\313\314\f@!\"!\2038 \f@!\307\f@!\315>\204E \f	B)A\211\204\n )	\211\203e @\316!\210)A\211\204T )*\207" [result defunct eshell-process-list list-iter entry all nil process-status (run stop open closed) 2 y-or-n-p format process-name (run stop open closed) eshell-remove-process-entry query func d] 6 (#$ . 11643)])
#@71 *Seconds to wait between sending termination signals to a subprocess.
(custom-declare-variable 'eshell-kill-process-wait-time '5 '(#$ . -12329) :type 'integer :group 'eshell-proc)
#@297 *Signals used to kill processes when an Eshell buffer exits.
Eshell calls each of these signals in order when an Eshell buffer is
killed; if the process is still alive afterwards, Eshell waits a
number of seconds defined by `eshell-kill-process-wait-time', and
tries the next signal in the list.
(custom-declare-variable 'eshell-kill-process-signals ''(SIGINT SIGQUIT SIGKILL) '(#$ . -12516) :type '(repeat symbol) :group 'eshell-proc)
#@652 *If non-nil, kill active processes when exiting an Eshell buffer.
Emacs will only kill processes owned by that Eshell buffer.

If nil, ownership of background and foreground processes reverts to
Emacs itself, and will die only if the user exits Emacs, calls
`kill-process', or terminates the processes externally.

If `ask', Emacs prompts the user before killing any processes.

If `every', it prompts once for every process.

If t, it kills all buffer-owned processes without asking.

Processes are first sent SIGHUP, then SIGINT, then SIGQUIT, then
SIGKILL.  The variable `eshell-kill-process-wait-time' specifies how
long to delay between signals.
(custom-declare-variable 'eshell-kill-processes-on-exit 'nil '(#$ . -12959) :type '(choice (const :tag "Kill all, don't ask" t) (const :tag "Ask before killing" ask) (const :tag "Ask for each process" every) (const :tag "Don't kill subprocesses" nil)) :group 'eshell-proc)
#@111 Kill current process by trying various signals in sequence.
See the variable `eshell-kill-processes-on-exit'.
(defalias 'eshell-round-robin-kill #[(&optional query) "\211\205$ \305\306\307\n#\210\310\204 \310\211\202 \311\f!\210	A\211\204 \310)\207" [eshell-kill-process-signals sigs query eshell-process-list eshell-kill-process-wait-time eshell-process-interact #[(proc) "\302\303!	@\"\207" [proc sigs signal-process process-id] 3] t nil sleep-for] 5 (#$ . 13890)])
#@75 Kill processes belonging to the current Eshell buffer, possibly w/ query.
(defalias 'eshell-query-kill-processes #[nil "\205\n 	\205\n \302\213\207" [eshell-kill-processes-on-exit eshell-process-list ((byte-code "\302 \210\303=\203 \304\305\306\307 \"!\203 \310\311=\205 \312!\210\313\314!\211\203/ \315	!\203/ \316	!\210)\317\320!\207" [eshell-kill-processes-on-exit buf list-processes ask y-or-n-p format "Kill processes owned by `%s'? " buffer-name eshell-round-robin-kill every "Kill Eshell child process `%s'? " get-buffer "*Process List*" buffer-live-p kill-buffer message nil] 5))] 1 (#$ . 14374)])
(custom-add-option 'eshell-exit-hook 'eshell-query-kill-processes)
#@22 Interrupt a process.
(defalias 'eshell-interrupt-process #[nil "\300\301!?\205\f \302\303\304\305#\207" [eshell-process-interact interrupt-process run-hook-with-args eshell-kill-hook nil "interrupt"] 4 (#$ . 15060) nil])
#@17 Kill a process.
(defalias 'eshell-kill-process #[nil "\300\301!?\205\f \302\303\304\305#\207" [eshell-process-interact kill-process run-hook-with-args eshell-kill-hook nil "killed"] 4 (#$ . 15287) nil])
#@30 Send quit signal to process.
(defalias 'eshell-quit-process #[nil "\300\301!?\205\f \302\303\304\305#\207" [eshell-process-interact quit-process run-hook-with-args eshell-kill-hook nil "quit"] 4 (#$ . 15496) nil])
#@22 Send EOF to process.
(defalias 'eshell-send-eof-to-process #[nil "\300\301\211\302#\210\303\304!\207" [eshell-send-input nil t eshell-process-interact process-send-eof] 4 (#$ . 15716) nil])
