aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-06-09 20:31:51 +0000
committerRichard M. Stallman1996-06-09 20:31:51 +0000
commit32d012127609e52c0fc3d1f82d765a0b45739e9e (patch)
treee34f92029b12406c2679bb6971dff6c3ab752382
parent7a35a067a3fbdafdb683a153a8094f63458a688f (diff)
downloademacs-32d012127609e52c0fc3d1f82d765a0b45739e9e.tar.gz
emacs-32d012127609e52c0fc3d1f82d765a0b45739e9e.zip
(shell-directory-tracker): Use comint-substitute-in-file-name to
handle system-specific syntax. (shell-chdrive-regexp): New variable. (shell-mode): Update doc string. (shell-directory-tracker): Detect drive changes. Update doc string.
-rw-r--r--lisp/shell.el32
1 files changed, 22 insertions, 10 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 5807f62b384..867c2919342 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -186,6 +186,13 @@ This mirrors the optional behavior of tcsh.")
186(defvar shell-cd-regexp "cd" 186(defvar shell-cd-regexp "cd"
187 "*Regexp to match subshell commands equivalent to cd.") 187 "*Regexp to match subshell commands equivalent to cd.")
188 188
189(defvar shell-chdrive-regexp
190 (if (memq system-type '(ms-dos windows-nt))
191 ; NetWare allows the five chars between upper and lower alphabetics.
192 "[]a-zA-Z^_`\\[\\\\]:"
193 nil)
194 "*If non-nil, is regexp used to track drive changes.")
195
189(defvar explicit-shell-file-name nil 196(defvar explicit-shell-file-name nil
190 "*If non-nil, is file name to use for explicitly requested inferior shell.") 197 "*If non-nil, is file name to use for explicitly requested inferior shell.")
191 198
@@ -287,10 +294,10 @@ Customization: Entry to this mode runs the hooks on `comint-mode-hook' and
287`comint-input-filter-functions' are run. After each shell output, the hooks 294`comint-input-filter-functions' are run. After each shell output, the hooks
288on `comint-output-filter-functions' are run. 295on `comint-output-filter-functions' are run.
289 296
290Variables `shell-cd-regexp', `shell-pushd-regexp' and `shell-popd-regexp' 297Variables `shell-cd-regexp', `shell-chdrive-regexp', `shell-pushd-regexp'
291are used to match their respective commands, while `shell-pushd-tohome', 298and `shell-popd-regexp' are used to match their respective commands,
292`shell-pushd-dextract' and `shell-pushd-dunique' control the behavior of the 299while `shell-pushd-tohome', `shell-pushd-dextract' and `shell-pushd-dunique'
293relevant command. 300control the behavior of the relevant command.
294 301
295Variables `comint-completion-autolist', `comint-completion-addsuffix', 302Variables `comint-completion-autolist', `comint-completion-addsuffix',
296`comint-completion-recexact' and `comint-completion-fignore' control the 303`comint-completion-recexact' and `comint-completion-fignore' control the
@@ -441,9 +448,9 @@ default directory to track these commands.
441You may toggle this tracking on and off with M-x dirtrack-toggle. 448You may toggle this tracking on and off with M-x dirtrack-toggle.
442If emacs gets confused, you can resync with the shell with M-x dirs. 449If emacs gets confused, you can resync with the shell with M-x dirs.
443 450
444See variables `shell-cd-regexp', `shell-pushd-regexp', and `shell-popd-regexp', 451See variables `shell-cd-regexp', `shell-chdrive-regexp', `shell-pushd-regexp',
445while `shell-pushd-tohome', `shell-pushd-dextract' and `shell-pushd-dunique' 452and `shell-popd-regexp', while `shell-pushd-tohome', `shell-pushd-dextract',
446control the behavior of the relevant command. 453and `shell-pushd-dunique' control the behavior of the relevant command.
447 454
448Environment variables are expanded, see function `substitute-in-file-name'." 455Environment variables are expanded, see function `substitute-in-file-name'."
449 (if shell-dirtrackp 456 (if shell-dirtrackp
@@ -459,15 +466,20 @@ Environment variables are expanded, see function `substitute-in-file-name'."
459 (cond ((string-match (concat "\\`\\(" shell-popd-regexp 466 (cond ((string-match (concat "\\`\\(" shell-popd-regexp
460 "\\)\\($\\|[ \t]\\)") 467 "\\)\\($\\|[ \t]\\)")
461 cmd) 468 cmd)
462 (shell-process-popd (substitute-in-file-name arg1))) 469 (shell-process-popd (comint-substitute-in-file-name arg1)))
463 ((string-match (concat "\\`\\(" shell-pushd-regexp 470 ((string-match (concat "\\`\\(" shell-pushd-regexp
464 "\\)\\($\\|[ \t]\\)") 471 "\\)\\($\\|[ \t]\\)")
465 cmd) 472 cmd)
466 (shell-process-pushd (substitute-in-file-name arg1))) 473 (shell-process-pushd (comint-substitute-in-file-name arg1)))
467 ((string-match (concat "\\`\\(" shell-cd-regexp 474 ((string-match (concat "\\`\\(" shell-cd-regexp
468 "\\)\\($\\|[ \t]\\)") 475 "\\)\\($\\|[ \t]\\)")
469 cmd) 476 cmd)
470 (shell-process-cd (substitute-in-file-name arg1)))) 477 (shell-process-cd (comint-substitute-in-file-name arg1)))
478 ((and shell-chdrive-regexp
479 (string-match (concat "\\`\\(" shell-chdrive-regexp
480 "\\)\\($\\|[ \t]\\)")
481 cmd))
482 (shell-process-cd (comint-substitute-in-file-name cmd))))
471 (setq start (progn (string-match "[; \t]*" str end) ; skip again 483 (setq start (progn (string-match "[; \t]*" str end) ; skip again
472 (match-end 0))))) 484 (match-end 0)))))
473 (error "Couldn't cd")))) 485 (error "Couldn't cd"))))