From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Quotes in Dired listing switches Date: Wed, 23 Dec 2009 22:18:58 -0500 Message-ID: References: <87vdfy5om7.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1261624763 712 80.91.229.12 (24 Dec 2009 03:19:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Dec 2009 03:19:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 24 04:19:15 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NNeEM-0005AI-DL for ged-emacs-devel@m.gmane.org; Thu, 24 Dec 2009 04:19:14 +0100 Original-Received: from localhost ([127.0.0.1]:44392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNeEM-0005FU-EQ for ged-emacs-devel@m.gmane.org; Wed, 23 Dec 2009 22:19:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNeEH-0005FF-8r for emacs-devel@gnu.org; Wed, 23 Dec 2009 22:19:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNeEB-0005Ee-Tr for emacs-devel@gnu.org; Wed, 23 Dec 2009 22:19:07 -0500 Original-Received: from [199.232.76.173] (port=60014 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNeEB-0005Eb-MA for emacs-devel@gnu.org; Wed, 23 Dec 2009 22:19:03 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:40282) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNeEB-0000bq-Lw for emacs-devel@gnu.org; Wed, 23 Dec 2009 22:19:03 -0500 Original-Received: from alfajor.home (faina.iro.umontreal.ca [132.204.26.177]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id nBO3Ixe2029024; Wed, 23 Dec 2009 22:19:00 -0500 Original-Received: by alfajor.home (Postfix, from userid 20848) id 9179A6435B; Wed, 23 Dec 2009 22:18:58 -0500 (EST) In-Reply-To: <87vdfy5om7.fsf@mail.jurta.org> (Juri Linkov's message of "Wed, 23 Dec 2009 11:07:27 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3434=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:118804 Archived-At: > (setq dired-listing-switches "-al --block-size=\"'1\"") [...] > (apply 'call-process > insert-directory-program nil t nil > '("--dired" "-al" "--block-size=\"'1\"" "--" "/tmp/.")) [...] > then Dired works correctly, but with e.g. `C-x d /sudo::/tmp' > Tramp hangs because the unmatched single quote causes the shell > to wait for the closing quote. Obviously, there's a problem in the inconsistent parsing of dired-listing-switches, where the basic code splits it at spaces without doing any additional unquoting or analysis, whereas the Tramp code seems to just pass it as-is to the shell (so if you set it to "-al $(rm -rf ~/.)" it will try to do something funny). I won't claim that the basic code's naive splitting is great, but Tramp's similarly naive use is not great either. So, I suggest to treat it as a bug in Tramp which should split it like the basic code and then shell-quote-argument the parts. Stefan