From a412141c9d67bb4a66c9b2050be1275436da89fd Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 10 Mar 2021 15:10:24 +0100 Subject: [PATCH] * lisp/files.el (cd): Improve error message. --- lisp/files.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.39.2