unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37464: 26.3; Icomplete and TRAMP create unnecessary buffer
@ 2019-09-19 20:38 Andrii Kolomoiets
  2019-09-21  9:17 ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Andrii Kolomoiets @ 2019-09-19 20:38 UTC (permalink / raw)
  To: 37464

1. emacs -Q
2. M-x icomplete-mode
3. C-x C-f
4. /q::
   instead of "q" allowed method can be specified e.g. "sudo" or "ssh"
5. C-g
6. C-x C-b

Notice new buffer "*tramp/q..." created although command was cancelled.

In GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109))
of 2019-09-02 built on builder10-14.porkrind.org





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#37464: 26.3; Icomplete and TRAMP create unnecessary buffer
  2019-09-19 20:38 bug#37464: 26.3; Icomplete and TRAMP create unnecessary buffer Andrii Kolomoiets
@ 2019-09-21  9:17 ` Michael Albinus
  2019-09-23  6:59   ` Andrii Kolomoiets
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2019-09-21  9:17 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 37464-done

Andrii Kolomoiets <andreyk.mad@gmail.com> writes:

Hi Andrii,

> 1. emacs -Q
> 2. M-x icomplete-mode
> 3. C-x C-f
> 4. /q::
>    instead of "q" allowed method can be specified e.g. "sudo" or "ssh"
> 5. C-g
> 6. C-x C-b
>
> Notice new buffer "*tramp/q..." created although command was cancelled.

Thanks for the report, I can confirm the behaviour. However, this is not
a bug. Try the following command instead:

emacs -Q --eval '(setq tramp-verbose 6)'

This enables traces up to level 6, which are the commands send to a
remote host. You will see also the buffer *debug tramp/ssh...*. No trace
there with level 6, but entries like

11:09:33.148026 tramp-file-name-handler (5) # Non-essential received in operation (file-name-all-completions  /ssh::)

This tells us, that Tramp hasn't tried any remote connection, because it
is still in user name / host name completion. And that's what counts.

I'm marking this as not-a-bug, and close it. Feel free to ask if you
need further information.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#37464: 26.3; Icomplete and TRAMP create unnecessary buffer
  2019-09-21  9:17 ` Michael Albinus
@ 2019-09-23  6:59   ` Andrii Kolomoiets
  2019-09-23 10:53     ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Andrii Kolomoiets @ 2019-09-23  6:59 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 37464-done

Hi Michael,

> On Sep 21, 2019, at 12:17, Michael Albinus <michael.albinus@gmx.de> wrote:
> 
>> 1. emacs -Q
>> 2. M-x icomplete-mode
>> 3. C-x C-f
>> 4. /q::
>>   instead of "q" allowed method can be specified e.g. "sudo" or "ssh"
>> 5. C-g
>> 6. C-x C-b
>> 
>> Notice new buffer "*tramp/q..." created although command was cancelled.
> 
> Thanks for the report, I can confirm the behaviour. However, this is not
> a bug. Try the following command instead:
> 
> emacs -Q --eval '(setq tramp-verbose 6)'
> 
> This enables traces up to level 6, which are the commands send to a
> remote host. You will see also the buffer *debug tramp/ssh...*. No trace
> there with level 6, but entries like
> 
> 11:09:33.148026 tramp-file-name-handler (5) # Non-essential received in operation (file-name-all-completions  /ssh::)
> 
> This tells us, that Tramp hasn't tried any remote connection, because it
> is still in user name / host name completion. And that's what counts.
> 
> I'm marking this as not-a-bug, and close it. Feel free to ask if you
> need further information.
> 
> Best regards, 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.

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.
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?

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.

Thanks!




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#37464: 26.3; Icomplete and TRAMP create unnecessary buffer
  2019-09-23  6:59   ` Andrii Kolomoiets
@ 2019-09-23 10:53     ` Michael Albinus
  2019-09-23 11:46       ` Andrii Kolomoiets
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2019-09-23 10:53 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 37464-done

Andrii Kolomoiets <andreyk.mad@gmail.com> writes:

> Hi Michael,

Hi Andrii,

> 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 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.

> 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.

> Thanks!

Best regards, Michael.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#37464: 26.3; Icomplete and TRAMP create unnecessary buffer
  2019-09-23 10:53     ` Michael Albinus
@ 2019-09-23 11:46       ` Andrii Kolomoiets
  0 siblings, 0 replies; 5+ messages in thread
From: Andrii Kolomoiets @ 2019-09-23 11:46 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 37464-done

> 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.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-23 11:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 20:38 bug#37464: 26.3; Icomplete and TRAMP create unnecessary buffer Andrii Kolomoiets
2019-09-21  9:17 ` Michael Albinus
2019-09-23  6:59   ` Andrii Kolomoiets
2019-09-23 10:53     ` Michael Albinus
2019-09-23 11:46       ` Andrii Kolomoiets

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).