GNU bug report logs - #30724
eshell: escaped tilde is not treated as such

Previous Next

Package: emacs;

Reported by: Yegor Timoshenko <yegortimoshenko <at> riseup.net>

Date: Tue, 6 Mar 2018 04:57:03 UTC

Severity: normal

Tags: confirmed, fixed

Fixed in version 26.2

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jonathan Kyle Mitchell <kyle <at> jonathanmitchell.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 30724 <at> debbugs.gnu.org, Yegor Timoshenko <yegortimoshenko <at> riseup.net>
Subject: bug#30724: eshell: escaped tilde is not treated as such
Date: Sun, 15 Jul 2018 12:18:26 -0500
[Message part 1 (text/plain, inline)]
On Sat, 2018-07-07 at 15:17 -0400, Noam Postavsky wrote:
> 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)

After tracing through the execution of eshell some more, I noticed that
eshell sets an escaped text property on the arguments when the user
escaped them with `\' or quote characters but there is nothing in
eshell that does anything with it apparently.

I've attached a new patch that checks for the escaped text property on
any single character argumentand.  I've also added a new symbol
property to the following functions that take filename arguments and
use that to check instead of the eshell-no-numeric-conversions
property.

(eshell/cd)
(eshell/pushd)
(eshell/popd)
(eshell/ls)
(eshell/rm)
(eshell/mkdir)
(eshell/rmdir)
(eshell/mv)
(eshell/cp)
(eshell/ln)
(eshell/cat)
(eshell/du)
(eshell/diff)
(eshell/addpath)

> 
> 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 ...

Thanks for the comments and suggestions, I fixed the commit message in the new patch.

--
Jonathan Kyle Mitchell
[0001-Check-for-special-filenames-in-eshell-Bug-30724.patch (text/x-patch, attachment)]

This bug report was last modified 6 years and 309 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.