GNU bug report logs - #37464
26.3; Icomplete and TRAMP create unnecessary buffer

Previous Next

Package: emacs;

Reported by: Andrii Kolomoiets <andreyk.mad <at> gmail.com>

Date: Thu, 19 Sep 2019 20:39:02 UTC

Severity: normal

Tags: notabug

Found in version 26.3

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 37464-done <at> debbugs.gnu.org
Subject: bug#37464: 26.3; Icomplete and TRAMP create unnecessary buffer
Date: Mon, 23 Sep 2019 14:46:06 +0300
> Hi Andrii,

Hi Michael,

>> But why this doesn't happen when icomplete-mode is disabled?
>> C-x C-f /q:: <TAB> says "Method 'q' is not known" and there are
>> no `*tramp/q...` buffer.
> 
> You activate icomplete-mode for a reason. Icomplete calls (file-exists-p
> "/ssh:hostname:"), after you have typed "/ssh::" (given that "hostname" is
> the name of your host). Without icomplete-mode, this doesn't happen.
> 
>> Let me explain how i faced this behaviour. I have some commands that do
>> `(abbreviate-file-name default-directory)`. After misspelled `sudo` as
>> TRAMP method in `find-file` prompt like `/suod::/etc/hosts` and
>> cancelling command with `C-g` the buffer `*tramp/suod...` was created.
>> And `(abbreviate-file-name default-directory)` in that buffer leads to
>> "Method 'suod' is not known" error.
> 
> Yes. But why do you call it in this buffer?

I use buffers in Ibuffer grouped by project or default-directory.
Group name is abbreviated default directory of the buffer if there are no project.

Also I have a command to switch to buffer which is belong to current project.
It call file-in-directory-p on every buffer's default-directory in order to determine
that the buffer belongs to project.

>> I thought that buffer `*tramp/suod...` was created mistakenly.
>> If this is expected behaviour do i need to wrap `abbreviate-file-name`
>> with `condition-case` or something?
> 
> (ignore-errors (abbreviate-file-name default-directory)) would do.

Got it.

>> Actually there are more command that won't work from the
>> `*tramp/suod...` buffer: vc-dir, find-file, dired.
>> All of them leads to "Method 'soud' is not known" error.
> 
> Yes, but only if you take the buffer with the damaged
> default-directory. I would try to ban such a buffer in my code.
> 
> Best regards, Michael.

Thanks again, Michael.



This bug report was last modified 5 years and 238 days ago.

Previous Next


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