all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 27631@debbugs.gnu.org
Subject: bug#27631: dired a/*/b
Date: Fri, 14 Jul 2017 11:30:01 +0200	[thread overview]
Message-ID: <87mv87pdra.fsf@detlef> (raw)
In-Reply-To: <877ezcxtd3.fsf@calancha-pc> (Tino Calancha's message of "Fri, 14 Jul 2017 00:13:28 +0900")

Tino Calancha <tino.calancha@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.





      parent reply	other threads:[~2017-07-14  9:30 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
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 [this message]

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=87mv87pdra.fsf@detlef \
    --to=michael.albinus@gmx.de \
    --cc=27631@debbugs.gnu.org \
    --cc=tino.calancha@gmail.com \
    /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.