diff options
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/em-ls.el | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index 39f03ffb79e..38e38132bf7 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el | |||
| @@ -243,6 +243,9 @@ scope during the evaluation of TEST-SEXP." | |||
| 243 | 243 | ||
| 244 | ;;; Functions: | 244 | ;;; Functions: |
| 245 | 245 | ||
| 246 | (declare-function eshell-extended-glob "em-glob" (glob)) | ||
| 247 | (defvar eshell-error-if-no-glob) | ||
| 248 | |||
| 246 | (defun eshell-ls--insert-directory | 249 | (defun eshell-ls--insert-directory |
| 247 | (orig-fun file switches &optional wildcard full-directory-p) | 250 | (orig-fun file switches &optional wildcard full-directory-p) |
| 248 | "Insert directory listing for FILE, formatted according to SWITCHES. | 251 | "Insert directory listing for FILE, formatted according to SWITCHES. |
| @@ -275,14 +278,22 @@ instead." | |||
| 275 | (set 'font-lock-buffers | 278 | (set 'font-lock-buffers |
| 276 | (delq (current-buffer) | 279 | (delq (current-buffer) |
| 277 | (symbol-value 'font-lock-buffers))))) | 280 | (symbol-value 'font-lock-buffers))))) |
| 278 | (let ((insert-func 'insert) | 281 | (require 'em-glob) |
| 279 | (error-func 'insert) | 282 | (let* ((insert-func 'insert) |
| 280 | (flush-func 'ignore) | 283 | (error-func 'insert) |
| 281 | (switches | 284 | (flush-func 'ignore) |
| 282 | (append eshell-ls-dired-initial-args | 285 | (eshell-error-if-no-glob t) |
| 283 | (and (or (consp dired-directory) wildcard) (list "-d")) | 286 | (target ; Expand the shell wildcards if any. |
| 284 | switches))) | 287 | (if (and (atom file) |
| 285 | (eshell-do-ls (nconc switches (list file))))))))) | 288 | (string-match "[[?*]" file) |
| 289 | (not (file-exists-p file))) | ||
| 290 | (mapcar #'file-relative-name (eshell-extended-glob file)) | ||
| 291 | (file-relative-name file))) | ||
| 292 | (switches | ||
| 293 | (append eshell-ls-dired-initial-args | ||
| 294 | (and (or (consp dired-directory) wildcard) (list "-d")) | ||
| 295 | switches))) | ||
| 296 | (eshell-do-ls (nconc switches (list target))))))))) | ||
| 286 | 297 | ||
| 287 | 298 | ||
| 288 | (declare-function eshell-extended-glob "em-glob" (glob)) | 299 | (declare-function eshell-extended-glob "em-glob" (glob)) |