Mercurial > emacs
comparison lisp/shell.el @ 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 | 9888d3b32db3 |
children | 027616e7b1e4 |
comparison
equal
deleted
inserted
replaced
7082:70b62e9d773b | 7083:9630c48595d8 |
---|---|
246 "Non-nil in a shell buffer means directory tracking is enabled.") | 246 "Non-nil in a shell buffer means directory tracking is enabled.") |
247 | 247 |
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) |
255 (cond ((not shell-mode-map) | 255 (cond ((not shell-mode-map) |
256 (setq shell-mode-map (copy-keymap comint-mode-map)) | 256 (setq shell-mode-map (copy-keymap comint-mode-map)) |
337 (make-local-variable 'shell-dirtrackp) | 337 (make-local-variable 'shell-dirtrackp) |
338 (setq shell-dirtrackp t) | 338 (setq shell-dirtrackp t) |
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 |
352 ;;;###autoload | 354 ;;;###autoload |
353 (defun shell () | 355 (defun shell () |