summaryrefslogtreecommitdiff
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-04-24 10:50:41 +0000
committerRichard M. Stallman <rms@gnu.org>1994-04-24 10:50:41 +0000
commitbf95cc485dbf149729459c508a23d8162b8e0f7e (patch)
tree523b4bb01dd7569b966c20c6d1873517eb3c0cfd /lisp/shell.el
parentcfb4279f6fea5cc9dab87ad695c80d9f2de124d4 (diff)
downloademacs-bf95cc485dbf149729459c508a23d8162b8e0f7e.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.el14
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))