From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.devel Subject: Re: Feature Request: Function to quote filenames Date: Wed, 24 Jun 2015 17:34:16 +0200 Message-ID: <87fv5hf7d3.fsf@members.fsf.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435160182 6582 80.91.229.3 (24 Jun 2015 15:36:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Jun 2015 15:36:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: raman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 24 17:36:13 2015 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 1Z7mid-0005uZ-V4 for ged-emacs-devel@m.gmane.org; Wed, 24 Jun 2015 17:36:08 +0200 Original-Received: from localhost ([::1]:51342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7mic-0000lb-Lv for ged-emacs-devel@m.gmane.org; Wed, 24 Jun 2015 11:36:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7miT-0000hi-Os for emacs-devel@gnu.org; Wed, 24 Jun 2015 11:36:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7miP-0001xv-8o for emacs-devel@gnu.org; Wed, 24 Jun 2015 11:35:57 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:53987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7miO-0001vP-Sx for emacs-devel@gnu.org; Wed, 24 Jun 2015 11:35:53 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag4BAPrNilWkD4Xx/2dsb2JhbABbhESCUKgNAQUGkxsFhmgCghUBAQEBAQGBC4QjAQEDAXkFCwgDISUPAQRJE4gnCM1WAQEIAgEfhhyFLoUGB4QrAQSUBZN3hWOKLyaCDByBVDwxgkgBAQE Original-Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 24 Jun 2015 17:34:17 +0200 In-Reply-To: (raman@google.com's message of "Wed, 24 Jun 2015 08:26:52 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 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:187479 Archived-At: Hi, raman writes: > (setq f (shell-quote-argument "Alice's Adventures in Wonderland")) > returns > "Alice\\'s\\ Adventures\\ in\\ Wonderland" > > But invocations like > (shell-command (format "ls %s" f)) > > throw an error It works for me after saying touch "Alice's Adventures in Wonderland" in a shell. What error do you get ? > Would be nice if we had a shell-quote-filename elisp function that did > all of the magic quoting. If the aim is to quote for the shell, shell-quote-argument always did the job for me. -- Nico.