From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#19865: tar-untar-buffer: should honor default-directory Date: Tue, 17 Feb 2015 22:38:05 -0500 Message-ID: References: <87a90gd91b.fsf@violet.siamics.net> <83sie8wn8z.fsf@gnu.org> <831tlpvp35.fsf@gnu.org> <83twyltz5x.fsf@gnu.org> <83sie5tdho.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424230764 8404 80.91.229.3 (18 Feb 2015 03:39:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Feb 2015 03:39:24 +0000 (UTC) Cc: ivan@siamics.net, 19865@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 18 04:39:10 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1YNvTh-0006Vt-V6 for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Feb 2015 04:39:10 +0100 Original-Received: from localhost ([::1]:48216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNvTh-0006kK-9y for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Feb 2015 22:39:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNvTd-0006kE-VI for bug-gnu-emacs@gnu.org; Tue, 17 Feb 2015 22:39:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNvTa-0007Jz-L2 for bug-gnu-emacs@gnu.org; Tue, 17 Feb 2015 22:39:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNvTa-0007Jr-Hi for bug-gnu-emacs@gnu.org; Tue, 17 Feb 2015 22:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YNvTa-0003cO-5X for bug-gnu-emacs@gnu.org; Tue, 17 Feb 2015 22:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Feb 2015 03:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19865 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 19865-submit@debbugs.gnu.org id=B19865.142423071013872 (code B ref 19865); Wed, 18 Feb 2015 03:39:02 +0000 Original-Received: (at 19865) by debbugs.gnu.org; 18 Feb 2015 03:38:30 +0000 Original-Received: from localhost ([127.0.0.1]:46825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNvT4-0003bf-9d for submit@debbugs.gnu.org; Tue, 17 Feb 2015 22:38:30 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:52755) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNvT0-0003bV-MC for 19865@debbugs.gnu.org; Tue, 17 Feb 2015 22:38:27 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t1I3cNti018522; Tue, 17 Feb 2015 22:38:23 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id B2AF11E3C; Tue, 17 Feb 2015 22:38:05 -0500 (EST) In-Reply-To: <83sie5tdho.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 17 Feb 2015 05:37:23 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5220=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5220> : inlines <2217> : streams <1392082> : uri <1858021> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:99528 Archived-At: >> 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