From: Tino Calancha <tino.calancha@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 27631@debbugs.gnu.org, "Tino Calancha" <tino.calancha@gmail.com>,
"Michael Albinus" <michael.albinus@gmx.de>,
"積丹尼 Dan Jacobson" <jidanni@jidanni.org>
Subject: bug#27631: dired a/*/b
Date: Thu, 3 Aug 2017 13:38:37 +0900 (JST) [thread overview]
Message-ID: <alpine.DEB.2.20.1708031332180.32024@calancha-pc> (raw)
In-Reply-To: <jwvini5apbo.fsf-monnier+bug#27631@gnu.org>
On Wed, 2 Aug 2017, Stefan Monnier wrote:
>>> Maybe make dired and list-directory deal with wildcards in positions like
>>> ~/.config/chromium/Default/*/menkifleemblimdogmoihpfopnplikde/
>> Thank you for the report.
>> IMO, this is a nice thing to have.
>> It must be possible to extend the current code so that
>> dired might handle wildcards in the directory part.
>
> I'm not sure the recent patch for this fix is the right approach.
> The old code already used the shell to do the wildcard expansion, so why
> not just adjust the old code.
>
> Here's some starting patch.
Thank you for the patch.
Part of the complexity of the original patch is to provide this new
feature in _tramp_ connections as well; your patch does the thing
well (see patch below) in the local machine but it fails in remote
ones.
--8<-----------------------------cut here---------------start------------->8---
commit 21f02469bf5ef3733e3705e9836a7d91f625ce11
Author: Tino Calancha <tino.calancha@gmail.com>
Date: Thu Aug 3 13:20:40 2017 +0900
Apply some minor tweaks
diff --git a/lisp/dired.el b/lisp/dired.el
index 211b622fd9..7862d0405c 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1100,7 +1100,7 @@ dired-readin-insert
(while (not (file-directory-p dir))
(setq dir (directory-file-name dir))
(let ((n (file-name-nondirectory dir)))
- (setq file-list (mapcar (lambda (f) (concat n "/" f)) file-list)))
+ (setq file-list (mapcar (lambda (f) (concat n (and (not (string= "" f)) "/") f)) file-list)))
(setq dir (file-name-directory dir)))
(setq default-directory dir))
(if (and (equal "" (file-name-nondirectory dir))
@@ -1258,6 +1258,8 @@ dired-insert-directory
;; as indicated by `ls-lisp-use-insert-directory-program'.
(not (and (featurep 'ls-lisp)
(null ls-lisp-use-insert-directory-program)))
+ (not (and (featurep 'eshell)
+ (bound-and-true-p eshell-ls-use-in-dired)))
(or (if (eq dired-use-ls-dired 'unspecified)
;; Check whether "ls --dired" gives exit code 0, and
;; save the answer in `dired-use-ls-dired'.
@@ -1335,9 +1337,7 @@ dired-insert-directory
(setq content-point (point)))
(when wildcard
;; Insert "wildcard" line where "total" line would be for a full dir.
- (insert " wildcard " (or (cdr-safe (insert-directory-wildcard-in-dir-p dir))
- (file-name-nondirectory dir))
- "\n")))
+ (insert " wildcard " (car-safe file-list) "\n")))
(dired-insert-set-properties content-point (point)))))
(defun dired-insert-set-properties (beg end)
--8<-----------------------------cut here---------------end--------------->8---
next prev parent reply other threads:[~2017-08-03 4:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-09 18:42 bug#27631: dired a/*/b 積丹尼 Dan Jacobson
2017-07-13 5:52 ` Tino Calancha
2017-08-02 17:30 ` Stefan Monnier
2017-08-02 17:49 ` Eli Zaretskii
2017-08-03 1:25 ` Stefan Monnier
2017-08-03 4:38 ` Tino Calancha [this message]
2017-08-03 15:48 ` Stefan Monnier
2017-08-04 5:12 ` Tino Calancha
2017-07-13 13:15 ` 積丹尼 Dan Jacobson
2017-07-13 15:13 ` Tino Calancha
2017-07-14 8:40 ` Eli Zaretskii
2017-07-25 15:19 ` Tino Calancha
2017-07-26 7:36 ` Michael Albinus
2017-07-28 7:50 ` Tino Calancha
2017-07-28 9:23 ` Michael Albinus
2017-07-28 9:34 ` Tino Calancha
2017-07-28 11:23 ` Michael Albinus
2017-07-28 12:00 ` Michael Albinus
2017-07-29 12:20 ` Tino Calancha
2017-07-29 20:39 ` Michael Albinus
2017-07-30 2:20 ` Tino Calancha
2017-07-30 11:13 ` Michael Albinus
2017-07-29 8:30 ` Eli Zaretskii
2017-07-29 12:03 ` Tino Calancha
2017-07-14 9:30 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1708031332180.32024@calancha-pc \
--to=tino.calancha@gmail.com \
--cc=27631@debbugs.gnu.org \
--cc=jidanni@jidanni.org \
--cc=michael.albinus@gmx.de \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.