all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Christoph Michelbach <michelbach94@gmail.com>
Cc: 31489@debbugs.gnu.org
Subject: bug#31489: 25.3; Dired unable to open directory "/ssh:example.com"
Date: Mon, 21 May 2018 19:53:55 +0200	[thread overview]
Message-ID: <87efi4nbd8.fsf@gmx.de> (raw)
In-Reply-To: <1526643719.9043.13.camel@gmail.com>

Christoph Michelbach <michelbach94@gmail.com> writes:

Hi Christoph,

> On Sun, 2018-05-20 at 20:30 +0200, Michael Albinus wrote:
>> You haven't answered my question: Could you live w/o Tramp, and set
>> tramp-mode to nil? Or do you want still use Tramp, and I shall extend
>> Tramp with an "exclude file names" feature?
>>
>> Both variants would be a solution for this.
>
> I haven't done so because I'm not suffering from this bug atm. I do use
> tramp but I don't have the problem described in the bug report in
> practice. I merely wanted to find out to what extent dired can be used
> as a file browser and explored some edge cases. While doing so, I found
> a few problems and this is the first one (and thus far only one found
> while explicitly looking for bugs) I have reported. To evade the
> problem in practice, one could simply use symlinks for the folders with
> the weird names. Or one could use a single simlink created via
>
> sudo ln -s / /f
>
> and then always start at "/f".

That was my first idea, when reading your bug report. But it doesn't
work. `file-truename' would convert any file name
"/f/ssh:example.com:/..." into "/ssh:example.com:/...", and we're back
to the problem.

> Evading this problem in practice is simple, but it seems to me that
> HAVING to evade it shows poor usability.

The problem is not related to dired. It comes from how file name
handlers are designed in Emacs. They are active only based on the file
*name*, not on anything else of the related file. That means, any file
*name* which matched Tramp's remote file name syntax, activates Tramp.

>> I don't see how this could be avoided. Of course, dired could quote any
>> directory name with "/:" when opening a directory with a file name
>> dedicated to Tramp (or another file name handling library). But this
>> would discard *any* file name handlers in this subdirectory, including
>> something like uncrompressing files, as jka-compr does, or decrypting
>> files, whis is performed by epa.
>
> So the problem is that this way of quoting is also used in different
> places, which means that it's not possible to view the contents of
> "/ssh:example.com/tarball.tar" in Emacs without removing tramp /
> disabling tramp / adding an exception for this specific path?

Well, viewing the contents of a *.tar file is not performed via a file
name handler, so it is possible to view the contents of
"/:/tmp/foo.tar", for example. See the variable `file-name-handler-alist'
for the file name handlers which are invoked via this mechanism, and
which would be disabled by quoting a file name (prefixing it with "/:").

(On the contrary, in Emacs 27.0.50, viewing the contents of a tar file
by the special file name syntax "/tmp/foo.tar/" could fail, when the
file name is quoted like "/:/tmp/foo.tar/".)

You might read (info "(elisp) Magic File Names") for further
information about the underlying mechanism.

---

Finally, I've pushed a patch to Emacs' master branch which should solve
your problem. Add the following line to your .emacs:

(setq tramp-ignored-file-name-regexp "\\`/ssh:example\\.com:")

That's it. Tramp's documentation tells something about.

Best regards, Michael.





  reply	other threads:[~2018-05-21 17:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 11:41 bug#31489: 25.3; Dired unable to open directory "/ssh:example.com" Christoph Michelbach
2018-05-18 15:25 ` Michael Albinus
2018-05-18 22:16   ` Christoph Michelbach
2018-05-19 18:10     ` Michael Albinus
2018-05-20 18:12       ` Christoph Michelbach
2018-05-20 18:30         ` Michael Albinus
2018-05-20 19:19           ` Christoph Michelbach
2018-05-21 17:53             ` Michael Albinus [this message]
2018-06-04 16:37               ` Michael Albinus
2018-05-21 12:59           ` Christoph Michelbach
2018-05-21 14:46             ` 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=87efi4nbd8.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=31489@debbugs.gnu.org \
    --cc=michelbach94@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.