# HG changeset patch # User Richard M. Stallman # Date 767184641 0 # Node ID 9630c48595d817eec10ed17b5b33a00aae82dd84 # Parent 70b62e9d773b8c3cb6a2478f6da0ac69e24648cb (shell-dirstack-query): Defaults to nil. (shell-mode): Guesses shell-dirstack-query based on shell name. diff -r 70b62e9d773b -r 9630c48595d8 lisp/shell.el --- 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))