From: Reiner Steib <Reiner.Steib@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 4451@debbugs.gnu.org
Subject: bug#4451: 23.1; EOL problems with vc-diff and cygwin
Date: Fri, 16 Jul 2010 08:51:37 +0200 [thread overview]
Message-ID: <87lj9bsyva.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <83eif5gn5g.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 15 Jul 2010 11:33:15 +0300")
On Thu, Jul 15 2010, Eli Zaretskii wrote:
>> From: Reiner Steib <reinersteib+gmane@imap.cc>
>> Cc: 4451@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
>> Date: Thu, 15 Jul 2010 09:22:39 +0200
>>
>> > So I agree with Stefan that you should simply not overwrite the
>> > checked-out file with Unix EOLs. We could install the change
>> > suggested by Stefan (based on this analysis, I no longer object to
>> > it),
>>
>> If nobody else objects, may I install[1] Stefan's patch? Or we could
>> make it depend on some variable as well ...
>
> Fine with me.
Thanks.
>> +(defvar vc-coding-system-strip-eol t ;; nil
>> + "When non-nil, don't inherit the EOL part of the coding-system.")
>
> Instead of a slightly misleading name (you don't really "strip" EOL)
> and double negation, I would suggest an option named
> vc-coding-system-inherit-eol, non-nil by default (to keep the current
> operation), and reverse the condition in the patch.
Heres an updated patch. Could someone please apply it (I don't have
the current sources - no bzr checkout yet)?
--8<---------------cut here---------------start------------->8---
--- vc.el 7 Dec 2009 09:02:16 -0000 1.746
+++ vc.el 16 Jul 2010 06:47:30 -0000
@@ -1388,6 +1388,12 @@
;; (vc-call-backend ',(vc-backend f)
;; 'diff (list ',f) ',rev1 ',rev2))))))
+(defvar vc-coding-system-inherit-eol t
+ "When non-nil, inherit the EOL part of the coding-system from buffer.
+Set this variable to nil if your diff tools chooses to use other
+EOL type than the current buffer. Then auto-detection gives
+better.") ;; Cf. bug#4451.
+
(defun vc-coding-system-for-diff (file)
"Return the coding system for reading diff output for FILE."
(or coding-system-for-read
@@ -1395,7 +1401,12 @@
;; use the buffer's coding system
(let ((buf (find-buffer-visiting file)))
(when buf (with-current-buffer buf
- buffer-file-coding-system)))
+ (if vc-coding-system-inherit-eol
+ buffer-file-coding-system
+ ;; Don't inherit the EOL part of the coding-system,
+ ;; because some diff tools may choose to use
+ ;; another one. bug#4451.
+ (coding-system-base buffer-file-coding-system)))))
;; otherwise, try to find one based on the file name
(car (find-operation-coding-system 'insert-file-contents file))
;; and a final fallback
--8<---------------cut here---------------end--------------->8---
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
next prev parent reply other threads:[~2010-07-16 6:51 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-16 18:08 bug#4451: 23.1; EOL problems with vc-diff and cygwin Reiner Steib
2009-09-16 20:56 ` Eli Zaretskii
2009-09-17 14:26 ` Reiner Steib
2009-09-17 16:35 ` Stefan Monnier
2009-09-17 17:22 ` Eli Zaretskii
2009-09-17 20:59 ` Stefan Monnier
2009-09-18 11:29 ` Reiner Steib
2009-09-24 17:00 ` Reiner Steib
2009-09-24 22:07 ` Stefan Monnier
2009-09-25 19:11 ` Eli Zaretskii
2009-09-26 8:27 ` Reiner Steib
2009-09-26 9:20 ` Eli Zaretskii
2009-09-27 0:36 ` Stefan Monnier
2009-09-27 7:38 ` Eli Zaretskii
2009-09-27 19:03 ` Stefan Monnier
2009-09-27 20:35 ` Reiner Steib
2009-09-28 1:08 ` Stefan Monnier
2009-10-05 16:07 ` Reiner Steib
2009-10-05 18:45 ` Stefan Monnier
2009-10-05 20:58 ` Eli Zaretskii
2010-07-15 7:22 ` Reiner Steib
2010-07-15 8:33 ` Eli Zaretskii
2010-07-16 6:51 ` Reiner Steib [this message]
2010-07-16 8:05 ` Andreas Schwab
2010-07-16 10:18 ` Eli Zaretskii
2010-07-19 7:23 ` Reiner Steib
2009-09-17 17:18 ` Eli Zaretskii
2009-09-18 11:31 ` Reiner Steib
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lj9bsyva.fsf@marauder.physik.uni-ulm.de \
--to=reiner.steib@gmx.de \
--cc=4451@debbugs.gnu.org \
--cc=eliz@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.