>>>>> Ivan Shmakov writes: […] > Avoiding switching buffers until around the actual write-region call > may still be a better alternative (as that should make mistakes of > this kind hardier to introduce), but results in a lengthier patch. > Any opinion on which way I should go there? Per my reading of the code, with-current-buffer is generally used in tar-mode.el around the smallest fragments possible. Please thus consider the revised patch MIMEd, which I’ve tried to make consistent with such an approach. Also to note is that the awareness of the general “data buffer default-directory” issue dates back to 2001 at the least (considering the excerpt below, for instance), so I don’t seem to understand how making tar-untar-buffer consistent with the rest of the tar-mode.el code could ever be harmful? TIA. commit e8421604cdd386af0c32fb7cf698882ec6b74015 Author: Gerd Moellmann Date: 2001-08-07 13:36:14 +0000 (tar-extract): Avoid generating a new buffer for each file visited. From Markus Rost . $ git archive --format=tar e8421604cdd3 -- tar-mode.el | tar -xO | nl -ba … 749 ;; Set the default-directory to the dir of the 750 ;; superior buffer. 751 (setq default-directory 752 (save-excursion 753 (set-buffer tar-buffer) 754 default-directory)) … $ -- FSF associate member #7257 np. Meditation — David Modica 3013 B6A0 230E 334A