unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: joaotavora@gmail.com (João Távora)
Cc: 20892@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#20892: 25.0.50; Applying vc-diff hunks on CRLF tracked files
Date: Fri, 01 Apr 2016 23:35:21 +0300	[thread overview]
Message-ID: <83wpohrrsm.fsf@gnu.org> (raw)
In-Reply-To: <jjboa9t4ohx.fsf@gmail.com> (joaotavora@gmail.com)

> 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.  Can you explain, or show the evidence that
vc-setup-buffer is the culprit here?

> If, to this, we add a fix in lisp/vc/vc-git.el and don't let it override
> an existing `coding-system-for-read'...
> 
>     diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
>     index 8498cc8..c60125c 100644
>     --- a/lisp/vc/vc-git.el
>     +++ b/lisp/vc/vc-git.el
>     @@ -1387,8 +1387,10 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
>        "A wrapper around `vc-do-command' for use in vc-git.el.
>      The difference to vc-do-command is that this function always invokes
>      `vc-git-program'."
>     -  (let ((coding-system-for-read vc-git-commits-coding-system)
>     -       (coding-system-for-write vc-git-commits-coding-system))
>     +  (let ((coding-system-for-read (or coding-system-for-read
>     +                                    vc-git-commits-coding-system))
>     +       (coding-system-for-write (or coding-system-for-write
>     +                                     vc-git-commits-coding-system)))
>          (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program
>                ;; http://debbugs.gnu.org/16897
>                (unless (and (not (cdr-safe file-or-list))
> 
> the system seems to do the right thing and honour the intention of
> 
>    commit 0e2c793ffefa72c40c7731847d8210c2d7d0e515
>    Author: Eli Zaretskii <eliz@gnu.org>
>    Date:   Tue Nov 26 21:17:55 2013 +0200
>     
>        Fix ugly ^M characters in Diff output shown by "C-x v u".
> 
> What do you think? 

I think that fixing EOL decoding shouldn't touch the value of
coding-system-for-read, only its EOL decoding part, if at all.  And I
also don't see how does binding in vc-git interfere with the EOL
format of the diffs.  Can you tell the details, i.e. how did you
arrive at the conclusion that the above binding is the culprit?

Thanks.





  reply	other threads:[~2016-04-01 20:35 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 [this message]
2016-04-01 22:51           ` João Távora
2016-04-02  9:31             ` Eli Zaretskii
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=83wpohrrsm.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).