diff options
author | Glenn Morris <rgm@gnu.org> | 2010-11-26 19:22:00 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2010-11-26 19:22:00 -0800 |
commit | e96d41478ba4d8d11709807d26965dbe181c3759 (patch) | |
tree | 746ffc29d5471a47d52779d537f726ba88fd6919 /lisp/shell.el | |
parent | a140ec5f5e91a60851ebdbfe3360825e89965df1 (diff) | |
download | emacs-e96d41478ba4d8d11709807d26965dbe181c3759.tar.gz emacs-e96d41478ba4d8d11709807d26965dbe181c3759.tar.bz2 emacs-e96d41478ba4d8d11709807d26965dbe181c3759.zip |
* lisp/shell.el (shell-dir-cookie-re): Move definition before use.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r-- | lisp/shell.el | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index 4288834e029..815add76502 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -368,6 +368,17 @@ Thus, this does not include the shell's current directory.") ;;; Basic Procedures +(defcustom shell-dir-cookie-re nil + "Regexp matching your prompt, including some part of the current directory. +If your prompt includes the current directory or the last few elements of it, +set this to a pattern that matches your prompt and whose subgroup 1 matches +the directory part of it. +This is used by `shell-dir-cookie-watcher' to try and use this info +to track your current directory. It can be used instead of or in addition +to `dirtrack-mode'." + :group 'shell + :type '(choice (const nil) regexp)) + (put 'shell-mode 'mode-class 'special) (define-derived-mode shell-mode comint-mode "Shell" @@ -629,16 +640,6 @@ Otherwise, one argument `-i' is passed to the shell. ;; replace it with a process filter that watches for and strips out ;; these messages. -(defcustom shell-dir-cookie-re nil - "Regexp matching your prompt, including some part of the current directory. -If your prompt includes the current directory or the last few elements of it, -set this to a pattern that matches your prompt and whose subgroup 1 matches -the directory part of it. -This is used by `shell-dir-cookie-watcher' to try and use this info -to track your current directory. It can be used instead of or in addition -to `dirtrack-mode'." - :type '(choice (const nil) regexp)) - (defun shell-dir-cookie-watcher (text) ;; This is fragile: the TEXT could be split into several chunks and we'd ;; miss it. Oh well. It's a best effort anyway. I'd expect that it's @@ -652,7 +653,6 @@ to `dirtrack-mode'." ((string-match "\\`\\(.*\\)\\(?:/.*\\)?\n\\(.*/\\)\\1\\(?:/.*\\)?\\'" (setq text (concat dir "\n" default-directory))) (shell-cd (concat (match-string 2 text) dir))))))) - (defun shell-directory-tracker (str) "Tracks cd, pushd and popd commands issued to the shell. |