[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master f3ad159: Insert subdir content if dir-or-list is a
From: |
Tino Calancha |
Subject: |
[Emacs-diffs] master f3ad159: Insert subdir content if dir-or-list is a string w/o wildcards |
Date: |
Tue, 1 Aug 2017 10:32:42 -0400 (EDT) |
branch: master
commit f3ad15933a0d104b099d640d5c43fce99ece0003
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>
Insert subdir content if dir-or-list is a string w/o wildcards
* lisp/eshell/em-ls.el (eshell-ls--insert-directory):
Append '("-d") into 'eshell-ls-dired-initial-args'
if 'dired-directory' is a cons or there are wildcars (Bug#27843).
* test/lisp/dired-tests.el (dired-test-bug27843): Add test.
---
lisp/eshell/em-ls.el | 8 ++++++--
test/lisp/dired-tests.el | 15 +++++++++++++++
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index 4a5adc4..39f03ff 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -278,8 +278,12 @@ instead."
(let ((insert-func 'insert)
(error-func 'insert)
(flush-func 'ignore)
- eshell-ls-dired-initial-args)
- (eshell-do-ls (append switches (list file)))))))))
+ (switches
+ (append eshell-ls-dired-initial-args
+ (and (or (consp dired-directory) wildcard) (list
"-d"))
+ switches)))
+ (eshell-do-ls (nconc switches (list file)))))))))
+
(declare-function eshell-extended-glob "em-glob" (glob))
(declare-function dired-read-dir-and-switches "dired" (str))
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index 0ee4e13..5900fea 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -325,6 +325,21 @@
(delete-directory dir 'recursive)
(when (buffer-live-p buf) (kill-buffer buf)))))
+(ert-deftest dired-test-bug27843 ()
+ "Test for http://debbugs.gnu.org/27843 ."
+ (require 'em-ls)
+ (let ((orig eshell-ls-use-in-dired)
+ (dired-use-ls-dired 'unspecified)
+ buf insert-directory-program)
+ (unwind-protect
+ (progn
+ (customize-set-variable 'eshell-ls-use-in-dired t)
+ (setq buf (dired (list source-directory "lisp")))
+ (dired-toggle-marks)
+ (should-not (cdr (dired-get-marked-files))))
+ (customize-set-variable 'eshell-ls-use-in-dired orig)
+ (unload-feature 'em-ls 'force)
+ (and (buffer-live-p buf) (kill-buffer)))))
(provide 'dired-tests)
;; dired-tests.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master f3ad159: Insert subdir content if dir-or-list is a string w/o wildcards,
Tino Calancha <=