GNU bug report logs - #14516
24.3.50; vc-diff ignores the encoding of its input

Previous Next

Package: emacs;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Thu, 30 May 2013 21:53:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 14516 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 14516 <at> debbugs.gnu.org, Dima Kogan <dima <at> secretsauce.net>
Subject: Re: bug#14516: 24.3.50; vc-diff ignores the encoding of its input
Date: Wed, 24 Feb 2016 16:01:59 +1100
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> Dima Kogan <dima <at> secretsauce.net> writes:
>
>> VC already has code in it to detect the encoding of its input. I'm
>> attaching a small patch that sets this detected encoding to the
>> *vc-diff* buffer. This fixes the issue.
>
> I'd prefer a slightly different patch.  This way, you have smaller
> probability of conflict when `vc-setup-buffer' is called from any
> fuction other than `vc-diff-internal'.
>
> And `coding-system-for-read' detection is only peformed for the diff
> commands.
>
> === modified file 'lisp/vc/vc.el'
> --- lisp/vc/vc.el       2013-11-13 20:06:37 +0000
> +++ lisp/vc/vc.el       2013-11-25 01:13:04 +0000
> @@ -1642,6 +1642,8 @@
>          (coding-system-for-read
>           (if files (vc-coding-system-for-diff (car files)) 'undecided)))
>      (vc-setup-buffer buffer)
> +    (when coding-system-for-read
> +      (setq buffer-file-coding-system coding-system-for-read))
>      (message "%s" (car messages))
>      ;; Many backends don't handle well the case of a file that has been
>      ;; added but not yet committed to the repo (notably CVS and Subversion).

It looks like this was added instead:

    ;; On MS-Windows and MS-DOS, Diff is likely to produce DOS-style
    ;; EOLs, which will look ugly if (car files) happens to have Unix
    ;; EOLs.
    (if (memq system-type '(windows-nt ms-dos))
	(setq coding-system-for-read
	      (coding-system-change-eol-conversion coding-system-for-read
						   'dos)))

I guess that makes as much sense as anything.  (I mean, there may be
different coding systems in each file being diffed in the same
buffer...)

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 9 years and 147 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.