From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] make ido show known tramp host in read-directory-name Date: Wed, 20 Nov 2013 13:44:29 -0800 Organization: UCLA Anderson School of Management Message-ID: <87eh6asq82.fsf@gmail.com> References: <87iovnu5t0.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1384983891 20171 80.91.229.3 (20 Nov 2013 21:44:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2013 21:44:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 20 22:44:56 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VjFZv-0008Iu-HG for ged-emacs-devel@m.gmane.org; Wed, 20 Nov 2013 22:44:55 +0100 Original-Received: from localhost ([::1]:57250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjFZv-0005kc-4j for ged-emacs-devel@m.gmane.org; Wed, 20 Nov 2013 16:44:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjFZj-0005k9-Vi for emacs-devel@gnu.org; Wed, 20 Nov 2013 16:44:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjFZb-0001R3-GC for emacs-devel@gnu.org; Wed, 20 Nov 2013 16:44:43 -0500 Original-Received: from mail-pb0-x232.google.com ([2607:f8b0:400e:c01::232]:52504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjFZb-0001Qk-69 for emacs-devel@gnu.org; Wed, 20 Nov 2013 16:44:35 -0500 Original-Received: by mail-pb0-f50.google.com with SMTP id rr13so4072950pbb.23 for ; Wed, 20 Nov 2013 13:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=XUy+Zj8KEl6iDEB74FEuX4ysx9/CjzXPcUMczCuR/rA=; b=E9fGdH4LA5BIrEUjKAfZ0kJDQZLJZVs+XKC/AsPKmAEHEdcmrTf/33tp60ftCRkK9F LDtJf1KbyWPQEq2wMWYyB+BaMqKd0pUnqwM6/ZGFtyiJeUyyKWxy1ilHrfXE+/UWitN9 kIt3/Ak4O1J8/owH4X4VuJ28+ygPz1tMwnRwzkLQ3qzj9Lh9E9g4YyfpaCbZ+zJ2CEY2 ny/oZkfophw1duY1IiCt4U52S8dKjObNeb9N2ZTbXGKZqgRkygyfNXTyVOrihBx6yVX7 6XcPwVmIRDHCG9YI0VsYXpo4ZzuEidcDWngkSqKzJ5pRwgpf5r1l1QMxoZnJgtwDrDJI oOag== X-Received: by 10.69.11.228 with SMTP id el4mr2943905pbd.8.1384983872748; Wed, 20 Nov 2013 13:44:32 -0800 (PST) Original-Received: from localhost (cs178-204.anderson.ucla.edu. [164.67.178.204]) by mx.google.com with ESMTPSA id zq10sm45664858pab.6.2013.11.20.13.44.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 20 Nov 2013 13:44:31 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Wed, 20 Nov 2013 08:29:17 -0500") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165458 Archived-At: --=-=-= Content-Type: text/plain >>> 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-make-ido-make-dir-list-1-show-known-host.patch >From 358e9957a45b7a0689029ec014b56c37691cf939 Mon Sep 17 00:00:00 2001 From: Vitalie Spinu 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 --=-=-=--