bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eli Zaretskii
Subject: bug#19865: tar-untar-buffer: should honor default-directory
Date: Mon, 16 Feb 2015 21:49:14 +0200

> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: ivan@siamics.net, 19865@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]