;ELC ;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:51:59 2003 ;;; from file /home/pot/gnu/emacs-pretest.new/lisp/shell.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 "`shell.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\302\303\304\305\306\307\306\310&\210\302\311\304\312\306\303%\210\302\313\304\314\306\303%\207" [require comint custom-declare-group shell nil "Running shell from within Emacs buffers" :group processes unix shell-directories "Directory support in shell mode" shell-faces "Faces in shell buffers"] 8) #@281 Regexp to match shells that don't save their command history, and don't handle the backslash as a quote character. For shells that match this regexp, Emacs will write out the command history when the shell finishes, and won't remove backslashes when it unquotes shell arguments. (custom-declare-variable 'shell-dumb-shell-regexp '"cmd\\(proxy\\)?\\.exe" '(#$ . 940) :type 'regexp :group 'shell) #@526 Regexp to match prompts in the inferior shell. Defaults to "^[^#$%>\n]*[#$%>] *", which works pretty well. This variable is used to initialise `comint-prompt-regexp' in the shell buffer. This variable is only used if the variable `comint-use-prompt-regexp-instead-of-fields' is non-nil. The pattern should probably not match more than one line. If it does, Shell mode may become confused trying to distinguish prompt from input on lines which don't start with a prompt. This is a fine thing to set in your `.emacs' file. (custom-declare-variable 'shell-prompt-pattern '"^[^#$%>\n]*[#$%>] *" '(#$ . 1343) :type 'regexp :group 'shell) #@295 *List of suffixes to be disregarded during file/command completion. This variable is used to initialize `comint-completion-fignore' in the shell buffer. The default is nil, for compatibility with most shells. Some people like ("~" "#" "%"). This is a fine thing to set in your `.emacs' file. (custom-declare-variable 'shell-completion-fignore 'nil '(#$ . -1987) :type '(repeat (string :tag "Suffix")) :group 'shell) #@254 List of characters to recognise as separate arguments. This variable is used to initialize `comint-delimiter-argument-list' in the shell buffer. The value may depend on the operating system or shell. This is a fine thing to set in your `.emacs' file. (defvar shell-delimiter-argument-list '(124 38 60 62 40 41 59) (#$ . 2412)) #@234 String of characters valid in a file name. This variable is used to initialize `comint-file-name-chars' in the shell buffer. The value may depend on the operating system or shell. This is a fine thing to set in your `.emacs' file. (defvar shell-file-name-chars (byte-code "\301>\203\302\207\303\207" [system-type (ms-dos windows-nt) "~/A-Za-z0-9_^$!#%&{}@`'.,:()-" "~/A-Za-z0-9+@:_.$#%,={}-"] 2) (#$ . 2748)) #@245 List of characters to quote when in a file name. This variable is used to initialize `comint-file-name-quote-list' in the shell buffer. The value may depend on the operating system or shell. This is a fine thing to set in your `.emacs' file. (defvar shell-file-name-quote-list (byte-code "\302>?\205 \303 \304\"\207" [system-type shell-delimiter-argument-list (ms-dos windows-nt) append (32 42 33 34 39 96 35)] 3) (#$ . 3169)) #@194 List of functions called to perform completion. This variable is used to initialise `comint-dynamic-complete-functions' in the shell buffer. This is a fine thing to set in your `.emacs' file. (defvar shell-dynamic-complete-functions '(comint-replace-by-expanded-history shell-dynamic-complete-environment-variable shell-dynamic-complete-command shell-replace-by-expanded-directory comint-dynamic-complete-filename) (#$ . 3607)) #@121 *Regexp to match a single command within a pipeline. This is used for directory tracking and does not do a perfect job. (custom-declare-variable 'shell-command-regexp '"[^;&|\n]+" '(#$ . -4043) :type 'regexp :group 'shell) #@187 *If non-nil, use executable files only for completion candidates. This mirrors the optional behavior of tcsh. Detecting executability of files may slow command completion considerably. (custom-declare-variable 'shell-completion-execonly 't '(#$ . -4273) :type 'boolean :group 'shell) #@56 *Regexp to match subshell commands equivalent to popd. (custom-declare-variable 'shell-popd-regexp '"popd" '(#$ . -4564) :type 'regexp :group 'shell-directories) #@57 *Regexp to match subshell commands equivalent to pushd. (custom-declare-variable 'shell-pushd-regexp '"pushd" '(#$ . -4732) :type 'regexp :group 'shell-directories) #@112 *If non-nil, make pushd with no arg behave as "pushd ~" (like cd). This mirrors the optional behavior of tcsh. (custom-declare-variable 'shell-pushd-tohome 'nil '(#$ . -4904) :type 'boolean :group 'shell-directories) #@108 *If non-nil, make "pushd +n" pop the nth dir to the stack top. This mirrors the optional behavior of tcsh. (custom-declare-variable 'shell-pushd-dextract 'nil '(#$ . -5128) :type 'boolean :group 'shell-directories) #@111 *If non-nil, make pushd only add unique directories to the stack. This mirrors the optional behavior of tcsh. (custom-declare-variable 'shell-pushd-dunique 'nil '(#$ . -5350) :type 'boolean :group 'shell-directories) #@54 *Regexp to match subshell commands equivalent to cd. (custom-declare-variable 'shell-cd-regexp '"cd" '(#$ . -5573) :type 'regexp :group 'shell-directories) #@53 *If non-nil, is regexp used to track drive changes. (custom-declare-variable 'shell-chdrive-regexp '(if (memq system-type '(ms-dos windows-nt)) "[]a-zA-Z^_`\\[\\\\]:" nil) '(#$ . -5735) :type '(choice regexp (const nil)) :group 'shell-directories) #@124 *If non-nil, show the directory stack following directory change. This is effective only if directory tracking is enabled. (custom-declare-variable 'shell-dirtrack-verbose 't '(#$ . -5990) :type 'boolean :group 'shell-directories) #@75 *If non-nil, is file name to use for explicitly requested inferior shell. (custom-declare-variable 'explicit-shell-file-name 'nil '(#$ . -6227) :type '(choice (const :tag "None" nil) file) :group 'shell) #@113 *Args passed to inferior shell by M-x shell, if the shell is csh. Value is a list of strings, which may be nil. (custom-declare-variable 'explicit-csh-args '(if (eq system-type 'hpux) '("-i" "-T") '("-i")) '(#$ . -6438) :type '(repeat (string :tag "Argument")) :group 'shell) #@114 *Args passed to inferior shell by M-x shell, if the shell is bash. Value is a list of strings, which may be nil. (custom-declare-variable 'explicit-bash-args ''("--noediting" "-i") '(#$ . -6721) :type '(repeat (string :tag "Argument")) :group 'shell) #@452 *If non-nil, expand input command history references on completion. This mirrors the optional behavior of tcsh (its autoexpand and histlit). If the value is `input', then the expansion is seen on input. If the value is `history', then the expansion is only when inserting into the buffer's input ring. See also `comint-magic-space' and `comint-dynamic-complete'. This variable supplies a default for `comint-input-autoexpand', for Shell mode only. (custom-declare-variable 'shell-input-autoexpand ''history '(#$ . -6979) :type '(choice (const :tag "off" nil) (const input) (const history) (const :tag "on" t)) :group 'shell) #@119 List of directories saved by pushd in this buffer's shell. Thus, this does not include the shell's current directory. (defvar shell-dirstack nil (#$ . 7614)) #@64 Non-nil in a shell buffer means directory tracking is enabled. (defvar shell-dirtrackp t (#$ . 7778)) #@54 Keep track of last directory for ksh `cd -' command. (defvar shell-last-dir nil (#$ . 7886)) #@56 Command used by `shell-resync-dir' to query the shell. (defvar shell-dirstack-query nil (#$ . 7985)) (byte-code "\301B\303\301!\204\f\304 \204L\305 \n\244\306 \307\310#\210\306 \311\312#\210\306 \313\314#\210\306 \315\316#\210\306 \317\320\321\n\322\"!#\210\323\321 \324\"\325\326\327$\210\323\321 \330\"\331\332\333$\210\304\207" [current-load-list shell-mode-map comint-mode-map boundp nil make-sparse-keymap define-key "" shell-forward-command "" shell-backward-command " " comint-dynamic-complete "\277" comint-dynamic-list-filename-completions [menu-bar completion] copy-keymap lookup-key [menu-bar completion] define-key-after [menu-bar completion] [complete-env-variable] ("Complete Env. Variable Name" . shell-dynamic-complete-environment-variable) complete-file [menu-bar completion] [expand-directory] ("Expand Directory Reference" . shell-replace-by-expanded-directory) complete-expand] 7) #@35 *Hook for customising Shell mode. (custom-declare-variable 'shell-mode-hook ''nil '(#$ . -8902) :type 'hook :group 'shell) #@52 Additional expressions to highlight in Shell mode. (defvar shell-font-lock-keywords '(("[ ]\\([+-][^ \n]+\\)" 1 font-lock-comment-face) ("^[^ \n]+:.*" . font-lock-string-face) ("^\\[[1-9][0-9]*\\]" . font-lock-string-face)) (#$ . 9031)) (byte-code "\303\304\305\306#\210\301B\307\301!\204\310 \302B\307\302!\204\"\311\312\313\"\314B\315\314\313\"\210\303\304\316\317#\207" [current-load-list shell-mode-map shell-mode-syntax-table put shell-mode mode-class special boundp make-sparse-keymap make-char-table syntax-table nil shell-mode-abbrev-table define-abbrev-table derived-mode-parent comint-mode] 4) #@2732 Major mode for interacting with an inferior shell. \[comint-send-input] after the end of the process' output sends the text from the end of process to the end of the current line. \[comint-send-input] before end of process output copies the current line minus the prompt to the end of the buffer and sends it (\[comint-copy-old-input] just copies the current line). \[send-invisible] reads a line of text without echoing it, and sends it to the shell. This is useful for entering passwords. Or, add the function `comint-watch-for-password-prompt' to `comint-output-filter-functions'. If you want to make multiple shell buffers, rename the `*shell*' buffer using \[rename-buffer] or \[rename-uniquely] and start a new shell. If you want to make shell buffers limited in length, add the function `comint-truncate-buffer' to `comint-output-filter-functions'. If you accidentally suspend your process, use \[comint-continue-subjob] to continue it. `cd', `pushd' and `popd' commands given to the shell are watched by Emacs to keep this buffer's default directory the same as the shell's working directory. While directory tracking is enabled, the shell's working directory is displayed by \[list-buffers] or \[mouse-buffer-menu] in the `File' field. \[dirs] queries the shell and resyncs Emacs' idea of what the current directory stack is. \[dirtrack-mode] turns directory tracking on and off. \{shell-mode-map} Customization: Entry to this mode runs the hooks on `comint-mode-hook' and `shell-mode-hook' (in that order). Before each input, the hooks on `comint-input-filter-functions' are run. After each shell output, the hooks on `comint-output-filter-functions' are run. Variables `shell-cd-regexp', `shell-chdrive-regexp', `shell-pushd-regexp' and `shell-popd-regexp' are used to match their respective commands, while `shell-pushd-tohome', `shell-pushd-dextract' and `shell-pushd-dunique' control the behavior of the relevant command. Variables `comint-completion-autolist', `comint-completion-addsuffix', `comint-completion-recexact' and `comint-completion-fignore' control the behavior of file name, command name and variable name completion. Variable `shell-completion-execonly' controls the behavior of command name completion. Variable `shell-completion-fignore' is used to initialise the value of `comint-completion-fignore'. Variables `comint-input-ring-file-name' and `comint-input-autoexpand' control the initialisation of the input ring history, and history expansion. Variables `comint-output-filter-functions', a hook, and `comint-scroll-to-bottom-on-input' and `comint-scroll-to-bottom-on-output' control whether input and output cause the window to scroll to the end of the buffer. (defalias 'shell-mode #[nil "\306 \210\306\307N\203\310\311\307\312#\210\311\313\314\n!\204\315\n\316 \"\210\317 !\211\203.\f\320 =\2034\321 \322 \"\210) \203>\323\324 \"\210\325\n!\210\326 !\210;<=>?@ABCDEFG\327\330!\210=\327\331!\210\332\327\333!\210\334\327\335!\210\334\327\336!\210\312\337\340\341\334\312$\210HI\327\342!\210\343J!\"\344\345\346p!!@!K\347\350!\206\301K\351\230\203\265\352\202\301K\353\230\203\300\354\202\301\355\211L\356\232\204\324\357L!\357\360!\232\203\327\334LL\203\354\361MK\"\203\354\362\346p!\363\"\210K\364\230\203\367\365\202K\353\230\203\366\202\367N)\370\312!\210\371\372!\207" [major-mode mode-name shell-mode-map shell-mode-syntax-table parent local-abbrev-table comint-mode special put shell-mode t "Shell" keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table mapatoms #[(symbol) "\302\303! \"\206\304 \303!JK$\207" [symbol shell-mode-abbrev-table intern-soft symbol-name define-abbrev] 5] use-local-map set-syntax-table make-local-variable paragraph-start font-lock-defaults (shell-font-lock-keywords t) shell-dirstack nil shell-last-dir shell-dirtrackp add-hook comint-input-filter-functions shell-directory-tracker list-buffers-directory expand-file-name file-name-nondirectory process-command get-buffer-process getenv "HISTFILE" "bash" "~/.bash_history" "ksh" "~/.sh_history" "~/.history" "" file-truename "/dev/null" string-match set-process-sentinel shell-write-history-on-exit "sh" "pwd" "echo $PWD ~-" "dirs" comint-read-input-ring run-hooks shell-mode-hook shell-mode-abbrev-table shell-prompt-pattern comint-prompt-regexp shell-completion-fignore comint-completion-fignore shell-delimiter-argument-list comint-delimiter-argument-list shell-file-name-chars comint-file-name-chars shell-file-name-quote-list comint-file-name-quote-list shell-dynamic-complete-functions comint-dynamic-complete-functions shell-input-autoexpand comint-input-autoexpand default-directory shell comint-input-ring-file-name shell-dumb-shell-regexp shell-dirstack-query] 6 (#$ . 9657) nil]) #@331 Called when the shell process is stopped. Writes the input history to a history file `comint-input-ring-file-name' using `comint-write-input-ring' and inserts a short message in the shell buffer. This function is a sentinel watching the shell interpreter process. Sentinels will always get the two parameters PROCESS and EVENT. (defalias 'shell-write-history-on-exit #[(process event) "\303 \210\304!\305 !\205r q\210\306\307\n#c))\207" [process buf event comint-write-input-ring process-buffer buffer-live-p format "\nProcess %s %s\n"] 4 (#$ . 14555)]) #@1458 Run an inferior shell, with I/O through BUFFER (which defaults to `*shell*'). Interactively, a prefix arg means to prompt for BUFFER. If BUFFER exists but shell process is not running, make new shell. If BUFFER exists and shell process is running, just switch to BUFFER. Program used comes from variable `explicit-shell-file-name', or (if that is nil) from the ESHELL environment variable, or else from SHELL if there is no ESHELL. If a file `~/.emacs_SHELLNAME' exists, it is given as initial input (Note that this may lose due to a timing error if the shell discards input when it starts up.) The buffer is put in Shell mode, giving commands for sending input and controlling the subjobs of the shell. See `shell-mode'. See also the variable `shell-prompt-pattern'. To specify a coding system for converting non-ASCII characters in the input and output to the shell, use \[universal-coding-system-argument] before \[shell]. You can also specify this with \[set-buffer-process-coding-system] in the shell buffer, after you start the shell. The default comes from `process-coding-system-alist' and `default-process-coding-system'. The shell file name (sans directories) is used to make a symbol name such as `explicit-csh-args'. If that symbol is a variable, its value is used as a list of arguments when invoking the shell. Otherwise, one argument `-i' is passed to the shell. (Type \[describe-mode] in the shell buffer for a list of commands.) (defalias 'shell #[(&optional buffer) "\204\306\307!\204^ \206\310\311!\206\310\312!\206\313\314\n!\315 P\316\317 \320Q!\321\212\322\323\324\n\325\f!\205=\f \203L\326 !\203L J\202M\327&q\210p\330 \210)\331!-\207\331!\207" [buffer explicit-shell-file-name prog name startfile xargs-name "*shell*" comint-check-proc getenv "ESHELL" "SHELL" "/bin/sh" file-name-nondirectory "~/.emacs_" intern-soft "explicit-" "-args" nil apply make-comint-in-buffer "shell" file-exists-p boundp ("-i") shell-mode pop-to-buffer shell-buffer] 8 (#$ . 15124) (list (and current-prefix-arg (read-buffer "Shell buffer: " "*shell*")))]) #@665 Tracks cd, pushd and popd commands issued to the shell. This function is called on each input passed to the shell. It watches for cd, pushd and popd commands and sets the buffer's default directory to track these commands. You may toggle this tracking on and off with M-x dirtrack-mode. If emacs gets confused, you can resync with the shell with M-x dirs. See variables `shell-cd-regexp', `shell-chdrive-regexp', `shell-pushd-regexp', and `shell-popd-regexp', while `shell-pushd-tohome', `shell-pushd-dextract', and `shell-pushd-dunique' control the behavior of the relevant command. Environment variables are expanded, see function `substitute-in-file-name'. (defalias 'shell-directory-tracker #[(str) "\205\301\302\303\217\207" [shell-dirtrackp chdir-failure (byte-code "\306\307\"\210\310\225\311\211\211\306 \f#\205\221\310\225\312\f O\310\211#\312\f O\313\211#\211\2033\314 !\306\315\316Q\n\"\203G\317\320 !!\210\202\205\306\315\316Q\n\"\203[\321\320 !!\210\202\205\306\315\316Q\n\"\203o\322\320 !!\210\202\205\203\205\306\315\316Q\n\"\203\205\322\320\n!!\210\306\323 #\210\310\225\202,\207" [str arg1 cmd end start shell-command-regexp string-match "^[; ]*" 0 nil comint-arguments 1 shell-unquote-argument "\\`\\(" "\\)\\($\\|[ ]\\)" shell-process-popd comint-substitute-in-file-name shell-process-pushd shell-process-cd "[; ]*" shell-popd-regexp shell-pushd-regexp shell-cd-regexp shell-chdrive-regexp] 5) ((error "Couldn't cd"))] 3 (#$ . 17229)]) #@48 Remove all kinds of shell quoting from STRING. (defalias 'shell-unquote-argument #[(string) "\306 \307\216\310\311\211\312 \313\314\315p!!@!\"\203\316\202\317 GW\203\200\312\n\f#\211\203\200\fH\320U\203J\321\322\311\211$\fT\202 \203e\fH U\203e\321\322\311\211$\311\202 \203o\fT\202\fH\321\322\311\211$\202.\207" [save-match-data-internal shell-dumb-shell-regexp quote-chars inside next idx match-data ((set-match-data save-match-data-internal)) 0 nil string-match file-name-nondirectory process-command get-buffer-process "['`\"]" "[\\'`\"]" 92 replace-match "" string] 9 (#$ . 18736)]) (defalias 'shell-process-popd #[(arg) "\305!\206\306\211\203# \306U\203#\n\203#\307\n@!\210\nA\310 \202O \203L \306V\203L \nGX\203L\311\nB S \233\211\211AA\241\210 A\310 *\202O\312\313!)\207" [arg num shell-dirstack ds cell shell-extract-num 0 shell-cd shell-dirstack-message nil error "Couldn't popd"] 3]) (defalias 'shell-prefixed-directory-name #[(dir) "G\302U\203 \207\303 !\203 P\207\304 !\207" [comint-file-name-prefix dir 0 file-name-absolute-p expand-file-name] 2]) (defalias 'shell-process-cd #[(arg) "\305G!\203 \306P\202\307\230\203\n\202\310!\f\311 !\210\312 )\207" [arg comint-file-name-prefix shell-last-dir new-dir default-directory zerop "~" "-" shell-prefixed-directory-name shell-cd shell-dirstack-message] 2]) (defalias 'shell-process-pushd #[(arg) "\306!\307G!\2035\n\203\310 \311P!\202\304\f\203/ \312\f@!\210\fAB\313 )\202\304\314\315!\202\304 \247\203\247 \fGV\203G\314\316!\202\304 \317U\203U\320\314\321!!\202\304\203s S\f8\322!\210\310 !\210\312!\210\313 )\202\304 \fB\211G \233\323 Z\323!\233!\324\"\312@!\210A\313 -\202\304 \312\325!!\210\203\274\f\235\204\301\fB\313 ))\207" [arg num shell-pushd-tohome comint-file-name-prefix shell-dirstack default-directory shell-extract-num zerop shell-process-pushd "~" shell-cd shell-dirstack-message message "Directory stack empty." "Directory stack not that deep." 0 error "Couldn't cd" shell-process-popd reverse append shell-prefixed-directory-name old shell-pushd-dextract dir ds dslen front back new-ds old-wd shell-pushd-dunique] 5]) (defalias 'shell-extract-num #[(str) "\301\302\"\205\n\303!\207" [str string-match "^\\+[1-9][0-9]*$" string-to-int] 3]) #@55 Turn directory tracking on and off in a shell buffer. (defalias 'shell-dirtrack-mode #[nil "?\211\203\f \202\303\304\305\203\306\202\307\"\207" [shell-dirtrackp default-directory list-buffers-directory nil message "Directory tracking %s" "ON" "OFF"] 3 (#$ . 21117) nil]) (byte-code "\300\301\302\"\210\300\303\302\"\210\300\304\302\"\207" [defalias shell-dirtrack-toggle shell-dirtrack-mode dirtrack-toggle dirtrack-mode] 3) #@58 Do normal `cd' to DIR, and set `list-buffers-directory'. (defalias 'shell-cd #[(dir) "\203\n\303\304 !!\305 !\207" [shell-dirtrackp dir list-buffers-directory file-name-as-directory expand-file-name cd] 3 (#$ . 21560)]) #@495 Resync the buffer's idea of the current directory stack. This command queries the shell with the command bound to `shell-dirstack-query' (default "dirs"), reads the next line output and parses it to form the new directory stack. DON'T issue this command unless the buffer is at a shell prompt. Also, note that if some other subprocess decides to do output immediately after the query, its output will be taken as the new directory stack -- you lose. If this happens, just do the command again. (defalias 'shell-resync-dirs #[nil "\306p!\307!\211b\210\nc\210\310c\210\311\312!\210\313\n\"\210\313\310\"\210 `\314\223\210`\310c\210\315u\210\316\317!\204<\320!\210 b\210\202,) b\210\321\322!\210\312\224\312\225S{\211G\314\312\312 W\203w\323\324\f#\210\f\322\224\322\225OPB\312\225\211\202U\237\314\325\326\217.\207" [proc pmark shell-dirstack-query pt dl dl-len get-buffer-process process-mark "\n" sit-for 0 comint-send-string nil -1 looking-at ".+\n" accept-process-output delete-char 1 string-match "\\s *\\(\\S +\\)\\s *" (byte-code "\303@!\210A\211@\304 \207" [ds shell-dirstack shell-last-dir shell-cd shell-dirstack-message] 3) ((error (message "Couldn't cd"))) ds i comint-file-name-prefix] 5 (#$ . 21790) nil]) (defalias 'dirs 'shell-resync-dirs) (defalias 'shell-dirstack-message #[nil "\205x\306\n B\307 \310P!\211G\f\203s\f@\211GY\203;\311O\230\203;\310\312OP \203dG GY\203d \311 GO\230\203d G\312O\211\203d\f\240\210 \313!\314Q\fA)\202\315\316 \",\207" [shell-dirtrack-verbose msg default-directory shell-dirstack ds comint-file-name-prefix "" expand-file-name "~/" 0 nil directory-file-name " " message "%s" home homelen dir] 5]) #@67 Return as a string the shell's value of environment variable VAR. (defalias 'shell-snarf-envar #[(var) "\305\306\"\307p!\310\n!\211b\210 c\210\311\312!\210\313\n \"\210 `\314\223\210`\315c\210\316u\210\317\320!\2049\321\n!\210\fb\210\202)) b\210\322\323!\210\312\224\312\225S{+\207" [var cmd proc pmark pt format "printenv '%s'\n" get-buffer-process process-mark sit-for 0 comint-send-string nil "\n" -1 looking-at ".+\n" accept-process-output delete-char 1] 4 (#$ . 23521)]) #@334 Copy the environment variable VARIABLE from the subshell to Emacs. This command reads the value of the specified environment variable in the shell, and sets the same environment variable in Emacs (what `getenv' in Emacs would return) to that value. That value will affect any new subprocesses that you subsequently start from Emacs. (defalias 'shell-copy-environment-variable #[(variable) "\301\302!\"\207" [variable setenv shell-snarf-envar] 4 (#$ . 24011) (list (read-envvar-name "Copy Shell environment variable to Emacs: "))]) #@94 Move forward across ARG shell command(s). Does not cross lines. See `shell-command-regexp'. (defalias 'shell-forward-command #[(&optional arg) "\212\303\210`)\304 \305P\306\n$\205\307\310!)\207" [limit shell-command-regexp arg nil re-search-forward "\\([;&|][ ]*\\)+" move skip-syntax-backward " "] 5 (#$ . 24550) "p"]) #@95 Move backward across ARG shell command(s). Does not cross lines. See `shell-command-regexp'. (defalias 'shell-backward-command #[(&optional arg) "\212\303\304!\210`)\211`V\203\305 \306\307\"\210\310\311\312 \"\313\n$\205)\314\224b\210\315\304w)\207" [limit shell-command-regexp arg comint-bol nil line-beginning-position skip-syntax-backward " " re-search-backward format "[;&|]+[ ]*\\(%s\\)" move 1 ";&|"] 6 (#$ . 24883) "p"]) #@458 Dynamically complete the command at point. This function is similar to `comint-dynamic-complete-filename', except that it searches `exec-path' (minus the trailing emacs library path) for completion candidates. Note that this may not be the same as the shell's idea of the path. Completion is dependent on the value of `shell-completion-execonly', plus those that effect file completion. See `shell-dynamic-complete-as-command'. Returns t if successful. (defalias 'shell-dynamic-complete-command #[nil "\302 \211\205(\303 \304\216\305\306\"*?\205(\307\224\212\310\311!\210`)=\205(\312\313!\210\314 )\207" [filename save-match-data-internal comint-match-partial-filename match-data ((set-match-data save-match-data-internal)) string-match "[~/]" 0 shell-backward-command 1 message "Completing command name..." shell-dynamic-complete-as-command] 4 (#$ . 25327) nil]) #@110 Dynamically complete at point as a command. See `shell-dynamic-complete-filename'. Returns t if successful. (defalias 'shell-dynamic-complete-as-command #[nil "\306 \206\307\310!\311\n!A\312\313\f!!\205!\314\315\316#\307\317\307\307\317 \203\247\312\320 @\206>\321!!\322!\205N\323 \"\211\203\240@P \235\204\227\203v\324\"\204\227 \230\204\204\325!\204\227!\203\220\326!\203\227 B A\211\204T A\211\2046\317\"\327  \")\211#\330>\203\307\"\203\307\325\306 !\204\307\331c\210#. \207" [filename pathnondir exec-path paths default-directory cwd comint-match-partial-filename "" file-name-nondirectory reverse file-name-as-directory expand-file-name mapconcat #[(x) "\301!\302P\207" [x regexp-quote "$"] 2] "\\|" nil comint-directory "." file-accessible-directory-p file-name-all-completions string-match file-directory-p file-executable-p comint-dynamic-simple-complete (sole shortest) " " comint-completion-fignore ignored-extensions path comps-in-path file filepath completions shell-completion-execonly comint-completion-addsuffix success] 5 (#$ . 26208)]) #@62 Return the shell variable at point, or nil if none is found. (defalias 'shell-match-partial-variable #[nil "\212`\301\302\303\304#\203\305\306!\204\307u\210l\206\305\310!?\205)\311\312\"\210\313\224\313\225{*\207" [limit re-search-backward "[^A-Za-z0-9_{}]" nil move looking-at "\\$" 1 "[^A-Za-z0-9_{}$]" re-search-forward "\\$?{?[A-Za-z0-9_]*}?" 0] 4 (#$ . 27358)]) #@738 Dynamically complete the environment variable at point. Completes if after a variable, i.e., if it starts with a "$". See `shell-dynamic-complete-as-environment-variable'. This function is similar to `comint-dynamic-complete-filename', except that it searches `process-environment' for completion candidates. Note that this may not be the same as the interpreter's idea of variable names. The main problem with this type of completion is that `process-environment' is the environment which Emacs started with. Emacs does not track changes to the environment made by the interpreter. Perhaps it would be more accurate if this function was called `shell-dynamic-complete-process-environment-variable'. Returns non-nil if successful. (defalias 'shell-dynamic-complete-environment-variable #[nil "\301 \211\205\302\303\"\205\304\305!\210\306 )\207" [variable shell-match-partial-variable string-match "^\\$" message "Completing variable name..." shell-dynamic-complete-as-environment-variable] 4 (#$ . 27741) nil]) #@153 Dynamically complete at point as an environment variable. Used by `shell-dynamic-complete-environment-variable'. Uses `comint-dynamic-simple-complete'. (defalias 'shell-dynamic-complete-as-environment-variable #[nil "\306 \206\307\211\310\311\"\206\312\313O\314\315\n\"\f\313\316 \"\211\317>\203m\306 \211\310\320\"\313O\310\321\"\203>\322\202J\310\323\"\203I\324\202J\307 \204T\307\202c\325\326\327 !!!\203b\330\202c\331\261\210,.\207" [var variable process-environment variables comint-completion-addsuffix addsuffix shell-match-partial-variable "" string-match "[^$({]\\|$" 0 nil mapcar #[(x) "\301\302\303\"O\207" [x 0 string-match "="] 5] comint-dynamic-simple-complete (sole shortest) "[^$({]" "{" "}" "(" ")" file-directory-p comint-directory getenv "/" " " success protection suffix] 5 (#$ . 28771)]) #@181 Expand directory stack reference before point. Directory stack references are of the form "=digit" or "=-". See `default-directory' and `shell-dirstack'. Returns t if successful. (defalias 'shell-replace-by-expanded-directory #[nil "\304 \205M\212\305\224b\210 B\306\307!\203 G\202%\306\310!\205%\311\312\224\312\225{!\n\204/\313\202L\n GY\203<\314\315!\202L\316\317\n 8!\320\211#\210\321\322\n\"\210\320+\207" [default-directory shell-dirstack index stack comint-match-partial-filename 0 looking-at "=-/?" "=\\([0-9]+\\)" string-to-number 1 nil error "Directory stack not that deep" replace-match file-name-as-directory t message "Directory item: %d"] 4 (#$ . 29628) nil]) (provide 'shell)