changeset 7083:9630c48595d8

(shell-dirstack-query): Defaults to nil. (shell-mode): Guesses shell-dirstack-query based on shell name.
author Richard M. Stallman <rms@gnu.org>
date Sun, 24 Apr 1994 10:50:41 +0000
parents 70b62e9d773b
children 5ceea5b326b6
files lisp/shell.el
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/shell.el	Sun Apr 24 10:21:01 1994 +0000
+++ b/lisp/shell.el	Sun Apr 24 10:50:41 1994 +0000
@@ -248,7 +248,7 @@
 (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 @@
   (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))