GNU bug report logs -
#33567
Syntactic fontification of diff hunks
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Sat, 1 Dec 2018 22:13:02 UTC
Severity: wishlist
Tags: patch
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> 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 outbuf)
(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)) (normal-mode))
(set-buffer-modified-p nil)
This bug report was last modified 6 years and 146 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.