GNU bug report logs - #27631
dired a/*/b

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sun, 9 Jul 2017 18:44:01 UTC

Severity: minor

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 27631 <at> debbugs.gnu.org, Michael Albinus <michael.albinus <at> gmx.de>, Eli Zaretskii <eliz <at> gnu.org>, 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: bug#27631: dired a/*/b
Date: Thu, 03 Aug 2017 11:48:54 -0400
> 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.

I didn't adjust the Tramp code accordingly, indeed.  My patch probably
also fails for ls-lisp (aka Windows).  Both of those will need
corresponding adjustments.

My point is that it seems like we can get the same end-result without
changing the structure.

> @@ -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))

`n` represents a directory name, so isn't it OK to have "<n>/" rather
than "<n>"?  Or is the above tweak purely cosmetic?

> @@ -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)))))

Yes, my patch needs a bunch more cleanups: it was a quick hack job, just
to confirm my intuition.


        Stefan




This bug report was last modified 7 years and 294 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.