[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33567: Syntactic fontification of diff hunks

From: Juri Linkov
Subject: bug#33567: Syntactic fontification of diff hunks
Date: Tue, 11 Dec 2018 02:38:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> If you still want to reuse the literal contents of the file, as
> inserted by vc-git-find-revision etc., then you will have to duplicate
> what insert-file-contents does internally.  I suggest to look at how
> this is done in archive-set-buffer-as-visiting-file.

I looked at archive-set-buffer-as-visiting-file, and it seems it could
be simplified based on the assumption that the backend inserts output
in the binary coding.  I tried and this fixes the problem:

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 5ff9f4d5be..c980369fa9 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2042,6 +2042,7 @@ vc-find-revision-no-save
                      (if backend
                          (vc-call-backend backend 'find-revision file revision 
                        (vc-call find-revision file revision outbuf))))
+                  (recode-region (point-min) (point-max) 
buffer-file-coding-system 'binary)
                   (goto-char (point-min))
                   (if buffer (let ((buffer-file-name file)) (normal-mode)) 
                  (set-buffer-modified-p nil)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]