From: Stefan Kangas Date: Wed, 10 Mar 2021 14:10:24 +0000 (+0100) Subject: * lisp/files.el (cd): Improve error message. X-Git-Tag: emacs-28.0.90~3341 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a412141c9d67bb4a66c9b2050be1275436da89fd;p=emacs.git * lisp/files.el (cd): Improve error message. --- diff --git a/lisp/files.el b/lisp/files.el index e5fa1d8b224..2868be77f28 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -823,7 +823,9 @@ The path separator is colon in GNU and GNU-like systems." (expand-file-name dir)) (locate-file dir cd-path nil (lambda (f) (and (file-directory-p f) 'dir-ok))) - (error "No such directory found via CDPATH environment variable")))) + (if (getenv "CDPATH") + (error "No such directory found via CDPATH environment variable: %s" dir) + (error "No such directory: %s" dir))))) (defun directory-files-recursively (dir regexp &optional include-directories predicate