index (1+ index)))))
oldpath))
-(defvar dired-directory)
-
(defun eshell/cd (&rest args) ; all but first ignored
"Alias to extend the behavior of `cd'."
(setq args (eshell-flatten-list args))
(path
(setq path (eshell-expand-multiple-dots path))))
(unless handled
- (setq dired-directory (or path "~"))
- (let ((curdir (eshell/pwd)))
- (unless (equal curdir dired-directory)
+ (let ((curdir (eshell/pwd))
+ (newdir (or path "~")))
+ (unless (equal curdir newdir)
(eshell-add-to-dir-ring curdir))
- (let ((result (cd dired-directory)))
+ (let ((result (cd newdir)))
(and eshell-cd-shows-directory
(eshell-printn result)))
(run-hooks 'eshell-directory-change-hook)
(setq local-abbrev-table eshell-mode-abbrev-table)
- (set (make-local-variable 'dired-directory) default-directory)
(set (make-local-variable 'list-buffers-directory)
(expand-file-name default-directory))