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