From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: raman Newsgroups: gmane.emacs.devel Subject: Feature Request: Function to quote filenames Date: Wed, 24 Jun 2015 08:26:52 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435159640 29489 80.91.229.3 (24 Jun 2015 15:27:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Jun 2015 15:27:20 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 24 17:27:14 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 1Z7ma0-00072A-F0 for ged-emacs-devel@m.gmane.org; Wed, 24 Jun 2015 17:27:12 +0200 Original-Received: from localhost ([::1]:51250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7mZz-00030l-VG for ged-emacs-devel@m.gmane.org; Wed, 24 Jun 2015 11:27:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7mZq-0002qn-L1 for emacs-devel@gnu.org; Wed, 24 Jun 2015 11:27:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7mZl-0005ur-LY for emacs-devel@gnu.org; Wed, 24 Jun 2015 11:27:02 -0400 Original-Received: from mail-pd0-x22a.google.com ([2607:f8b0:400e:c02::22a]:33740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7mZl-0005uc-DG for emacs-devel@gnu.org; Wed, 24 Jun 2015 11:26:57 -0400 Original-Received: by pdjn11 with SMTP id n11so32801574pdj.0 for ; Wed, 24 Jun 2015 08:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; bh=CXqYWDDrJllvdKw05HZTYBi4FCbt3vi6l13V4wKSds0=; b=F9w5ZRo87pfDYTrQxGQ0Iu87Ld4fbgUGZSqK1HYaWgaHJxb5Qo4amA5nZjptIUQ9it QkwNHs2afUjAzMGtwiWsWnM/xc0o4PmVyfnJeBvvGs0M2Px6FP1pTj5t9n6rlYLLinpx YEwpE1Bx2tJSXKpTTqCJiz9LRWZsUWc/O09reOXXnE5XBSCTb/QY3Ay2KeQc2eFM0Bb1 nR9g5dLQnB2OXwDpiAJ6lR/UspTTVXXHC3qXLDapjUbv9cSAzBCydPMK5ulA+YlfkoBO R9GlHCCyb3IIE6hVtRHAOsBxBQeD5B5hpTfGgwCSIhnoEzKfVvC3X9ksE6kpdPgxDaQe +chA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=CXqYWDDrJllvdKw05HZTYBi4FCbt3vi6l13V4wKSds0=; b=TNH+J1zJTT2pPP7ioWOmSak4UR4LU4VbzSYfpKWs2rhBP2N0EXL15R6s0Lq6fBzOpt PUjLFJkAaaLFV9aEYYx76DCDfY43F/BfF4bj9UqNrkuRCSTH9ludRez0orjyfUA9Hkeq fClBXYrMGB4F0clsaiRO0GTxD4Md3rED3Ln5s8teeUJBb0aZ83UcRUwe+SVnblkE7a7L sCMqwzdBl0X+6Kd4NOPmUbU6dUHM+fXzdl4KhWirljMhLWCsJNM2Dh/LfYsSkB92/HXb z81wygEytO0RGzBGXlPxMSp+R4x4dCGsHPhfGUGGwemXtdecduM3eERzS8F6YWqrp3cu 5FAw== X-Gm-Message-State: ALoCoQl7pjoqJAzaS8fZrJ+p1LbHQi0Buyan+2AliXnMDH4QbsVhbjbGLz8lrwFZrCTrJNWODbYp X-Received: by 10.66.102.65 with SMTP id fm1mr80204047pab.25.1435159616190; Wed, 24 Jun 2015 08:26:56 -0700 (PDT) Original-Received: from raman-glaptop2 ([207.198.105.24]) by mx.google.com with ESMTPSA id wp5sm20605888pab.22.2015.06.24.08.26.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 24 Jun 2015 08:26:55 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::22a 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:187478 Archived-At: Feature Request: Motivated by the increasing number of filenames that show up with spc, "'" and other punctuation characters in their name. The only helper function Emacs provides today is shell-quote-argument -- which often doesn't do the trick. As an example: Given the filename: Alice's Adventures in Wonderland (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's never obvious what quoting magic to use to get all the cases right. Would be nice if we had a shell-quote-filename elisp function that did all of the magic quoting. --