GNU bug report logs -
#27631
dired a/*/b
Previous Next
Full log
Message #20 received at 27631 <at> debbugs.gnu.org (full text, mbox):
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.