From 6a97049b56c73351d169fa1a6a9a39b57a8886ad Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 22 May 1998 03:24:28 +0000 Subject: [PATCH] (insert-directory): When WILDCARD is nil, expand ~ if necessary. --- lisp/files.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index 7d1ffa81235..51a29e47408 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3031,7 +3031,7 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." (and enable-multibyte-characters (or file-name-coding-system default-file-name-coding-system))) - ;; This binding is for encoding arguements by call-process. + ;; This is to control encoding the arguments in call-process. (coding-system-for-write coding-system-for-read) (result (if wildcard @@ -3081,10 +3081,13 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." (append list ;; Avoid lossage if FILE starts with `-'. '("--") - (list - (if full-directory-p - (concat (file-name-as-directory file) ".") - file)))))))) + (progn + (if (string-match "\\`~" file) + (setq file (expand-file-name file))) + (list + (if full-directory-p + (concat (file-name-as-directory file) ".") + file))))))))) (if (/= result 0) ;; We get here if ls failed. ;; Access the file to get a suitable error. -- 2.39.2