mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Tweak how eshell/cd works when cd-ing to ".." from "/"
* lisp/eshell/em-dirs.el (eshell/cd): Make "cd .." from "/" less confusing (bug#16861).
This commit is contained in:
parent
a4eeea8124
commit
93da7a202d
1 changed files with 4 additions and 0 deletions
|
|
@ -391,6 +391,10 @@ in the minibuffer:
|
|||
(unless (equal curdir newdir)
|
||||
(eshell-add-to-dir-ring curdir))
|
||||
(let ((result (cd newdir)))
|
||||
;; If we're in "/" and cd to ".." or the like, make things
|
||||
;; less confusing by changing "/.." to "/".
|
||||
(when (equal (file-truename result) "/")
|
||||
(setq result (cd "/")))
|
||||
(and eshell-cd-shows-directory
|
||||
(eshell-printn result)))
|
||||
(run-hooks 'eshell-directory-change-hook)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue