From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#5478: 23.1.91; Cannot use dired with cons DIRNAME arg if include remote files Date: Mon, 25 Jan 2010 21:14:20 -0800 Message-ID: <3F08B52228FF450E9346548AB6E30C7B@us.oracle.com> References: <72D5669EF250488BB23F1D1E23EB9C7F@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1264484455 23928 80.91.229.12 (26 Jan 2010 05:40:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Jan 2010 05:40:55 +0000 (UTC) To: <5478@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 26 06:40:47 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NZeAI-0007wR-E4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Jan 2010 06:40:38 +0100 Original-Received: from localhost ([127.0.0.1]:45000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZeAH-0002ye-Bd for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Jan 2010 00:40:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZe9c-0002cQ-68 for bug-gnu-emacs@gnu.org; Tue, 26 Jan 2010 00:39:56 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZe9W-0002Zj-GV for bug-gnu-emacs@gnu.org; Tue, 26 Jan 2010 00:39:54 -0500 Original-Received: from [199.232.76.173] (port=46854 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZe9V-0002ZZ-Kx for bug-gnu-emacs@gnu.org; Tue, 26 Jan 2010 00:39:49 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37453) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NZe9V-0001hE-81 for bug-gnu-emacs@gnu.org; Tue, 26 Jan 2010 00:39:49 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NZdlX-0000A6-66; Tue, 26 Jan 2010 00:15:03 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Jan 2010 05:15:03 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5478 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5478-submit@debbugs.gnu.org id=B5478.1264482894606 (code B ref 5478); Tue, 26 Jan 2010 05:15:03 +0000 Original-Received: (at 5478) by debbugs.gnu.org; 26 Jan 2010 05:14:54 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZdlN-00009j-7z for submit@debbugs.gnu.org; Tue, 26 Jan 2010 00:14:53 -0500 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZdlL-00009d-Us for 5478@debbugs.gnu.org; Tue, 26 Jan 2010 00:14:52 -0500 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet12.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o0Q5ElLc016057 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <5478@debbugs.gnu.org>; Tue, 26 Jan 2010 05:14:48 GMT Original-Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o0Q5EPe6000922 for <5478@debbugs.gnu.org>; Tue, 26 Jan 2010 05:14:26 GMT Original-Received: from abhmt004.oracle.com by acsmt353.oracle.com with ESMTP id 1476050481264482859; Mon, 25 Jan 2010 21:14:19 -0800 Original-Received: from dradamslap1 (/141.144.160.254) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 25 Jan 2010 21:14:19 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <72D5669EF250488BB23F1D1E23EB9C7F@us.oracle.com> Thread-Index: AcqeICC9Mnq/67EjTd6/PjEJakqzJAAIsJDw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt355.oracle.com [141.146.40.155] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4B5E7A46.01E0:SCFMA4539814,ss=1,fgs=0 X-Spam-Score: -6.4 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -6.4 (------) Resent-Date: Tue, 26 Jan 2010 00:15:03 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34718 Archived-At: Here is some info about the cause of this bug. It has to do with the very different way that local and remote file and directory names are handled by `insert-directory'. Remote names are not handled correctly. Local file and dir names are inserted into Dired verbatim: if they are absolute names, then they remain such. Remote names are instead relativized (they should not be). And in the case of a remote directory name, instead of the directory name itself being inserted, its constituent file names are inserted. (So there are in fact two bugs, or two aspects to this bug.) Here are some details: `dired-internal-noselect' calls `dired-readin', which calls `insert-directory' for each of the absolute file names in `dired-directory', which is the cons from the DIR-OR-LIST arg to `dired-internal-noselect'. The problem for a remote file name or a remote directory name as one of the elements of the cons comes I think from this code in the definition of `insert-directory' in ls-lisp.el: (let ((handler (find-file-name-handler (expand-file-name file) 'insert-directory)) (orig-file file) wildcard-regexp) (if handler (funcall handler 'insert-directory file switches wildcard full-directory-p) and this code in ange-ftp.el: (put 'insert-directory 'ange-ftp 'ange-ftp-insert-directory) When a local directory name or an (absolute) local file name is an element of the cons DIRNAME, `insert-directory' just inserts it verbatim as a single name in the Dired buffer. That is the correct behavior for the cons DIRNAME case: each file or dir in the cons should just be inserted in the Dired buffer. This is done by calling `ls-lisp-insert-directory'. But when a remote directory name or a remote (absolute) file name is an element of the cons DIRNAME, the handler `ange-ftp-insert-directory' is called. For a remote directory name element, it inserts the relative file names of the files in that remote dir, instead of just inserting the remote dir name itself. For a remote file-name element, it inserts the relative name instead of the absolute file name. IOW, for local files and dirs, `insert-directory' just inserts the names. For remote files and dirs, it inserts relative file names. And in the case of a remote dir, it inserts the (relative) names of the files in the dir, instead of the dir name itself.