diff options
| author | Simon Marshall | 1999-01-14 10:31:31 +0000 |
|---|---|---|
| committer | Simon Marshall | 1999-01-14 10:31:31 +0000 |
| commit | 8a6387ed6c074bd949b656863df47ea9c246eb95 (patch) | |
| tree | 401896fdf94d6e78d37846fa4fea0d5c2162b6a4 /lisp/shell.el | |
| parent | 081966d0e2e2d17330700d3537b154279991518c (diff) | |
| download | emacs-8a6387ed6c074bd949b656863df47ea9c246eb95.tar.gz emacs-8a6387ed6c074bd949b656863df47ea9c246eb95.zip | |
* shell.el (shell-dirtrack-verbose): New custom variable.
(shell-dirstack-message): Use it.
Diffstat (limited to 'lisp/shell.el')
| -rw-r--r-- | lisp/shell.el | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index 07bd4a87d64..5f9f7888c2e 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -241,6 +241,12 @@ This mirrors the optional behavior of tcsh." | |||
| 241 | (const nil)) | 241 | (const nil)) |
| 242 | :group 'shell-directories) | 242 | :group 'shell-directories) |
| 243 | 243 | ||
| 244 | (defcustom shell-dirtrack-verbose t | ||
| 245 | "*If non-nil, show the directory stack following directory change. | ||
| 246 | This is effective only if directory tracking is enabled." | ||
| 247 | :type 'boolean | ||
| 248 | :group 'shell-directories) | ||
| 249 | |||
| 244 | (defcustom explicit-shell-file-name nil | 250 | (defcustom explicit-shell-file-name nil |
| 245 | "*If non-nil, is file name to use for explicitly requested inferior shell." | 251 | "*If non-nil, is file name to use for explicitly requested inferior shell." |
| 246 | :type '(choice (const :tag "None" nil) file) | 252 | :type '(choice (const :tag "None" nil) file) |
| @@ -720,24 +726,26 @@ command again." | |||
| 720 | ;;; All the commands that mung the buffer's dirstack finish by calling | 726 | ;;; All the commands that mung the buffer's dirstack finish by calling |
| 721 | ;;; this guy. | 727 | ;;; this guy. |
| 722 | (defun shell-dirstack-message () | 728 | (defun shell-dirstack-message () |
| 723 | (let* ((msg "") | 729 | (when shell-dirtrack-verbose |
| 724 | (ds (cons default-directory shell-dirstack)) | 730 | (let* ((msg "") |
| 725 | (home (expand-file-name (concat comint-file-name-prefix "~/"))) | 731 | (ds (cons default-directory shell-dirstack)) |
| 726 | (homelen (length home))) | 732 | (home (expand-file-name (concat comint-file-name-prefix "~/"))) |
| 727 | (while ds | 733 | (homelen (length home))) |
| 728 | (let ((dir (car ds))) | 734 | (while ds |
| 729 | (and (>= (length dir) homelen) (string= home (substring dir 0 homelen)) | 735 | (let ((dir (car ds))) |
| 730 | (setq dir (concat "~/" (substring dir homelen)))) | 736 | (and (>= (length dir) homelen) |
| 731 | ;; Strip off comint-file-name-prefix if present. | 737 | (string= home (substring dir 0 homelen)) |
| 732 | (and comint-file-name-prefix | 738 | (setq dir (concat "~/" (substring dir homelen)))) |
| 733 | (>= (length dir) (length comint-file-name-prefix)) | 739 | ;; Strip off comint-file-name-prefix if present. |
| 734 | (string= comint-file-name-prefix | 740 | (and comint-file-name-prefix |
| 735 | (substring dir 0 (length comint-file-name-prefix))) | 741 | (>= (length dir) (length comint-file-name-prefix)) |
| 736 | (setq dir (substring dir (length comint-file-name-prefix))) | 742 | (string= comint-file-name-prefix |
| 737 | (setcar ds dir)) | 743 | (substring dir 0 (length comint-file-name-prefix))) |
| 738 | (setq msg (concat msg (directory-file-name dir) " ")) | 744 | (setq dir (substring dir (length comint-file-name-prefix))) |
| 739 | (setq ds (cdr ds)))) | 745 | (setcar ds dir)) |
| 740 | (message "%s" msg))) | 746 | (setq msg (concat msg (directory-file-name dir) " ")) |
| 747 | (setq ds (cdr ds)))) | ||
| 748 | (message "%s" msg)))) | ||
| 741 | 749 | ||
| 742 | ;; This was mostly copied from shell-resync-dirs. | 750 | ;; This was mostly copied from shell-resync-dirs. |
| 743 | (defun shell-snarf-envar (var) | 751 | (defun shell-snarf-envar (var) |