GNU bug report logs - #11010
tar-subfile-save-buffer: Buffer is read-only: #<buffer foo.tar>

Previous Next

Package: emacs;

Reported by: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>

Date: Tue, 13 Mar 2012 17:36:02 UTC

Severity: normal

Fixed in version 24.0.95

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11010 in the body.
You can then email your comments to 11010 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11010; Package emacs. (Tue, 13 Mar 2012 17:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 13 Mar 2012 17:36:02 GMT) Full text and rfc822 format available.

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

From: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: tar-subfile-save-buffer: Buffer is read-only: #<buffer foo.tar>
Date: Tue, 13 Mar 2012 13:05:12 -0400
[Message part 1 (text/plain, inline)]
Opening a tar file and then a sub file, used to be able to save.
Doesn't seem to be the case in the latest Emacs pretest.  In fact,
everything's opening as read-only.

Test case:

M-! touch foo; tar cf foo.tar foo RET
C-x C-f foo.tar RET f C-x q
<EDIT>
C-x s !

The above should save the files including the sub file, but instead
complains about the tar file being.

The following patch removes the C-x q and saving actually works.
Seems this bug was a result of tar-mode inheriting from special-mode.

Thanks for Emacs,
/a

2012-03-13  Aaron S. Hawley  <Aaron.S.Hawley <at> gmail.com>

        * tar-mode.el (tar-mode): Fix saving by conditionally undoing
        `special-mode' setting of `buffer-read-only'.

--- tar-mode.el	2012-02-13 11:13:25.000000000 -0500
+++ tar-mode.el	2012-03-13 12:54:00.376389400 -0400
@@ -634,6 +634,9 @@

 See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
 \\{tar-mode-map}"
+  (when (and buffer-file-name
+             (file-writable-p buffer-file-name))
+    (setq buffer-read-only nil)) ;; Undo what `special-mode' did.
   (make-local-variable 'tar-parse-info)
   (set (make-local-variable 'require-final-newline) nil) ; binary data, dude...
   (set (make-local-variable 'local-enable-local-variables) nil)
[tar-mode.el.diff (application/octet-stream, attachment)]

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Fri, 16 Mar 2012 07:53:02 GMT) Full text and rfc822 format available.

Notification sent to "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>:
bug acknowledged by developer. (Fri, 16 Mar 2012 07:53:02 GMT) Full text and rfc822 format available.

Message #10 received at 11010-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 11010-done <at> debbugs.gnu.org
Subject: Re: bug#11010: tar-subfile-save-buffer: Buffer is read-only: #<buffer
	foo.tar>
Date: Fri, 16 Mar 2012 03:22:18 -0400
Version: 24.0.95

Thanks; applied.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Apr 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 21 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.