Mercurial > emacs
changeset 24069:8d500ceed9d1
* shell.el (shell-dirtrack-verbose): New custom variable.
(shell-dirstack-message): Use it.
author | Simon Marshall <simon@gnu.org> |
---|---|
date | Thu, 14 Jan 1999 10:31:31 +0000 |
parents | 4c04dff8f129 |
children | 526d645420b5 |
files | lisp/shell.el |
diffstat | 1 files changed, 26 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/shell.el Thu Jan 14 06:41:28 1999 +0000 +++ b/lisp/shell.el Thu Jan 14 10:31:31 1999 +0000 @@ -241,6 +241,12 @@ (const nil)) :group 'shell-directories) +(defcustom shell-dirtrack-verbose t + "*If non-nil, show the directory stack following directory change. +This is effective only if directory tracking is enabled." + :type 'boolean + :group 'shell-directories) + (defcustom explicit-shell-file-name nil "*If non-nil, is file name to use for explicitly requested inferior shell." :type '(choice (const :tag "None" nil) file) @@ -720,24 +726,26 @@ ;;; All the commands that mung the buffer's dirstack finish by calling ;;; this guy. (defun shell-dirstack-message () - (let* ((msg "") - (ds (cons default-directory shell-dirstack)) - (home (expand-file-name (concat comint-file-name-prefix "~/"))) - (homelen (length home))) - (while ds - (let ((dir (car ds))) - (and (>= (length dir) homelen) (string= home (substring dir 0 homelen)) - (setq dir (concat "~/" (substring dir homelen)))) - ;; Strip off comint-file-name-prefix if present. - (and comint-file-name-prefix - (>= (length dir) (length comint-file-name-prefix)) - (string= comint-file-name-prefix - (substring dir 0 (length comint-file-name-prefix))) - (setq dir (substring dir (length comint-file-name-prefix))) - (setcar ds dir)) - (setq msg (concat msg (directory-file-name dir) " ")) - (setq ds (cdr ds)))) - (message "%s" msg))) + (when shell-dirtrack-verbose + (let* ((msg "") + (ds (cons default-directory shell-dirstack)) + (home (expand-file-name (concat comint-file-name-prefix "~/"))) + (homelen (length home))) + (while ds + (let ((dir (car ds))) + (and (>= (length dir) homelen) + (string= home (substring dir 0 homelen)) + (setq dir (concat "~/" (substring dir homelen)))) + ;; Strip off comint-file-name-prefix if present. + (and comint-file-name-prefix + (>= (length dir) (length comint-file-name-prefix)) + (string= comint-file-name-prefix + (substring dir 0 (length comint-file-name-prefix))) + (setq dir (substring dir (length comint-file-name-prefix))) + (setcar ds dir)) + (setq msg (concat msg (directory-file-name dir) " ")) + (setq ds (cdr ds)))) + (message "%s" msg)))) ;; This was mostly copied from shell-resync-dirs. (defun shell-snarf-envar (var)