diff options
| author | Lars Ingebrigtsen | 2022-02-05 23:57:38 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-02-05 23:57:38 +0100 |
| commit | 93da7a202d8fc23cd3af064eb94adbb1c9c0944f (patch) | |
| tree | b2059b7cc3cf844af3c282bb4de9a7ba38f62c65 /lisp/eshell | |
| parent | a4eeea812441c2456ad522659869be089be9d7a9 (diff) | |
| download | emacs-93da7a202d8fc23cd3af064eb94adbb1c9c0944f.tar.gz emacs-93da7a202d8fc23cd3af064eb94adbb1c9c0944f.zip | |
Tweak how eshell/cd works when cd-ing to ".." from "/"
* lisp/eshell/em-dirs.el (eshell/cd): Make "cd .." from "/" less
confusing (bug#16861).
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/em-dirs.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 893cad7b4fb..3998026d7f4 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el | |||
| @@ -391,6 +391,10 @@ in the minibuffer: | |||
| 391 | (unless (equal curdir newdir) | 391 | (unless (equal curdir newdir) |
| 392 | (eshell-add-to-dir-ring curdir)) | 392 | (eshell-add-to-dir-ring curdir)) |
| 393 | (let ((result (cd newdir))) | 393 | (let ((result (cd newdir))) |
| 394 | ;; If we're in "/" and cd to ".." or the like, make things | ||
| 395 | ;; less confusing by changing "/.." to "/". | ||
| 396 | (when (equal (file-truename result) "/") | ||
| 397 | (setq result (cd "/"))) | ||
| 394 | (and eshell-cd-shows-directory | 398 | (and eshell-cd-shows-directory |
| 395 | (eshell-printn result))) | 399 | (eshell-printn result))) |
| 396 | (run-hooks 'eshell-directory-change-hook) | 400 | (run-hooks 'eshell-directory-change-hook) |