all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vitalie Spinu <spinuvit@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] make ido show known tramp host in read-directory-name
Date: Wed, 20 Nov 2013 13:44:29 -0800	[thread overview]
Message-ID: <87eh6asq82.fsf@gmail.com> (raw)
In-Reply-To: <jwvmwkzdwy3.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 20 Nov 2013 08:29:17 -0500")

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

 >>> Stefan Monnier on Wed, 20 Nov 2013 08:29:17 -0500 wrote:

 >> +		(and (ido-final-slash (concat dir name))
 > Can expand-file-name be used here instead of concat?

Not really. The dir is like /ssh: and the name is like "amazon:". The
concat is for ido-final-slash to see that the name actually contains the
tramp root. 

The following patch is probably a cleaner implementation of the same
idea:



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-make-ido-make-dir-list-1-show-known-host.patch --]
[-- Type: text/x-diff, Size: 1467 bytes --]

From 358e9957a45b7a0689029ec014b56c37691cf939 Mon Sep 17 00:00:00 2001
From: Vitalie Spinu <spinuvit@gmail.com>
Date: Tue, 19 Nov 2013 18:52:35 -0800
Subject: [PATCH 1/1] make ido-make-dir-list-1 show known host

   allow missing end slash with tramp directories
---
 lisp/ido.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lisp/ido.el b/lisp/ido.el
index 42b3607..08c9c47 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -3672,13 +3672,15 @@ in this list."
 (defun ido-make-dir-list-1 (dir &optional merged)
   "Return list of non-ignored subdirs in DIR.
 If MERGED is non-nil, each subdir is cons'ed with DIR."
-  (and (or (ido-is-tramp-root dir) (file-directory-p dir))
-       (delq nil
-	     (mapcar
-	      (lambda (name)
-		(and (ido-final-slash name) (not (ido-ignore-item-p name ido-ignore-directories))
-		     (if merged (cons name dir) name)))
-	      (ido-file-name-all-completions dir)))))
+  (let ((tramp-root (ido-is-tramp-root dir)))
+    (and (or tramp-root (file-directory-p dir))
+         (delq nil
+               (mapcar
+                (lambda (name)
+                  (and (or tramp-root (ido-final-slash dir))
+                       (not (ido-ignore-item-p name ido-ignore-directories))
+                       (if merged (cons name dir) name)))
+                (ido-file-name-all-completions dir))))))
 
 (defun ido-make-dir-list (default)
   "Return the current list of directories.
-- 
1.8.1.2


      reply	other threads:[~2013-11-20 21:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20  3:10 [PATCH] make ido show known tramp host in read-directory-name Vitalie Spinu
2013-11-20 13:29 ` Stefan Monnier
2013-11-20 21:44   ` Vitalie Spinu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eh6asq82.fsf@gmail.com \
    --to=spinuvit@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.