diff options
| author | Richard M. Stallman <rms@gnu.org> | 1994-04-24 10:50:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1994-04-24 10:50:41 +0000 |
| commit | c63e83a4ee11ed29aedd3235bc45c1892b2efbff (patch) | |
| tree | 83b1d5f4f0b7fbf2ebb19d2fd74e9963b848e5f3 /lisp/shell.el | |
| parent | c2264295478d11485e25068a6d9118008bfcd049 (diff) | |
| download | emacs-c63e83a4ee11ed29aedd3235bc45c1892b2efbff.tar.gz | |
(shell-dirstack-query): Defaults to nil.
(shell-mode): Guesses shell-dirstack-query based on shell name.
Diffstat (limited to 'lisp/shell.el')
| -rw-r--r-- | lisp/shell.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index 2cc0e5481ef..33d84a181a9 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -248,7 +248,7 @@ Thus, this does not include the shell's current directory.") (defvar shell-last-dir nil "Keep track of last directory for ksh `cd -' command.") -(defvar shell-dirstack-query "dirs" +(defvar shell-dirstack-query nil "Command used by `shell-resync-dir' to query the shell.") (defvar shell-mode-map nil) @@ -339,13 +339,15 @@ buffer." (add-hook 'comint-input-filter-functions 'shell-directory-tracker) (setq comint-input-autoexpand shell-input-autoexpand) ;; shell-dependent assignments. - (let ((shell (car (process-command (get-buffer-process (current-buffer)))))) + (let ((shell (file-name-nondirectory (car + (process-command (get-buffer-process (current-buffer))))))) (setq comint-input-ring-file-name (or (getenv "HISTFILE") - (cond ((string-match "csh$" shell) "~/.history") - ((string-match "bash$" shell) "~/.bash_history") - ((string-match "ksh$" shell) "~/.sh_history") - (t "~/.history"))))) + (cond ((string-equal shell "bash") "~/.bash_history") + ((string-equal shell "ksh") "~/.sh_history") + (t "~/.history")))) + (setq shell-dirstack-query + (if (string-match "^k?sh$" shell) "pwd" "dirs"))) (run-hooks 'shell-mode-hook) (comint-read-input-ring t)) |
