Subject: bug#9616: 24.0.90; Filename completion on remote hosts in shell and eshell doesn't work

From: Selah Ben-Haim <[email-masked]>
Date: Tue, 27 Sep 2011 11:29:18 -0500

Problem: Filename completion on remote hosts in shell and eshell doesn't
work properly.

On remote host, on shell prompt: Typing "/" and pressing TAB attempts to
complete from local root dir rather than remote root dir.

Supposing that at your current directory there is a subdirectory "usr"
with a subdirectory "local", typing "usr" and hitting TAB successfully
completes to "usr/" bit gives the following error:

Debugger entered--Lisp error: (file-error "Opening directory" "no such
file or directory" "/ssh:host:/usr/")

Then, typing "loca" and hitting "TAB" fails to complete.

Recipe:

1 cd /ssh:some-remote-host:/
2 M-x shell (or eshell)
3 Type in "cd /" and hit TAB TAB

Notice that completion options are for local root dir, rather than
remote root dir

4 Type in "usr" TAB

Completes successfully to "usr/" but with error

5 After "usr/" type in "loca" and tab

Fails to complete to "local/"

In GNU Emacs 24.0.90.1 (x86_64-apple-darwin, NS apple-appkit-1038.35)
 of 2011-09-26 on virtualmac.porkrind.org
Windowing system distributor `Apple', version 10.3.1038
configured using `configure  '--host=x86_64-apple-darwin' '--build=i686-apple-darwin' '--with-ns' 'build_alias=i686-apple-darwin' 'host_alias=x86_64-apple-darwin' 'CC=gcc -mmacosx-version-min=10.5''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: EShell

Minor modes in effect:
  global-hl-line-mode: t
  which-function-mode: t
  global-auto-revert-mode: t
  delete-selection-mode: t
  evil-mode: t
  evil-local-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  yas/global-mode: t
  yas/minor-mode: t
  global-auto-complete-mode: t
  nxhtml-menu-mode: t
  show-paren-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x RET c d <return> / s s h : p i o n : / <return> 
C-x RET s h <return> <return> c d SPC w <tab> e <tab> 
e <backspace> <tab> <tab> <tab> <tab> <tab> <tab> <tab> 
<tab> <tab> <backspace> <backspace> <tab> <tab> <tab> 
<backspace> <backspace> <backspace> <backspace> / <tab> 
<tab> C-x RET c d <return> w <tab> e <tab> <tab> / 
e c o <tab> <tab> C-g C-x RET e s h <return> c d SPC 
w <tab> e <tab> <tab> <tab> C-a C-k C-x RET r e p o 
r t <return>

Recent messages:
Loading em-hist...done
Loading em-ls...done
Loading em-script...done
Loading em-unix...done
Error: (file-error "Opening directory" "no such file or directory" "/ssh:pion:/www/") [2 times]
No completions of www/e
Error: (file-error "Opening directory" "no such file or directory" "/ssh:pion:/www/") [2 times]
No completions of www/e
Error: (file-error "Opening directory" "no such file or directory" "/ssh:pion:/www/") [2 times]
No completions of www/e

Load-path shadows:
/Users/selah/.emacs.d/el-get/color-theme/color-theme hides ~/.emacs.d/plugins/color-theme/color-theme
/Users/selah/.emacs.d/el-get/color-theme/color-theme-autoloads hides ~/.emacs.d/plugins/color-theme/color-theme-autoloads
/Users/selah/.emacs.d/el-get/flyspell/flyspell hides ~/.emacs.d/plugins/flyspell
/Users/selah/.emacs.d/custom hides /Applications/Emacs.app/Contents/Resources/lisp/custom
/Users/selah/.emacs.d/bindings hides /Applications/Emacs.app/Contents/Resources/lisp/bindings
/Users/selah/.emacs.d/el-get/flyspell/flyspell hides /Applications/Emacs.app/Contents/Resources/lisp/textmodes/flyspell
/Users/selah/.emacs.d/plugins/tramp/trampver hides /Applications/Emacs.app/Contents/Resources/lisp/net/trampver
/Users/selah/.emacs.d/plugins/tramp/tramp hides /Applications/Emacs.app/Contents/Resources/lisp/net/tramp
/Users/selah/.emacs.d/plugins/tramp/tramp-uu hides /Applications/Emacs.app/Contents/Resources/lisp/net/tramp-uu
/Users/selah/.emacs.d/plugins/tramp/tramp-smb hides /Applications/Emacs.app/Contents/Resources/lisp/net/tramp-smb
/Users/selah/.emacs.d/plugins/tramp/tramp-sh hides /Applications/Emacs.app/Contents/Resources/lisp/net/tramp-sh
/Users/selah/.emacs.d/plugins/tramp/tramp-loaddefs hides /Applications/Emacs.app/Contents/Resources/lisp/net/tramp-loaddefs
/Users/selah/.emacs.d/plugins/tramp/tramp-gw hides /Applications/Emacs.app/Contents/Resources/lisp/net/tramp-gw
/Users/selah/.emacs.d/plugins/tramp/tramp-ftp hides /Applications/Emacs.app/Contents/Resources/lisp/net/tramp-ftp
/Users/selah/.emacs.d/plugins/tramp/tramp-compat hides /Applications/Emacs.app/Contents/Resources/lisp/net/tramp-compat
/Users/selah/.emacs.d/plugins/tramp/tramp-cmds hides /Applications/Emacs.app/Contents/Resources/lisp/net/tramp-cmds
/Users/selah/.emacs.d/plugins/tramp/tramp-cache hides /Applications/Emacs.app/Contents/Resources/lisp/net/tramp-cache
/Users/selah/.emacs.d/el-get/nxhtml/tests/ert hides /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/ert

Features:
(shadow sort mail-extr message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader emacsbug
em-unix em-script em-ls em-hist em-pred em-glob em-dirs em-basic em-cmpl
em-term term disp-table ehelp electric em-prompt esh-opt em-banner
em-alias esh-var esh-io esh-cmd esh-ext esh-proc esh-arg esh-groups
eshell esh-module esh-mode esh-util pcmpl-unix server eldoc paredit
deft-autoloads haskell-mode-autoloads magit-autoloads wdired dired-x
hooks org-config settings edit-server hl-line which-func autorevert
delsel bindings support webjump alist-stuff plugins anything-config
compile w3m-bookmark w3m doc-view jka-compr image-mode timezone w3m-hist
w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc
w3m-util rx anything-match-plugin anything mail starttls smtpmail
sendmail rfc2047 rfc2045 ietf-drums mail-utils .loaddefs smex ido
evil-numbers surround evil evil-maps evil-integration evil-replace
evil-window windmove evil-search evil-motions evil-operators rect
evil-ex evil-insert evil-digraphs evil-visual evil-repeat evil-states
evil-undo undo-tree evil-types evil-common evil-interactive
evil-compatibility evil-vars inf-haskell-send-cmd haskell-sort-imports
haskell-navigate-imports haskell-installed-packages
haskell-align-imports yasnippet dropdown-list derived info ac-slime
my-ac-config auto-complete-config auto-complete popup rainbow-mode
clojure-mode slime-fancy slime-fontifying-fu slime-package-fu
slime-mdot-fu warnings slime-references slime-xref-browser slime-scratch
slime-presentations slime-highlight-edits slime-fuzzy
slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc
slime-enclosing-context slime-parse slime-repl slime apropos easy-mmode
hideshow pp hyperspec browse-url highlight-parentheses flymake-files
flymakemsg nxhtml-autostart nxhtml-autoload majmodpri vc-git nxhtml-menu
web-autoload nxhtml-base el-get help-mode view autoload package
tabulated-list dired color-theme-twilight color-theme-ps-warm
color-theme project project-svn generic starter-kit-lisp edmacro kmacro
starter-kit-eshell starter-kit-registers starter-kit-misc paren
tramp-cache tramp-sh tramp tramp-compat auth-source eieio byte-opt
bytecomp byte-compile cconv macroexp assoc gnus-util time-date mm-util
mail-prsvr password-cache shell pcomplete comint ring format-spec
tramp-loaddefs regexp-opt starter-kit-defuns imenu thingatpt recentf
tree-widget wid-edit easymenu ansi-color uniquify advice help-fns
advice-preload ffap saveplace cl tooltip ediff-hook vc-hooks
lisp-float-type mwheel ns-win tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process ns multi-tty
emacs)