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


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ivan Shmakov <ivan <at> siamics.net>
To: submit <at> debbugs.gnu.org
Subject: tar-untar-buffer: should honor default-directory 
Date: Sat, 14 Feb 2015 11:31:12 +0000
[Message part 1 (text/plain, inline)]
Package:  emacs
Severity: minor
Tags: patch

	As currently implemented (tested on 7eb2077f9dd1, 2015-02-06
	15:01:12 UTC), tar-untar-buffer uses the default-directory value
	for the “data” buffer (see tar-data-buffer), instead of the
	(arguably much less obscure) one for the tar-mode buffer itself
	(which could easily be changed by the user via M-x cd.)

	A possible fix is to remember the default-directory value in the
	same ‘let’ form used to do so for tar-parse-info, along the
	lines of the patch MIMEd.

-- 
FSF associate member #7257  np. A World Behind the World — Jami Sieber
[Message part 2 (text/diff, inline)]
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -531,6 +542,7 @@ defun tar-untar-buffer ()
   (interactive)
   ;; FIXME: make it work even if we're not in tar-mode.
-  (let ((descriptors tar-parse-info))   ;Read the var in its buffer.
+  (let ((descriptors tar-parse-info)    ; Read the var in its buffer.
+        (dest-dir default-directory))
     (with-current-buffer
         (if (tar-data-swapped-p) tar-data-buffer (current-buffer))
       (set-buffer-multibyte nil)          ;Hopefully, a no-op.
@@ -544,5 +564,6 @@ defun tar-untar-buffer ()
                (dir (if (eq (tar-header-link-type descriptor) 5)
                         name
                       (file-name-directory name)))
+               (default-directory dest-dir)
                (start (tar-header-data-start descriptor))
                (end (+ start (tar-header-size descriptor))))

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.