From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#19865: tar-untar-buffer: should honor default-directory Date: Tue, 17 Feb 2015 18:05:49 +0000 Message-ID: <87oaos8lc2.fsf@violet.siamics.net> References: <87a90gd91b.fsf@violet.siamics.net> <83sie8wn8z.fsf@gnu.org> <831tlpvp35.fsf@gnu.org> <83twyltz5x.fsf@gnu.org> <87sie585yc.fsf@violet.siamics.net> <83egpo7d87.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1424196394 8540 80.91.229.3 (17 Feb 2015 18:06:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Feb 2015 18:06:34 +0000 (UTC) To: 19865@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 17 19:06:19 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 1YNmXD-0002Sr-E2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Feb 2015 19:06:11 +0100 Original-Received: from localhost ([::1]:46705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNmXC-0004kj-TE for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Feb 2015 13:06:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNmX8-0004jc-Fz for bug-gnu-emacs@gnu.org; Tue, 17 Feb 2015 13:06:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNmX5-000880-9Q for bug-gnu-emacs@gnu.org; Tue, 17 Feb 2015 13:06:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNmX4-00087s-TX for bug-gnu-emacs@gnu.org; Tue, 17 Feb 2015 13:06:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YNmX4-0008Ed-FP for bug-gnu-emacs@gnu.org; Tue, 17 Feb 2015 13:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Feb 2015 18:06: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.142419636131649 (code B ref 19865); Tue, 17 Feb 2015 18:06:02 +0000 Original-Received: (at 19865) by debbugs.gnu.org; 17 Feb 2015 18:06:01 +0000 Original-Received: from localhost ([127.0.0.1]:46535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNmX3-0008EM-6N for submit@debbugs.gnu.org; Tue, 17 Feb 2015 13:06:01 -0500 Original-Received: from fely.am-1.org ([78.47.74.50]:44303) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNmX1-0008EE-CW for 19865@debbugs.gnu.org; Tue, 17 Feb 2015 13:06:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:Sender:References:Subject:To:From; bh=k3t/Rd4rXdJw4wyqtQ5l5l9zef3wE+KzfP5IW5j7GZQ=; b=Ts1Jc5i0X2NAOXjJEoHo0Bz+W0MTHRsaud+He2/wYiXPTTG/jzbfcUg/S/bqm9T2JRBRVngjK4ELCr2TI50hmjWJiLiBhkswhjjAE+0Yp2CJU81trdU6AUTd2bbVQTacZ1jrAJMn+36K2sCGXznvoy/3lX+DIuJTahKYgn98jMU=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YNmWz-0003pr-UM for 19865@debbugs.gnu.org; Tue, 17 Feb 2015 18:05:58 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YNmWs-0006Eh-Fo for 19865@debbugs.gnu.org; Wed, 18 Feb 2015 01:05:50 +0700 Mail-Followup-To: 19865@debbugs.gnu.org In-Reply-To: <83egpo7d87.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 17 Feb 2015 17:46:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) 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:99500 Archived-At: >>>>> Eli Zaretskii writes: >>>>> From: Ivan Shmakov Date: Tue, 17 Feb 2015 05:25:47 +0000 [=E2=80=A6] > Emacs maintenance shouldn't pay a price for marginal use cases for > which simple workarounds (like "M-x cd BACK") are available. It is not a workaround for the problem in question. [=E2=80=A6] >> We=E2=80=99re using with-current-buffer there for the sole reason that >> write-region operates strictly on the current buffer. It is so >> without this change, and it remains so with it; the change maintains >> this status quo just perfectly. And as long as such use /is/ >> acceptable in the current code, I fail to see why it wouldn=E2=80=99t b= e in >> the replacement being discussed. > I already explained that, more than once: And I=E2=80=99ve already provided an example where default-directory is changed by Emacs behind the back of the user. > the change is obscure, Yet it makes the code /less/ obscure that it currently is. > and is made for the sake of a marginal use case, It is made for the sake of consistency with the rest of the tar-mode.el code. And sure: it fixes that marginal use case at the same time, too. > where the user should have returned to the original directory from > which she cd'ed, to avoid the problem. The use of M-x cd on a buffer does not influence the behavior of tar-untar-buffer for that same buffer in any way. When it thinks =E2=80=93 for whatever reason =E2=80=93 that it should use /that/directory as its target, =E2=80=93 it=E2=80=99s stuck that way, and = no sensible user action is going to change its twisted mind. (Incidentally, this is the very description of this bug.) There=E2=80=99s simply /no/ problem which the user could solve by changing the value of default-directory =E2=80=93 whether back, forth, or sideways. >> What /is/ changed is that with-current-buffer will now go >> immediately before write-region: >> (with-current-buffer data-buffer (write-region =E2=80=A6)) >> Cf. the former: >> (with-current-buffer data-buffer =E2=80=A6 lots of code to make sure the >> reader=E2=80=99s lost=E2=80=A6 (write-region =E2=80=A6)) [=E2=80=A6] > Now put yourself in the shoes of someone who needs to review this > change many moons from now, and try to imagine how "easy" it will be > for them to understand what the heck was that all about. Whose shoes do you think I was in while I=E2=80=99ve investigated this issue? My first thought: why on Earth does with-current-buffer wraps some 18=C2=A0LoC while it=E2=80=99s needed for exactly a single one? As for the =E2=80=9Cmany moons=E2=80=9D part, I think I=E2=80=99d request = a re-review after a few. Hopefully someone=E2=80=99d provide some more convincing arguments by then, since I=E2=80=99m pretty much out of ink right now. (And TIA to that party, sure.) [=E2=80=A6] --=20 FSF associate member #7257 tar-mode.el does nasty things 3013 B6A0 230E 33= 4A