diff options
| author | Lars Ingebrigtsen | 2021-12-01 20:16:29 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-12-01 20:16:57 +0100 |
| commit | ec3b6fa8e18a64616af057195f86a4c8b09f9ccd (patch) | |
| tree | 1c656b19138768368111e9ab1264ecf8ba8fc234 | |
| parent | 02ebd790b785693a76361b8ab398f6654b51fe3f (diff) | |
| download | emacs-ec3b6fa8e18a64616af057195f86a4c8b09f9ccd.tar.gz emacs-ec3b6fa8e18a64616af057195f86a4c8b09f9ccd.zip | |
Make `C-x C-d' require either an existing directory or a wildcard
* lisp/files.el (list-directory): Require either an existing
directory or a wildcard (bug#25807).
| -rw-r--r-- | lisp/files.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el index f72723ab7dd..c96e79cc63d 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -7211,11 +7211,18 @@ DIRNAME is globbed by the shell if necessary. | |||
| 7211 | Prefix arg (second arg if noninteractive) means supply -l switch to `ls'. | 7211 | Prefix arg (second arg if noninteractive) means supply -l switch to `ls'. |
| 7212 | Actions controlled by variables `list-directory-brief-switches' | 7212 | Actions controlled by variables `list-directory-brief-switches' |
| 7213 | and `list-directory-verbose-switches'." | 7213 | and `list-directory-verbose-switches'." |
| 7214 | (interactive (let ((pfx current-prefix-arg)) | 7214 | (interactive |
| 7215 | (list (read-directory-name (if pfx "List directory (verbose): " | 7215 | (let ((pfx current-prefix-arg)) |
| 7216 | "List directory (brief): ") | 7216 | (list (read-file-name |
| 7217 | nil default-directory nil) | 7217 | (if pfx "List directory (verbose): " |
| 7218 | pfx))) | 7218 | "List directory (brief): ") |
| 7219 | nil default-directory t | ||
| 7220 | nil | ||
| 7221 | (lambda (file) | ||
| 7222 | (or (file-directory-p file) | ||
| 7223 | (insert-directory-wildcard-in-dir-p | ||
| 7224 | (expand-file-name file))))) | ||
| 7225 | pfx))) | ||
| 7219 | (let ((switches (if verbose list-directory-verbose-switches | 7226 | (let ((switches (if verbose list-directory-verbose-switches |
| 7220 | list-directory-brief-switches)) | 7227 | list-directory-brief-switches)) |
| 7221 | buffer) | 7228 | buffer) |