aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorRichard M. Stallman1994-04-24 10:50:41 +0000
committerRichard M. Stallman1994-04-24 10:50:41 +0000
commitc63e83a4ee11ed29aedd3235bc45c1892b2efbff (patch)
tree83b1d5f4f0b7fbf2ebb19d2fd74e9963b848e5f3 /lisp/shell.el
parentc2264295478d11485e25068a6d9118008bfcd049 (diff)
downloademacs-c63e83a4ee11ed29aedd3235bc45c1892b2efbff.tar.gz
emacs-c63e83a4ee11ed29aedd3235bc45c1892b2efbff.zip
(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.")
248(defvar shell-last-dir nil 248(defvar shell-last-dir nil
249 "Keep track of last directory for ksh `cd -' command.") 249 "Keep track of last directory for ksh `cd -' command.")
250 250
251(defvar shell-dirstack-query "dirs" 251(defvar shell-dirstack-query nil
252 "Command used by `shell-resync-dir' to query the shell.") 252 "Command used by `shell-resync-dir' to query the shell.")
253 253
254(defvar shell-mode-map nil) 254(defvar shell-mode-map nil)
@@ -339,13 +339,15 @@ buffer."
339 (add-hook 'comint-input-filter-functions 'shell-directory-tracker) 339 (add-hook 'comint-input-filter-functions 'shell-directory-tracker)
340 (setq comint-input-autoexpand shell-input-autoexpand) 340 (setq comint-input-autoexpand shell-input-autoexpand)
341 ;; shell-dependent assignments. 341 ;; shell-dependent assignments.
342 (let ((shell (car (process-command (get-buffer-process (current-buffer)))))) 342 (let ((shell (file-name-nondirectory (car
343 (process-command (get-buffer-process (current-buffer)))))))
343 (setq comint-input-ring-file-name 344 (setq comint-input-ring-file-name
344 (or (getenv "HISTFILE") 345 (or (getenv "HISTFILE")
345 (cond ((string-match "csh$" shell) "~/.history") 346 (cond ((string-equal shell "bash") "~/.bash_history")
346 ((string-match "bash$" shell) "~/.bash_history") 347 ((string-equal shell "ksh") "~/.sh_history")
347 ((string-match "ksh$" shell) "~/.sh_history") 348 (t "~/.history"))))
348 (t "~/.history"))))) 349 (setq shell-dirstack-query
350 (if (string-match "^k?sh$" shell) "pwd" "dirs")))
349 (run-hooks 'shell-mode-hook) 351 (run-hooks 'shell-mode-hook)
350 (comint-read-input-ring t)) 352 (comint-read-input-ring t))
351 353