Subject: Re: bug#79316: End-of-line problems with text files inside zip files

From: Eli Zaretskii <[email-masked]>
Date: Sat, 30 Aug 2025 19:57:39 +0300

> Date: Sat, 30 Aug 2025 18:30:48 +0200
> Cc: [email-masked]
> From: "R. Diez" <[email-masked]>
> 
> > [...]
> > Long story short, please try the patch below, and see if it gives good
> > results without introducing any new problems.
> 
> I had some difficulty with the patch. It seems to be for Git, but I haven't built Emacs from Git, and tool 'patch' could not find the file.

Thanks.

For the future, you can apply patches meant for Git using the 'patch'
utility if you pass the -pN switch to 'patch', where N is the number
of slashes to remove from the file names mentioned in the patch.  So,
for example, if the patch says

  diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
  index 8f6c71a..fbfd7cc 100644
  --- a/lisp/arc-mode.el
  +++ b/lisp/arc-mode.el

and the unpatched arc-mode.el lives in the directory /foo/bar/lisp,
you can invoke 'patch' like this:

  $ patch -d /foo/bar/lisp -p2 < PATCH-FILE

since removing 2 slashes from a/lisp/arc-mode.el leaves you with just
arc-mode.el, which makes it the correct file name relative to the
directory /foo/bar/lisp given as argument to the -d switch.

> But after some manual twiddling, it applied fine on my Emacs 29. I then opened the usual .zip with .xml files inside that always gave me trouble, and this time it worked fine.

Thanks for testing, I've now installed the fix (with some additional
tweaking, per some more thorough testing) on the master branch, and
I'm therefore closing this bug.