unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: JuanLeon Lahoz <juanleon.lahoz@gmail.com>
Cc: 14652@debbugs.gnu.org
Subject: bug#14652: 24.3; ZIP files corrupted when saved via tramp
Date: Thu, 20 Jun 2013 14:02:10 +0200	[thread overview]
Message-ID: <87k3lpyoql.fsf@gmx.de> (raw)
In-Reply-To: <CANYPdHBEpNh8JguP1pvqUuy_fxeMoV9mSRmTkS-AMoQcD7gwpg@mail.gmail.com> (JuanLeon Lahoz's message of "Tue, 18 Jun 2013 13:49:51 +0200")

JuanLeon Lahoz <juanleon.lahoz@gmail.com> writes:

> Dear Emacs maintainers,

Hi,

> The funny thing is that when I modify the zip file locally, it works
> fine and emacs does not remind me I need to save the zip file (emacs
> reminds me to do it with the tgz file), but remotely emacs reminds me
> to save the zip file. When I do, it gets corrupted.
>
> I was not sure if the problem lies within tramp or in the emacs code
> that deals with zip files, so I filed a bug report to tramp. Here is
> their answer:
>
> I would say it is due to arc-mode.el. I've checked the code shortly;
> it uses `call-process' internally, which is not prepared for remote
> files.  Replacing all such calls by `process-file' was not reasonable,
> at least handling of temporary files must be improved as well.

I have checked arc-mode.el in detail; the usage of `call-process' is not
a problem, because it is applied on local copies of the archive.

Archives could be marked as "remote". In that case, the archive is not
saved by intention when it is modified, but the message mentioned above
appears.

However, the following patch I have committed to the trunk allows to
save the archive by "C-x C-s" (this is `save-buffer'), without
corrupting the archive:

--8<---------------cut here---------------start------------->8---
*** ~/src/emacs/lisp/arc-mode.el.~113092~  2013-06-20 13:56:09.298495645 +0200
--- ~/src/emacs/lisp/arc-mode.el         2013-06-20 13:40:03.496925664 +0200
***************
*** 689,697 ****
    (setq revert-buffer-function 'archive-mode-revert)
    (auto-save-mode 0)
  
!       ;; Remote archives are not written by a hook.
!       (if archive-remote nil
!         (add-hook 'write-contents-functions 'archive-write-file nil t))
  
        (make-local-variable 'require-final-newline)
        (setq require-final-newline nil)
--- 689,695 ----
    (setq revert-buffer-function 'archive-mode-revert)
    (auto-save-mode 0)
  
!       (add-hook 'write-contents-functions 'archive-write-file nil t)
  
        (make-local-variable 'require-final-newline)
        (setq require-final-newline nil)
--8<---------------cut here---------------end--------------->8---

> (I would appreciate very much a way to get a patch for fixing this,
> if/when available)

Could you, please, check whether the patch works for you?

Best regards, Michael.





  reply	other threads:[~2013-06-20 12:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 11:49 bug#14652: 24.3; ZIP files corrupted when saved via tramp JuanLeon Lahoz
2013-06-20 12:02 ` Michael Albinus [this message]
2013-06-20 12:45   ` JuanLeon Lahoz
2013-06-20 12:51     ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k3lpyoql.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=14652@debbugs.gnu.org \
    --cc=juanleon.lahoz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).