unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "João Távora" <joaotavora@gmail.com>
Cc: 20892@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#20892: 25.0.50; Applying vc-diff hunks on CRLF tracked files
Date: Sat, 02 Apr 2016 12:31:40 +0300	[thread overview]
Message-ID: <83oa9ss6f7.fsf@gnu.org> (raw)
In-Reply-To: <CALDnm51QWuR_m0t_bO7SBOpO+1EbXn_MTkhyDCBJ-dLyrRkaug@mail.gmail.com> (message from João Távora on Fri, 1 Apr 2016 23:51:47 +0100)

> From: João Távora <joaotavora@gmail.com>
> Date: Fri, 1 Apr 2016 23:51:47 +0100
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 20892@debbugs.gnu.org
> 
> On Apr 1, 2016 21:36, "Eli Zaretskii" <eliz@gnu.org> wrote:
> >
> > > From: joaotavora@gmail.com (João Távora)
> > > Cc: monnier@iro.umontreal.ca,  20892@debbugs.gnu.org
> > > Date: Fri, 01 Apr 2016 11:22:50 +0100
> > >
> > > In lisp/vc/vc.el, in vc-diff-internal, dynamically binding
> > > `coding-system-for-read' seems to be defeated by a call to
> > > `vc-setup-buffer', which in turn kills all local variables.
> > >
> > > I don't fully understand the interaction between buffer-local and
> > > lexically/dinamically bound variables but this seems wrong, right?
> >
> > How come kill-all-local-variables can have any effect on the binding
> > of coding-system-for-read.
> 
> I don't know. I said I don't fully understand that part.
> 
> > Can you explain, or show the evidence that
> > vc-setup-buffer is the culprit here?
> 
> I edebugged and evalled coding-system-for-read before and after the
> call to vc-setup-buffer. It lost its non-nil value before and after
> the call to that vc-setup-buffer.
> 
> What may possibly have happened is that when testing I set it globally
> and hence violated some important assumption. I am away from the w32
> machine where this happened, but I will try again monday.

I cannot reproduce your result: when I edebug the relevant code,
coding-system-for-read gets bound to undecided-dos before the call to
vc-setup-buffer, and stays at that value after the call returns.

> emacs -Q bla.txt
> M-x vc-diff
> 
> The pesky ^M *and* escape sequences appear in the output. I just tried
> this on mac and the same happens. Two things fix this:
> 
> 1) The second part of my patch, to `vc-git-command'. It seems to
> respect the (apparent) fact that coding-system-for-{read,write} are
> supposed to be dynamically bindable overrides.
> 2) file-locally or dir-locally seting vc-git-commits-coding-system in
> my configuration.
> 
> >From reading the code and your messages I was under the impression
> that you agreed this was a bug. It is in my opinion (and I also think
> it is a regression).
> 
> Anyway I think 1) is a sound fix but 2) will also do the job perfectly
> well apparently. On monday I will investigate the kill-local-variables
> thing again.

Refraining from overriding coding-system-for-read/write if they are
already bound is a Good Thing, so I installed that change in the
emacs-25 branch.

However, re-reading the original bug report, I'm now confused.
Originally, you said that the ^M characters in the vc-diff output were
correct, and your problem was with applying the hunks.  If you now say
that the problem is with those ^M characters, and applying the hunks
after that is no longer a problem, then we can now close this bug.
Please clarify.





  reply	other threads:[~2016-04-02  9:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-24 11:29 bug#20892: 25.0.50; Applying vc-diff hunks on CRLF tracked files João Távora
2015-06-24 14:52 ` Stefan Monnier
2015-06-24 14:57 ` Eli Zaretskii
2015-06-25 13:54   ` João Távora
2015-06-25 14:41     ` Eli Zaretskii
2016-04-01 10:22       ` João Távora
2016-04-01 20:35         ` Eli Zaretskii
2016-04-01 22:51           ` João Távora
2016-04-02  9:31             ` Eli Zaretskii [this message]
2016-04-02 13:42               ` João Távora
2016-04-02 14:27                 ` Eli Zaretskii

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=83oa9ss6f7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=20892@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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).