;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:21:09 2007 ;;; from file /home/cyd/emacs/lisp/shell.el ;;; in Emacs version 22.0.99 ;;; 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" '(#$ . 888) :type 'regexp :group 'shell) #@600 Regexp to match prompts in the inferior shell. Defaults to "^[^#$%>\n]*[#$%>] *", which works pretty well. This variable is used to initialize `comint-prompt-regexp' in the shell buffer. If `comint-use-prompt-regexp' is nil, then this variable is only used to determine paragraph boundaries. See Info node `Shell Prompts' for how Shell mode treats paragraphs. 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]*[#$%>] *" '(#$ . 1291) :type 'regexp :group 'shell) #@294 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 '(#$ . 2009) :type '(repeat (string :tag "Suffix")) :group 'shell) #@254 List of characters to recognize 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) (#$ . 2432)) #@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 cygwin) "~/A-Za-z0-9_^$!#%&{}@`'.,:()-" "[]~/A-Za-z0-9+@:_.$#%,={}-"] 2) (#$ . 2768)) #@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 92)] 3) (#$ . 3198)) #@194 List of functions called to perform completion. This variable is used to initialize `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) (#$ . 3639)) #@120 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]+" '(#$ . 4075) :type 'regexp :group 'shell) #@120 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-separator-regexp '"[;&|\n ]*" '(#$ . 4303) :type 'regexp :group 'shell) #@186 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 '(#$ . 4542) :type 'boolean :group 'shell) #@55 Regexp to match subshell commands equivalent to popd. (custom-declare-variable 'shell-popd-regexp '"popd" '(#$ . 4831) :type 'regexp :group 'shell-directories) #@56 Regexp to match subshell commands equivalent to pushd. (custom-declare-variable 'shell-pushd-regexp '"pushd" '(#$ . 4997) :type 'regexp :group 'shell-directories) #@111 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 '(#$ . 5167) :type 'boolean :group 'shell-directories) #@107 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 '(#$ . 5389) :type 'boolean :group 'shell-directories) #@110 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 '(#$ . 5609) :type 'boolean :group 'shell-directories) #@53 Regexp to match subshell commands equivalent to cd. (custom-declare-variable 'shell-cd-regexp '"cd" '(#$ . 5830) :type 'regexp :group 'shell-directories) #@52 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) '(#$ . 5990) :type '(choice regexp (const nil)) :group 'shell-directories) #@123 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 '(#$ . 6243) :type 'boolean :group 'shell-directories) #@74 If non-nil, is file name to use for explicitly requested inferior shell. (custom-declare-variable 'explicit-shell-file-name 'nil '(#$ . 6478) :type '(choice (const :tag "None" nil) file) :group 'shell) #@111 Args passed to inferior shell by \[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")) '(#$ . 6687) :type '(repeat (string :tag "Argument")) :group 'shell) #@112 Args passed to inferior shell by \[shell], if the shell is bash. Value is a list of strings, which may be nil. (custom-declare-variable 'explicit-bash-args '(let* ((prog (or (and (boundp 'explicit-shell-file-name) explicit-shell-file-name) (getenv "ESHELL") shell-file-name)) (name (file-name-nondirectory prog))) (if (and (not purify-flag) (equal name "bash") (file-executable-p prog) (string-match "bad option" (shell-command-to-string (concat (shell-quote-argument prog) " --noediting")))) '("-i") '("--noediting" "-i"))) '(#$ . 6967) :type '(repeat (string :tag "Argument")) :group 'shell) #@451 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 '(#$ . 7568) :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 (#$ . 8201)) #@64 Non-nil in a shell buffer means directory tracking is enabled. (defvar shell-dirtrackp t (#$ . 8365)) #@54 Keep track of last directory for ksh `cd -' command. (defvar shell-last-dir nil (#$ . 8473)) #@57 Command used by `shell-resync-dirs' to query the shell. (defvar shell-dirstack-query nil (#$ . 8572)) (byte-code "\301B\303\301!\204\304\301\305\"\210 \204Q\306 \n\244\307 \310\311#\210\307 \312\313#\210\307 \314\315#\210\307 \316\317#\210\307 \320\321\322\323\n\324\"!B#\210\325\323 \326\"\327\330\331$\210\325\323 \332\"\333\334\335$\210\305\207" [current-load-list shell-mode-map comint-mode-map default-boundp set-default nil make-sparse-keymap define-key "" shell-forward-command "" shell-backward-command " " comint-dynamic-complete "\277" comint-dynamic-list-filename-completions [menu-bar completion] "Complete" 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] 8) #@35 *Hook for customising Shell mode. (custom-declare-variable 'shell-mode-hook ''nil '(#$ . -9538) :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)) (#$ . 9667)) (byte-code "\302\303\304\305#\210\306\307N\204\302\306\307\310#\210\311\312!\204\302\312\313\303#\210\312B\314\312!\204.\315\312\316 \"\210\311\317!\204:\302\317\313\303#\210\317B\314\317!\204J\315\317\320 \"\210\302\301\313\303#\210\301B\314\301!\204d\315\301\321\301\322\"\210 \"\210\302\303\323\324#\207" [current-load-list shell-mode-abbrev-table put shell-mode mode-class special shell-mode-hook variable-documentation "Hook run when entering Shell mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp shell-mode-map definition-name default-boundp set-default make-sparse-keymap shell-mode-syntax-table make-syntax-table define-abbrev-table nil derived-mode-parent comint-mode] 5) #@2749 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 initialize the value of `comint-completion-fignore'. Variables `comint-input-ring-file-name' and `comint-input-autoexpand' control the initialization 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\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2036 \321 =\203<\322\f\323 \"\210)\324 !\210\325\f!\210@ABCDEFGHIJK\306\326!\210L\306\327!\210\330\306\331!\210C\306\332!\210\333\306\334!\210\335\306\336!\210\335MN\306\337!\210\340\341!\210\342O!\343P!\203 \344\345\346p!!@!Q\347\350!\206\311Q\351\230\203\275\352\202\311Q\353\230\203\310\354\202\311\355\211R\356\232\204\334\357R!\357\360!\232\203\337\335RR\203\364\361SQ\"\203\364\362\346p!\363\"\210Q\364\230\203\377\365\202 Q\353\230\203\n\366\202 \367TQ\351\230\203\370\371\372\335\307$\210)\373\307!\210)\374\375!\203+\375\376!\207\377\376!\207" [delay-mode-hooks major-mode mode-name shell-mode-map shell-mode-syntax-table parent make-local-variable t comint-mode shell-mode "Shell" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table use-local-map set-syntax-table comint-dynamic-complete-functions paragraph-separate "\\'" paragraph-start font-lock-defaults (shell-font-lock-keywords t) shell-dirstack nil shell-last-dir list-buffers-directory shell-dirtrack-mode 1 expand-file-name ring-empty-p 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" add-hook comint-output-filter-functions shell-filter-ctrl-a-ctrl-b comint-read-input-ring fboundp run-mode-hooks shell-mode-hook run-hooks shell-mode-abbrev-table local-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 shell-input-autoexpand comint-input-autoexpand default-directory comint-input-ring shell comint-input-ring-file-name shell-dumb-shell-regexp shell-dirstack-query] 6 (#$ . 10703) nil]) #@498 Remove `^A' and `^B' characters from comint output. Bash uses these characters as internal quoting characters in its prompt. Due to a bug in some bash versions (including 2.03, 2.04, and 2.05b), they may erroneously show up when bash is started with the `--noediting' option and Select Graphic Rendition (SGR) control sequences (formerly known as ANSI escape sequences) are used to color the prompt. This function can be put on `comint-output-filter-functions'. The argument STRING is ignored. (defalias 'shell-filter-ctrl-a-ctrl-b #[(string) "\302\303p!!\212\304 !\203\305 !\206eb\210\306\307\310#\205%\311\312!\210\202*\207" [pmark comint-last-output-start process-mark get-buffer-process markerp marker-position re-search-forward "[]" t replace-match ""] 4 (#$ . 15677)]) #@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 (#$ . 16473)]) #@1491 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 (if that is nil) from `shell-file-name'. If a file `~/.emacs_SHELLNAME' exists, or `~/.emacs.d/init_SHELLNAME.sh', it is given as initial input (but this may be lost, 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) "\306\206\307!\310!\210\311!\204_ \206\312\313!\206\n\314 !\315\fP\316\317\f\320Q!\321 !\2049\322\f\323Q\324\325\326 \321 !\205E \203W\327!\203WJ\202X\330&\210\331 \210,\207" [buffer explicit-shell-file-name shell-file-name prog name startfile get-buffer-create "*shell*" pop-to-buffer comint-check-proc getenv "ESHELL" file-name-nondirectory "~/.emacs_" intern-soft "explicit-" "-args" file-exists-p "~/.emacs.d/init_" ".sh" apply make-comint-in-buffer "shell" boundp ("-i") shell-mode xargs-name] 8 (#$ . 17042) (list (and current-prefix-arg (read-buffer "Shell buffer: " (generate-new-buffer-name "*shell*"))))]) #@663 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 \[dirtrack-mode]. If Emacs gets confused, you can resync with the shell with \[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\307P \"\210\310\225\311\211\211\306 #\205\224\310\225\312 \fO\310\211#\312 \fO\313\211#\211\2036\314\n!\306\315\316Q \"\203J\317\320\n!!\210\202\210\306\315\316Q \"\203^\321\320\n!!\210\202\210\306\315\316Q \"\203r\322\320\n!!\210\202\210\203\210\306\315\316Q \"\203\210\322\320 !!\210\306 \f#\210\310\225\202,\207" [shell-command-separator-regexp str arg1 cmd end start 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-command-regexp shell-popd-regexp shell-pushd-regexp shell-cd-regexp shell-chdrive-regexp] 5) ((error "Couldn't cd"))] 3 (#$ . 19224)]) #@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 ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) 0 nil string-match file-name-nondirectory process-command get-buffer-process "['`\"]" "[\\'`\"]" 92 replace-match "" string] 9 (#$ . 20744)]) (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-number] 3]) (defvaralias 'shell-dirtrack-mode 'shell-dirtrackp) #@107 Non-nil if Shell-Dirtrack mode is enabled. Use the command `shell-dirtrack-mode' to change this variable. (defvar shell-dirtrack-mode nil (#$ . 23223)) (make-variable-buffer-local 'shell-dirtrack-mode) #@55 Turn directory tracking on and off in a shell buffer. (defalias 'shell-dirtrack-mode #[(&optional arg) "\304=\203 ?\202%\203\305!\306V\202% \204\307\202%\310\311\301\"\210\312\211\205+\n \203:\313\314\315\312\307$\210\202@\316\314\315\307#\210\317\320 \203J\321\202K\322\"\210\323 \203_\310\324 \203\\\325\202]\326\"\210\327 \210 \207" [arg shell-dirtrack-mode default-directory list-buffers-directory toggle prefix-numeric-value 0 t message "Toggling %s off; better pass an explicit argument." nil add-hook comint-input-filter-functions shell-directory-tracker remove-hook run-hooks shell-dirtrack-mode-hook shell-dirtrack-mode-on-hook shell-dirtrack-mode-off-hook called-interactively-p "Shell-Dirtrack mode %sabled" "en" "dis" force-mode-line-update] 6 (#$ . 23431) (list (or current-prefix-arg 'toggle))]) (byte-code "\300\301\302\303\304!\205 \304J#\210\305\306\301\"\210\305\307\301\"\210\305\310\301\"\207" [add-minor-mode shell-dirtrack-mode nil boundp shell-dirtrack-mode-map defalias shell-dirtrack-toggle dirtrack-toggle dirtrack-mode] 5) #@58 Do normal `cd' to DIR, and set `list-buffers-directory'. (defalias 'shell-cd #[(dir) "\304!\210 \205 \n\211\207" [dir shell-dirtrackp default-directory list-buffers-directory cd] 2 (#$ . 24510)]) #@496 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\n\204 c\210\310c\210\311\312!\210\313 \"\210\313\310\"\210 `\314\223\210`\n\2036\315\316 !\317Q\2027\320\321P\310c\210\322u\210\323\f!\204Q\324!\210 b\210\202A* b\210\325\326!\210\327\224\327\225S{\211G\314\312\211W\203\221\330\331#\210 \326\224\326\225OPB\312\225\211\202l\237\314\332\333\217.\207" [proc pmark comint-process-echoes shell-dirstack-query regexp pt get-buffer-process process-mark "\n" sit-for 0 comint-send-string nil "\\(" regexp-quote "\n\\)" "\\(\\)" "\\(.+\n\\)" -1 looking-at accept-process-output delete-char 1 2 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"))) dl dl-len ds i comint-file-name-prefix] 5 (#$ . 24716) 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 (#$ . 26570)]) #@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 (#$ . 27060) (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 (#$ . 27599) "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 (#$ . 27932) "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 ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) string-match "[~/]" 0 shell-backward-command 1 message "Completing command name..." shell-dynamic-complete-as-command] 4 (#$ . 28376) 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\211\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 filenondir exec-path path-dirs 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 dir comps-in-dir file abs-file-name completions shell-completion-execonly comint-completion-addsuffix success] 5 (#$ . 29299)]) #@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 (#$ . 30456)]) #@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 (#$ . 30839) 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 (#$ . 31869)]) #@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 (#$ . 32726) nil]) (provide 'shell)