Fix "C-x C-d" with wildcard arguments
* lisp/files.el (list-directory): Make sure 'default-directory' is set to a valid value if the argument DIRNAME included wildcards. (Bug#55877)
This commit is contained in:
@@ -7406,9 +7406,9 @@ and `list-directory-verbose-switches'."
|
||||
;; Finishing with-output-to-temp-buffer seems to clobber default-directory.
|
||||
(with-current-buffer buffer
|
||||
(setq default-directory
|
||||
(if (file-directory-p dirname)
|
||||
(if (file-accessible-directory-p dirname)
|
||||
(file-name-as-directory dirname)
|
||||
(file-name-directory dirname))))))
|
||||
(file-name-directory (directory-file-name dirname)))))))
|
||||
|
||||
(defun shell-quote-wildcard-pattern (pattern)
|
||||
"Quote characters special to the shell in PATTERN, leave wildcards alone.
|
||||
|
||||
Reference in New Issue
Block a user