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 #11 received at 14516 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: 14516 <at> debbugs.gnu.org
Subject: Re: bug#14516: 24.3.50; vc-diff ignores the encoding of its input
Date: Mon, 25 Nov 2013 03:27:35 +0200
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).




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.