GNU bug report logs - #19865
tar-untar-buffer: should honor default-directory

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Sat, 14 Feb 2015 11:32:01 UTC

Severity: minor

Tags: fixed, patch

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19865 <at> debbugs.gnu.org, ivan <at> siamics.net
Subject: bug#19865: tar-untar-buffer: should honor default-directory
Date: Tue, 17 Feb 2015 22:38:05 -0500
>> No: I changed directory specifically because I wanted to operate on
>> other files.  And I often don't go back.
> Then your next delete command will probably delete wrong files.

No: it would delete the wrong file if I had *not* changed directory.

> Comments cannot be a replacement for clear, self-explanatory code that
> has no hidden dependencies.

Of course, but in the case under discussion there is such a dependency,
and we're just considering two different versions of the code, both of
which have the exact same hidden dependency.
IOW this situation sucks, but the patch is not the cause of it and
doesn't make it worse (it makes it marginally better by adding
a comment and by making the behavior right).

>> The code takes a file name from one buffer and uses it in another
>> buffer: every time we do it, we have to be extra careful to make sure
>> the file name is absolute, and that's what the patch does.
> If both buffers has the same default-directory, as they should,
> there's no need to do anything special.

Right: *as they should*.  But there's no mechanism to keep them in sync.
So the next best thing is to make sure we only use the default-directory
from the proper buffer.

> To solve this problem, I proposed, in the beginning of this thread, to
> allow the user to specify a directory where to extract the tarball, by
> invoking the command with a prefix argument.

Your proposal is fine, but is orthogonal to the patch proposed by Ivan.


        Stefan




This bug report was last modified 5 years and 331 days ago.

Previous Next


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