Subject: 25.1; eshell cd not changing directory on remote path (windows-nt)

From: "Gary O'Sullivan" <[email-masked]>
Date: Tue, 25 Oct 2016 00:03:28 +0100

On Windows I can change remote directories in eshell via absolute paths

but using relative paths return an error message "No such directory

found via CDPATH environment variable".

Run runemacs.exe -Q

M-x eshell

Welcome to the Emacs shell

c:/software/emacs/bin $ cd /plink:mysrv:/

/plink:mysrv:/home/gary/ $ cd etc

No such directory found via CDPATH environment variable

/plink:mysrv:/home/gary/ $ cd /plink:mysrv:/etc

/plink:mysrv:/etc $

If I M-x toggle-debug-on-error I get the following backtrace:

Debugger entered--Lisp error: (error "No such directory found via
CDPATH environment variable")

  signal(error ("No such directory found via CDPATH environment variable"))

  error("No such directory found via CDPATH environment variable")

  cd("etc")

  eshell/cd("etc")

  apply(eshell/cd "etc")

  eshell-exec-lisp(eshell-print eshell-error eshell/cd ("etc") nil)

  eshell-lisp-command(eshell/cd ("etc"))

  eshell-plain-command("cd" ("etc"))

  eshell-named-command("cd" ("etc"))

  (prog1 (eshell-named-command "cd" (list "etc")) (run-hooks (quote
eshell-this-command-hook)))

  (condition-case err (prog1 (eshell-named-command "cd" (list "etc"))
(run-hooks (quote eshell-this-command-hook))) ((debug error)
(run-hooks (quote eshell-this-command-hook)) (eshell-errorn
(error-message-string err)) (eshell-close-handles 1)))

  (condition-case-unless-debug err (prog1 (eshell-named-command "cd"
(list "etc")) (run-hooks (quote eshell-this-command-hook))) (error
(run-hooks (quote eshell-this-command-hook)) (eshell-errorn
(error-message-string err)) (eshell-close-handles 1)))

  (eshell-condition-case err (prog1 (eshell-named-command "cd" (list
"etc")) (run-hooks (quote eshell-this-command-hook))) (error
(run-hooks (quote eshell-this-command-hook)) (eshell-errorn
(error-message-string err)) (eshell-close-handles 1)))

  (let ((eshell-this-command-hook (quote (ignore))))
(eshell-condition-case err (prog1 (eshell-named-command "cd" (list
"etc")) (run-hooks (quote eshell-this-command-hook))) (error
(run-hooks (quote eshell-this-command-hook)) (eshell-errorn
(error-message-string err)) (eshell-close-handles 1))))

  (eshell-trap-errors (eshell-named-command "cd" (list "etc")))

  (progn (eshell-trap-errors (eshell-named-command "cd" (list "etc"))))

  (catch (quote top-level) (progn (eshell-trap-errors
(eshell-named-command "cd" (list "etc")))))

  (progn (run-hooks (quote eshell-pre-command-hook)) (catch (quote
top-level) (progn (eshell-trap-errors (eshell-named-command "cd" (list
"etc"))))) (run-hooks (quote eshell-post-command-hook)))

  (let ((eshell-current-handles (eshell-create-handles t (quote
append))) eshell-current-subjob-p) (progn (run-hooks (quote
eshell-pre-command-hook)) (catch (quote top-level) (progn
(eshell-trap-errors (eshell-named-command "cd" (list "etc")))))
(run-hooks (quote eshell-post-command-hook))))

  (eshell-commands (progn (run-hooks (quote eshell-pre-command-hook))
(catch (quote top-level) (progn (eshell-trap-errors
(eshell-named-command "cd" (list "etc"))))) (run-hooks (quote
eshell-post-command-hook))))

  eval((eshell-commands (progn (run-hooks (quote
eshell-pre-command-hook)) (catch (quote top-level) (progn
(eshell-trap-errors (eshell-named-command "cd" (list "etc")))))
(run-hooks (quote eshell-post-command-hook)))))

  eshell-send-input(nil)

  funcall-interactively(eshell-send-input nil)

  call-interactively(eshell-send-input nil nil)

  command-execute(eshell-send-input)

I get the same error message if I try the following from the *scratch*

buffer:

(cd "/plink:mysrv:/") ; --> "/plink:mysrv:/"

(cd "etc") ; --> (error "No such directory found via CDPATH
environment variable")

(getenv "CDPATH") ; --> nil

If I change the error message in the cd function (files.el) to look like

the following

(error "No such directory '%s' found via CDPATH environment variable
'%s'" dir cd-path)

then it returns

No such directory ’etc’ found via CDPATH environment variable ’(./)’"

expand-file-name returns a path beginning with "c:" if the second arg

is "./" .

default-directory ; --> "/plink:mysrv:/"

(expand-file-name "etc") ; --> "/plink:mysrv:/etc"

(expand-file-name "etc" default-directory) ; --> "/plink:mysrv:/etc"

(expand-file-name "etc" "./") ; --> "c:/plink:mysrv:/etc"

Regards,

Gary O'Sullivan

In GNU Emacs 25.1.1 (i686-w64-mingw32)

 of 2016-09-17 built on LAPHROAIG

Windowing system distributor 'Microsoft Corp.', version 6.1.7601

Configured using:

 'configure --host=i686-w64-mingw32 --without-dbus

 --without-compress-install CFLAGS=-static'

Configured features:

XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB

TOOLKIT_SCROLL_BARS

Important settings:

  value of $LANG: ENI

  locale-coding-system: cp1252

Major mode: EShell

Minor modes in effect:

  shell-dirtrack-mode: t

  tooltip-mode: t

  global-eldoc-mode: t

  electric-indent-mode: t

  mouse-wheel-mode: t

  tool-bar-mode: t

  menu-bar-mode: t

  file-name-shadow-mode: t

  global-font-lock-mode: t

  font-lock-mode: t

  blink-cursor-mode: t

  auto-composition-mode: t

  auto-encryption-mode: t

  auto-compression-mode: t

  line-number-mode: t

  transient-mark-mode: t

Recent messages:

Checking for load-path shadows...done

You can run the command ‘report-emacs-bug’ with M-x r-em RET

Checking for load-path shadows...done

Auto-saving...

previous-line: Beginning of buffer [4 times]

Quit

Making completion list...

Type "q" in help window to restore its previous buffer, C-M-v to scroll help.

previous-line: Beginning of buffer [7 times]

Auto-saving...done

previous-line: Beginning of buffer

Load-path shadows:

None found.

Features:

(pp shadow sort mail-extr emacsbug message dired rfc822 mml mml-sec epg

epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev

gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils

eieio-opt speedbar sb-image ezimage dframe find-func debug browse-url

misearch multi-isearch goto-addr thingatpt noutline outline easy-mmode

view info tramp-cache tramp-sh tramp tramp-compat auth-source cl-seq

eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core cl-macs

gv gnus-util mm-util help-fns help-mode mail-prsvr password-cache

tramp-loaddefs trampver ucs-normalize shell format-spec advice em-unix

em-term term easymenu ehelp em-script em-prompt em-ls cl-loaddefs pcase

cl-lib em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner

em-alias pcomplete comint ansi-color ring esh-var esh-io esh-cmd esh-opt

esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode esh-util

time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks

lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars

term/common-win tool-bar dnd fontset image regexp-opt fringe

tabulated-list newcomment elisp-mode lisp-mode prog-mode register page

menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock

syntax facemenu font-core frame cl-generic cham georgian utf-8-lang

misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms

cp51932 hebrew greek romanian slovak czech european ethiopic indian

cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help

simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces

cus-face macroexp files text-properties overlay sha1 md5 base64 format

env code-pages mule custom widget hashtable-print-readable backquote

w32notify w32 multi-tty make-network-process emacs)

Memory information:

((conses 8 284646 29342)

 (symbols 32 25672 0)

 (miscs 32 136 657)

 (strings 16 40747 7070)

 (string-bytes 1 1129305)

 (vectors 8 41992)

 (vector-slots 4 796865 14244)

 (floats 8 308 374)

 (intervals 28 5839 89)

 (buffers 520 27))