From: Richard M. Stallman Date: Fri, 22 May 1998 03:24:28 +0000 (+0000) Subject: (insert-directory): When WILDCARD is nil, expand ~ if necessary. X-Git-Tag: emacs-20.3~898 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6a97049b56c73351d169fa1a6a9a39b57a8886ad;p=emacs.git (insert-directory): When WILDCARD is nil, expand ~ if necessary. --- 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.