1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00

(shell-dirstack-query): Defaults to nil.

(shell-mode): Guesses shell-dirstack-query based on shell name.
This commit is contained in:
Richard M. Stallman 1994-04-24 10:50:41 +00:00
parent c226429547
commit c63e83a4ee

View File

@ -248,7 +248,7 @@ Thus, this does not include the shell's current directory.")
(defvar shell-last-dir nil (defvar shell-last-dir nil
"Keep track of last directory for ksh `cd -' command.") "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.") "Command used by `shell-resync-dir' to query the shell.")
(defvar shell-mode-map nil) (defvar shell-mode-map nil)
@ -339,13 +339,15 @@ buffer."
(add-hook 'comint-input-filter-functions 'shell-directory-tracker) (add-hook 'comint-input-filter-functions 'shell-directory-tracker)
(setq comint-input-autoexpand shell-input-autoexpand) (setq comint-input-autoexpand shell-input-autoexpand)
;; shell-dependent assignments. ;; 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 (setq comint-input-ring-file-name
(or (getenv "HISTFILE") (or (getenv "HISTFILE")
(cond ((string-match "csh$" shell) "~/.history") (cond ((string-equal shell "bash") "~/.bash_history")
((string-match "bash$" shell) "~/.bash_history") ((string-equal shell "ksh") "~/.sh_history")
((string-match "ksh$" shell) "~/.sh_history") (t "~/.history"))))
(t "~/.history"))))) (setq shell-dirstack-query
(if (string-match "^k?sh$" shell) "pwd" "dirs")))
(run-hooks 'shell-mode-hook) (run-hooks 'shell-mode-hook)
(comint-read-input-ring t)) (comint-read-input-ring t))