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


Message #20 received at 27631 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 27631 <at> debbugs.gnu.org
Subject: Re: bug#27631: dired a/*/b
Date: Fri, 14 Jul 2017 11:30:01 +0200
Tino Calancha <tino.calancha <at> gmail.com> writes:

> Hi Michael,

> i'd like to provide Tramp support for this new Dired feature.
> The implementation is fairly straight: just adds a function
> 'insert-directory-wildcard-in-dir-p' in files.el, and use it in
> 'insert-directory' and Dired.
>
> To get Tramp support i've added a handler
> 'tramp-sh-handle-insert-directory-wildcard-in-dir-p'.
> Is this procedure OK or i am doing something weird?

That's not sufficient, it takes much more for adding a new handler in
Tramp. At least, it must be declared in tramp.el, and it must also be
added to the other backends but tramp-sh.el. 

And you can also not call it directly; Tramp is backwards compatible
with Emacs 24 and 25.

> +(defun insert-directory-wildcard-in-dir-p (dir)
> +  (when (string-match "[*]" (file-name-directory dir))
> +    (let ((regexp "\\`\\([^*]+/\\)\\([^*]*[*].*\\)"))
> +      (string-match regexp dir)
> +      (cons (match-string 1 dir) (match-string 2 dir)))))

Unfortunately, there's no docstring, so it isn't clear to me what you
expect as result. Reading `tramp-sh-handle-insert-directory-wildcard-in-dir-p',
I believe you just want to work over the local part of a remote file
name. So you could do at the beginning:

  ;; DIR could be remote.
  (setq dir (file-local-name dir))

And I don't believe that it is mandatory to call
`insert-directory-wildcard-in-dir-p' in Tramp. All what's needed could be
done outside Tramp file name handlers.
.
> Best regards,
> Tino

Best regards, Michael.




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

Previous Next


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