GNU bug report logs - #10911
24.0.94; `ido-read-directory-name' should offer known hosts for completion

Previous Next

Package: emacs;

Reported by: Oleksandr Manzyuk <manzyuk <at> gmail.com>

Date: Wed, 29 Feb 2012 12:54:02 UTC

Severity: wishlist

Found in version 24.0.94

To reply to this bug, email your comments to 10911 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10911; Package emacs. (Wed, 29 Feb 2012 12:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleksandr Manzyuk <manzyuk <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 29 Feb 2012 12:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Oleksandr Manzyuk <manzyuk <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.94;
	`ido-read-directory-name' should offer known hosts for completion
Date: Wed, 29 Feb 2012 12:52:15 +0000
This is a feature request rather than a bug.  `ido-read-directory-name'
doesn't offer known hosts for completion, unlike `ido-read-file-name'.
Here is what I mean by that.  I'm assuming that `ido-mode' is on.
Please forgive me if I belabor the point.

When I type C-x C-f // and hit TAB, I obtain an *Ido Completions* buffer
containing not only local directory names (bin/, boot/, dev/ etc.), but
also known hosts, which is very convenient in conjunction with TRAMP.  I
can type C-x C-f // g o RET, which expands into /golconda.cs.nuim.ie:,
and if I already have a remote shell running on that host, I can see a
list of files and directories there.  If there is no remote shell yet, I
can simply hit RET, and it will be opened using TRAMP.  Of course, I can
open a dired buffer visiting a remote directory this way, but it should
also be equally convenient to do that with `ido-dired'.  While it is
possible, it is also less convenient: I have to type C-x d //, type the
host name followed by colon *in full and without completion*.

Summarizing, there is a discrepancy in how `ido-read-directory-name' and
`ido-read-file-name' generate completions, and I don't see why this
should be the case.

While I'm happy with C-x C-f for opening dired buffers, also on remote
hosts, having `ido-read-directory-name' complete known hosts would make
this function more useful for other purposes.  For example, I have the
following function:

(defun named-shell (name directory)
  "Open a named shell. NAME is the base name of the shell buffer,
and DIRECTORY is the directory to open the shell in."
  (interactive "MName: \nDDirectory: ")
  (switch-to-buffer (concat "*" name "*"))
  (cd directory)
  (shell (current-buffer)))

I introduced it primarily to be able to quickly open inferior remote
shells.  However, when I'm queried for the directory to open the shell
in, I still have to type in the host name in full.


In GNU Emacs 24.0.94.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
 of 2012-02-28 on pandora
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Configured using:
 `configure '--prefix=/home/manzyuk''

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_IE.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  eldoc-mode: t
  diff-auto-refine-mode: t
  paredit-mode: t
  ido-everywhere: t
  shell-dirtrack-mode: t
  savehist-mode: t
  icomplete-mode: t
  global-auto-revert-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-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:
M-x r e p r o t <backspace> <backspace> <backspace> 
o r t SPC e m a c s SPC b u g <return>

Recent messages:
Loading /home/manzyuk/emacs-preamble/init.el (source)...
Loading /home/manzyuk/.emacs.d/elpa/haskell-mode-2.8.0/haskell-site-file.el (source)...done
Loading /home/manzyuk/quicklisp/slime-helper.el (source)...done
Loading /home/manzyuk/emacs-preamble/init.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort flyspell ispell mail-extr emacsbug message rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader eldoc preamble-scheme preamble-ruby inf-ruby
ruby-mode compile preamble-org org-install preamble-magit preamble-diff
magit-bisect magit-key-mode magit diff-mode log-edit easy-mmode
pcvs-util add-log preamble-lisp info-look slime-autoloads
preamble-haskell ghci-completion preamble-google-translate
google-translate json url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-util url-parse url-vars mailcap
preamble-emacs-lisp preamble-paredit paredit preamble-auctex reftex
reftex-vars preamble-package finder-inf auctex-autoloads tex-site info
easymenu ghci-completion-autoloads google-translate-autoloads
haskell-mode-autoloads inf-ruby-autoloads magit-autoloads
paredit-autoloads package tabulated-list preamble-text preamble-shell
preamble-prog preamble-makefile preamble-mail smtpmail sendmail rfc2047
rfc2045 ietf-drums mail-utils preamble-ido ido preamble-ibuffer
preamble-hippie-expand preamble-ediff preamble-dired preamble-comint
preamble-ansi-color preamble-windows preamble-tramp tramp tramp-compat
auth-source eieio byte-opt bytecomp byte-compile cconv macroexp assoc
gnus-util mm-util mail-prsvr password-cache shell pcomplete comint
ansi-color ring format-spec tramp-loaddefs regexp-opt preamble-server
server preamble-mouse preamble-mode-line preamble-minibuffer savehist
icomplete preamble-keyboard preamble-initialization preamble-frames
preamble-files uniquify advice help-fns advice-preload autorevert
preamble-env preamble-editing paren delsel edmacro kmacro preamble-data
saveplace preamble-browse-url preamble-bookmarks preamble-utils
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
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 dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10911; Package emacs. (Sat, 23 Oct 2021 03:04:02 GMT) Full text and rfc822 format available.

Message #8 received at 10911 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Oleksandr Manzyuk <manzyuk <at> gmail.com>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 10911 <at> debbugs.gnu.org
Subject: Re: bug#10911: 24.0.94; `ido-read-directory-name' should offer known
 hosts for completion
Date: Fri, 22 Oct 2021 20:03:04 -0700
Hi Michael,

Could you perhaps take a look at the below bug?  It seems to relate to
completions when using Tramp.

Oleksandr Manzyuk <manzyuk <at> gmail.com> writes:

> This is a feature request rather than a bug.  `ido-read-directory-name'
> doesn't offer known hosts for completion, unlike `ido-read-file-name'.
> Here is what I mean by that.  I'm assuming that `ido-mode' is on.
> Please forgive me if I belabor the point.
>
> When I type C-x C-f // and hit TAB, I obtain an *Ido Completions* buffer
> containing not only local directory names (bin/, boot/, dev/ etc.), but
> also known hosts, which is very convenient in conjunction with TRAMP.  I
> can type C-x C-f // g o RET, which expands into /golconda.cs.nuim.ie:,
> and if I already have a remote shell running on that host, I can see a
> list of files and directories there.  If there is no remote shell yet, I
> can simply hit RET, and it will be opened using TRAMP.  Of course, I can
> open a dired buffer visiting a remote directory this way, but it should
> also be equally convenient to do that with `ido-dired'.  While it is
> possible, it is also less convenient: I have to type C-x d //, type the
> host name followed by colon *in full and without completion*.
>
> Summarizing, there is a discrepancy in how `ido-read-directory-name' and
> `ido-read-file-name' generate completions, and I don't see why this
> should be the case.
>
> While I'm happy with C-x C-f for opening dired buffers, also on remote
> hosts, having `ido-read-directory-name' complete known hosts would make
> this function more useful for other purposes.  For example, I have the
> following function:
>
> (defun named-shell (name directory)
>   "Open a named shell. NAME is the base name of the shell buffer,
> and DIRECTORY is the directory to open the shell in."
>   (interactive "MName: \nDDirectory: ")
>   (switch-to-buffer (concat "*" name "*"))
>   (cd directory)
>   (shell (current-buffer)))
>
> I introduced it primarily to be able to quickly open inferior remote
> shells.  However, when I'm queried for the directory to open the shell
> in, I still have to type in the host name in full.
>
>
> In GNU Emacs 24.0.94.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
>  of 2012-02-28 on pandora
> Windowing system distributor `The X.Org Foundation', version 11.0.10707000




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10911; Package emacs. (Wed, 27 Oct 2021 15:28:02 GMT) Full text and rfc822 format available.

Message #11 received at 10911 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Oleksandr Manzyuk <manzyuk <at> gmail.com>, 10911 <at> debbugs.gnu.org
Subject: Re: bug#10911: 24.0.94; `ido-read-directory-name' should offer
 known hosts for completion
Date: Wed, 27 Oct 2021 17:27:34 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> Hi Michael,

Hi,

> Could you perhaps take a look at the below bug?  It seems to relate to
> completions when using Tramp.

Somehow, I did miss the bug. I don't read all bug reports, and likely
the subject line was too long in order to get my attention with the
words "known hosts". So be it just now.

> Oleksandr Manzyuk <manzyuk <at> gmail.com> writes:
>
>> This is a feature request rather than a bug.  `ido-read-directory-name'
>> doesn't offer known hosts for completion, unlike `ido-read-file-name'.
>> Here is what I mean by that.  I'm assuming that `ido-mode' is on.
>> Please forgive me if I belabor the point.
>>
>> When I type C-x C-f // and hit TAB, I obtain an *Ido Completions* buffer
>> containing not only local directory names (bin/, boot/, dev/ etc.), but
>> also known hosts, which is very convenient in conjunction with TRAMP.  I
>> can type C-x C-f // g o RET, which expands into /golconda.cs.nuim.ie:,
>> and if I already have a remote shell running on that host, I can see a
>> list of files and directories there.  If there is no remote shell yet, I
>> can simply hit RET, and it will be opened using TRAMP.  Of course, I can
>> open a dired buffer visiting a remote directory this way, but it should
>> also be equally convenient to do that with `ido-dired'.  While it is
>> possible, it is also less convenient: I have to type C-x d //, type the
>> host name followed by colon *in full and without completion*.
>>
>> Summarizing, there is a discrepancy in how `ido-read-directory-name' and
>> `ido-read-file-name' generate completions, and I don't see why this
>> should be the case.

Well, time has passed, and Tramp has changed. Meanwhile, a method name
is mandatory.

I've tried with recent master (Emacs 29.0.50). If I call

emacs -Q -L ~/src/tramp/lisp/ -l tramp -f ido-mode

I can type "C-x d /ss TAB", and the method "ssh" is not offered. So I
continue with "h: TAB", and again, the host name is not offered.

If I read a file name, via "C-x C-f /ss TAB", it completes to "/ssh:"
(and the similar methods). Typing ": TAB" gives me host name
completion. So the situation is similar to what the OP has reported.

However, I don't know ido.el pretty good, so some body else, who knows
this beast, might continue with analysis. If there are questions from
Tramp, don't hesitate to ask.

Best regards, Michael.




This bug report was last modified 3 years and 228 days ago.

Previous Next


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