Re: Orderless matches all TRAMP methods

2023-11-15 Thread Michael Albinus
Peter Oliver  writes:

Hi Peter,

> I experience the following problem when trying to complete local filenames 
> when TRAMP is loaded.
>
> In "emacs-29.1.90 -Q", I run:
>
> (package-initialize)
> (require 'orderless)
> (setq completion-styles '(orderless))
>
> Then, I type:
>
> C-x C-f C-a C-k /ssh: C-a C-k /zzz TAB
>
> I see:
>
> Click on a completion to select it.
> In this buffer, type RET to select the completion near point.
>
> 45 possible completions:
> -: adb:   afp:   dav:   davs:
> doas:  docker:fcp:   ftp:   gdrive:
> krlogin:   ksu:   kubernetes:mtp:   nc:
> nextcloud: plink-ksh: plink: plinkx:podman:
> pscp:  psftp: rclone:rcp:   remcp:
> remsh: rsh:   rsync: scp-ksh:   scp:
> scpx:  sftp:  sg:smb:   ssh-ksh:
> ssh:   sshfs: sshx:  su:sudo-csw-ksh:
> sudo-csw:  sudo-ksh:  sudo:  sudoedit:  telnet:
>
> This isn’t correct, since none of these match "/zzz".

Thanks, I can reproduce it. I'll debug next days (I'm not so fluent with
orderless, so I need some initia first).

Perhaps it is a good idea to write it also as Emacs bug report. This
would make it easier to add a possible solution to Emacs 29.2, which is
in its pretest already.

Best regards, Michael.



Orderless matches all TRAMP methods

2023-11-15 Thread Peter Oliver

I experience the following problem when trying to complete local filenames when 
TRAMP is loaded.

In "emacs-29.1.90 -Q", I run:

(package-initialize)
(require 'orderless)
(setq completion-styles '(orderless))

Then, I type:

C-x C-f C-a C-k /ssh: C-a C-k /zzz TAB

I see:

Click on a completion to select it.
In this buffer, type RET to select the completion near point.

45 possible completions:
-: adb:   afp:   dav:   davs:
doas:  docker:fcp:   ftp:   gdrive:
krlogin:   ksu:   kubernetes:mtp:   nc:
nextcloud: plink-ksh: plink: plinkx:podman:
pscp:  psftp: rclone:rcp:   remcp:
remsh: rsh:   rsync: scp-ksh:   scp:
scpx:  sftp:  sg:smb:   ssh-ksh:
ssh:   sshfs: sshx:  su:sudo-csw-ksh:
sudo-csw:  sudo-ksh:  sudo:  sudoedit:  telnet:

This isn’t correct, since none of these match "/zzz".

This goes away if I "(setq completion-styles '(basic))" or "(setq completion-styles 
'(substring))", so I reported this as a bug against the orderless package 
(https://github.com/oantolin/orderless/issues/150).  However, Daniel Mendler kindly did some 
investigation, and pointed out,

“The problem is that the Tramp completion table does not perform proper 
filtering. The completion style substring performs (inefficient) double 
filtering, such that the problem is hidden. The consequence of this is also 
that substring is two timers slower than Orderless.”

He goes on to give some examples as documentation references.

So, although only orderless completion triggers this (as far as I’ve found so 
far), it sounds like it’s caused by a bug in TRAMP?

--
Peter Oliver