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: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 19865 <at> debbugs.gnu.org, ivan <at> siamics.net
Subject: bug#19865: tar-untar-buffer: should honor default-directory
Date: Mon, 16 Feb 2015 21:49:14 +0200
> From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
> Cc: ivan <at> siamics.net, 19865 <at> debbugs.gnu.org
> Date: Mon, 16 Feb 2015 14:34:02 -0500
> 
> > I can only re-iterate what I already said: we shouldn't cater to
> > marginal use cases like that with code that is "tricky" (a.k.a.
> > "maintenance headache").  People who change directories of their
> > buffers should (and do) know what they are doing.  If doing that
> > causes them annoyances, they will know better next time.
> 
> Hmm... so you're considering `M-x cd' as harmful?

Not harmful, potentially dangerous, especially in buffers that have
associated files, or where default-directory plays some other
significant role.  People who do that should "M-x cd" back before they
invoke functions that use the value.

It's the same as working in the shell: if you changed a directory, you
need to go back before you operate on files, or risk operate on wrong
files.

> I agree that having to be careful in which buffer we are when we read
> a given variable because it might be buffer-local is a source of
> maintenance headaches, but we have that all over the place in Elisp,
> and we don't really have any "better solution".

I don't really see a problem here that needs a solution.  A year from
now no one will remember or understand why we use with-current-buffer
in that place.  Doing so for such a weak reason is unwise, and no
amount of cruft we have elsewhere can justify adding to that.




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.