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

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

[debbugs-tracker] bug#11010: closed (tar-subfile-save-buffer: Buffer is


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#11010: closed (tar-subfile-save-buffer: Buffer is read-only: #<buffer foo.tar>)
Date: Fri, 16 Mar 2012 07:53:02 +0000

Your message dated Fri, 16 Mar 2012 03:22:18 -0400
with message-id <address@hidden>
and subject line Re: bug#11010: tar-subfile-save-buffer: Buffer is read-only: 
#<buffer foo.tar>
has caused the debbugs.gnu.org bug report #11010,
regarding tar-subfile-save-buffer: Buffer is read-only: #<buffer foo.tar>
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
11010: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11010
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: tar-subfile-save-buffer: Buffer is read-only: #<buffer foo.tar> Date: Tue, 13 Mar 2012 13:05:12 -0400
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  <address@hidden>

        * 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)

Attachment: tar-mode.el.diff
Description: Binary data


--- End Message ---
--- Begin Message --- Subject: Re: bug#11010: tar-subfile-save-buffer: Buffer is read-only: #<buffer foo.tar> Date: Fri, 16 Mar 2012 03:22:18 -0400 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Version: 24.0.95

Thanks; applied.


--- End Message ---

reply via email to

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