# HG changeset patch # User Simon Marshall # Date 916309891 0 # Node ID 8d500ceed9d133e831a57d1cfe97f566aade08ca # Parent 4c04dff8f129e8befbb2ce4b0e096d3cecefffe1 * shell.el (shell-dirtrack-verbose): New custom variable. (shell-dirstack-message): Use it. diff -r 4c04dff8f129 -r 8d500ceed9d1 lisp/shell.el --- 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)