From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#30724: eshell: escaped tilde is not treated as such Date: Sat, 07 Jul 2018 15:17:30 -0400 Message-ID: <87zhz2dfed.fsf@gmail.com> References: <97031714eb3479b466bca0545b76114e4d40e898.camel@jonathanmitchell.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530990968 710 195.159.176.226 (7 Jul 2018 19:16:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Jul 2018 19:16:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 30724@debbugs.gnu.org, Yegor Timoshenko To: Jonathan Kyle Mitchell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 07 21:16:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbsgc-0008UV-SM for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Jul 2018 21:16:03 +0200 Original-Received: from localhost ([::1]:34653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbsij-0007go-FT for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Jul 2018 15:18:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbsic-0007ga-Mr for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 15:18:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbsiY-0005lR-MV for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 15:18:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42531) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbsiY-0005lH-HK for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 15:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fbsiY-0008TU-8f for bug-gnu-emacs@gnu.org; Sat, 07 Jul 2018 15:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Jul 2018 19:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30724 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 30724-submit@debbugs.gnu.org id=B30724.153099106332550 (code B ref 30724); Sat, 07 Jul 2018 19:18:02 +0000 Original-Received: (at 30724) by debbugs.gnu.org; 7 Jul 2018 19:17:43 +0000 Original-Received: from localhost ([127.0.0.1]:50428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbsiF-0008Sw-3X for submit@debbugs.gnu.org; Sat, 07 Jul 2018 15:17:43 -0400 Original-Received: from mail-it0-f45.google.com ([209.85.214.45]:33215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbsiA-0008Se-35 for 30724@debbugs.gnu.org; Sat, 07 Jul 2018 15:17:38 -0400 Original-Received: by mail-it0-f45.google.com with SMTP id y124-v6so8145788itc.0 for <30724@debbugs.gnu.org>; Sat, 07 Jul 2018 12:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=BZc0Q9+fubNX9JnYHbTtAqhjQfo9gj/yNHr55F6++e4=; b=gi3h6hDWA1ObXhfgpNnRav+WPHRgtrXqwy77hQ/acPp5PLW1Xn4G1p1NOmF05nrEmi tJITsw7xhP1J8kbj7NmPc6Hd2hHIfmFecK4251rH+FXC++V6mVmiEshLRbWt4u7Opfg9 3f0zg6Jot6VM/IpeTG0KWJeE0YNRF7dnIodgmbhQ4U7uFgXhK1aGNSraUr3xWCDQ57/q TIhcSaWaN11MdHN/eFLJSRqIHen6Jmqi9DfTdgIh1ZO6z9vBUw+cxMalXjcalC5mIAJl mMBpYQ4jl9D5hlEPLVo7mzu5G0cLi+ONv1bVzu0U/VfRIBTf6EgtFAfcg+dW0gpAcoZS Q06Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=BZc0Q9+fubNX9JnYHbTtAqhjQfo9gj/yNHr55F6++e4=; b=HsHNCw7JPnp9jK/sO5wMqq28QLOpr2gSXvN+Dzis+7g1SZAZ01OHqRKye25wEr/FfI ulIHyDkVRtN4nea+wFsdzjmXNdwg+O0B+gpvaLY72a2tDnUmRi+7u3HMVbutwvAPFuMb z7zhTP2jElrT1bCqlVKTRIpPw9tfH8wY32AUMfEE2SVcO+wCewN9OEQ+ing/zdQHL4Bg Qp7WT6Q7hN2H+qUvBfjRKIma6UVlNbGwPnEXQqMDHtoPGGj7fm3ZsapQWHQZUIrVpg2y 9Cz4dRmXqkoQuUlousHvYpiwiODE5YBVJf8tAOKpOKRPzCxM5hrBWlHpS16xrUwEj2qB B5GQ== X-Gm-Message-State: APt69E30HNU6BYUJxCsrui3RAtaNsorFr56aSMbsao9RXGNei8z7ek5Q 9G06iD1o+0GZSen9oLCA9s4= X-Google-Smtp-Source: AAOMgpfTE0VKjhujFfF2FTblWNHWBCH4/rBVf8Z7wH5l+L5bNOZWeMY9JzoCCc0D3ig7ibVBuNvvDQ== X-Received: by 2002:a24:a343:: with SMTP id p64-v6mr12013393ite.61.1530991052521; Sat, 07 Jul 2018 12:17:32 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id v192-v6sm1696056itc.2.2018.07.07.12.17.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jul 2018 12:17:31 -0700 (PDT) In-Reply-To: <97031714eb3479b466bca0545b76114e4d40e898.camel@jonathanmitchell.org> (Jonathan Kyle Mitchell's message of "Fri, 06 Jul 2018 02:24:20 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148315 Archived-At: Jonathan Kyle Mitchell writes: > tags 30724 + patch > quit You have to send this control@debbugs.gnu.org to have effect, generally you should use Bcc so that further replies don't go there (which is why you don't see it when other people do this). > I found a way to get eshell to escape special chars. It seems most of > the eshell builtin commands that take file arguments are already tagged > with the eshell-no-numeric-conversions property. By adding the true > part of the if condition in eshell-lisp-command, it is possible to > quote the arguments of special filenames. The attached patch checks > for "~" and "*". Perhaps we should distinguish between file and non-numeric arguments though? E.g., I think the file-name-quote might not make sense for the commands below: > ./esh-proc.el\0202:(put 'eshell/kill 'eshell-no-numeric-conversions t) > ./em-unix.el\0167:(put 'eshell/man 'eshell-no-numeric-conversions t) > ./em-unix.el\0664:(put 'eshell/make 'eshell-no-numeric-conversions t) > ./em-unix.el\01050:(put 'eshell/locate 'eshell-no-numeric-conversions > ./em-unix.el\01059:(put 'eshell/occur 'eshell-no-numeric-conversions t) > ./esh-cmd.el\01185:(put 'eshell/which 'eshell-no-numeric-conversions t) > ./em-tramp.el\097:(put 'eshell/su 'eshell-no-numeric-conversions t) > ./em-tramp.el\0139:(put 'eshell/sudo 'eshell-no-numeric-conversions t) > Fix bug#30724 by checking if "*" and "~" are arguments to the current command > and quoting them relative to `default-directory' if so. This leverages the > the fact that the existing eshell builtin commands that accept file arguments > are tagged with the eshell-no-numeric-conversions property. The existing > details of eshell command execution are left unchanged. > > * lisp/eshell/esh-cmd.el (eshell-lisp-command) The ChangeLog item should at the beginning, as in, * lisp/eshell/esh-cmd.el (eshell-lisp-command): Fix bug#30724 by checking if "*" and "~" are arguments to the current command ...