emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#14342: closed (24.3; On windows: presence of carri


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#14342: closed (24.3; On windows: presence of carriage returns in diff output buffers depends on the presence of non-ascii characters in that output)
Date: Fri, 03 May 2013 12:19:02 +0000

Your message dated Fri, 03 May 2013 15:17:26 +0300
with message-id <address@hidden>
and subject line Re: bug#14342: 24.3; On windows: presence of carriage returns 
in diff output buffers   depends on the presence of non-ascii characters in 
that output
has caused the debbugs.gnu.org bug report #14342,
regarding 24.3; On windows: presence of carriage returns in diff output buffers 
depends on the presence of non-ascii characters in that output
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
14342: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14342
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3; On windows: presence of carriage returns in diff output buffers depends on the presence of non-ascii characters in that output Date: Fri, 3 May 2013 12:08:58 +0200
This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

- start emacs 24.3 with -Q (note: emacs 24.1 also shows the same behaviour)
- make the following file and call it "file-abbbb" (insert the broken bar with C-x 8 RET a6 RET):
line with ¦ (broken bar character)
bla
bla
bla
bla
- remove the last "bla" and write that as "file-abbb"
- again and write as "file-abb"
- set diff executable to msysgit 1.8.1.2 in customize Diff Command
  "C:/Program Files/Git/bin/diff.exe"
- diff file-abbb with file-abb respectively file-abbbb (using "=" in Dired):
  the first diff shows ^M's at the end of the lines from the files
  (but not at the end of the lines from diff itself, the headers etc.),
  but the second diff shows no ^M's.
- in the second case the broken bar non-ascii character is inside
  of the context of the change, whereas in the second case is outside
  of the context of the change and therefore not present in the diff
  buffer.

(By the way: these different behaviours cause problems with magit:
without the ^M's it is not possible to stage a region of a hunk,
with the ^M's it does work. Normally I would prefer the ^M's to be
absent.)

Why is this behaviour dependent on the presence of a non-ascii character?

Thanks in advance,
Albert.


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
d:/albert/gnu/emacs/emacs-24.3/etc/DEBUG.


In GNU Emacs 24.3.1 (i386-mingw-nt5.1.2600)
 of 2013-03-17 on MARVIN
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include
 -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
 -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'

Important settings:
  value of $LANG: ENG
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  diff-auto-refine-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
s SPC t h i s SPC b e h a v i o u r SPC d e p e n t
<backspace> d e n t SPC o n SPC t h e SPC p r e s e
n c e SPC o f SPC a SPC n o n - a s c i i SPC c h a
r a c t o e <backspace> <backspace> e r ? <return>
<return> R e g a r d , <backspace> s , <return> <up>
<right> <right> <right> <right> <right> <right> <right>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> T h a n k s SPC i n SPC a d
v a n c e <end> <return> A l b e r t . <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> C-x C-s <down-mouse-1>
<mouse-1> SPC a n d SPC t h e r e f o r e SPC n o t
SPC p r e s e n t SPC i n SPC f <backspace> t h e SPC
d i f f SPC b u f f e r <left> <left> <left> <left>
<left> <left> <return> SPC SPC <end> <down> <down>
<right> <right> : C-x C-s <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <menu-bar>
<help-menu> <send-emacs-bug-report>

Recent messages:
Auto-saving...done
Auto-saving...done
Undo!
Auto-saving...done
byte-code: Beginning of buffer [4 times]
Saving file d:/albert/gnu/emacs/emacs-24.3/site-lisp/albert-site-lisp/test-case-diff-bug/bug-report.txt...
Wrote d:/albert/gnu/emacs/emacs-24.3/site-lisp/albert-site-lisp/test-case-diff-bug/bug-report.txt
Saving file d:/albert/gnu/emacs/emacs-24.3/site-lisp/albert-site-lisp/test-case-diff-bug/bug-report.txt...
Wrote d:/albert/gnu/emacs/emacs-24.3/site-lisp/albert-site-lisp/test-case-diff-bug/bug-report.txt
byte-code: End of buffer [4 times]
byte-code: Beginning of buffer [4 times]

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils two-column view dired-aux diff-mode easy-mmode
diff cus-edit easymenu cus-start cus-load wid-edit kmacro vc-git dired
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment lisp-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process w32 multi-tty emacs)


--- End Message ---
--- Begin Message --- Subject: Re: bug#14342: 24.3; On windows: presence of carriage returns in diff output buffers depends on the presence of non-ascii characters in that output Date: Fri, 03 May 2013 15:17:26 +0300
> Date: Fri, 3 May 2013 12:08:58 +0200
> From: Albert <address@hidden>
> 
> - start emacs 24.3 with -Q (note: emacs 24.1 also shows the same behaviour)
> - make the following file and call it "file-abbbb" (insert the broken bar
> with C-x 8 RET a6 RET):
> line with ¦ (broken bar character)
> bla
> bla
> bla
> bla
> - remove the last "bla" and write that as "file-abbb"
> - again and write as "file-abb"
> - set diff executable to msysgit 1.8.1.2 in customize Diff Command
>   "C:/Program Files/Git/bin/diff.exe"

That's your problem, right there: you are using an MSYS port of Diff
with the native Windows build of Emacs.  MSYS ports are incompatible
with native Windows programs wrt text/binary I/O issues, and the
result is that some lines of Diff's output have DOS CRLF end of line,
while others have the Unix-style LF-only there.  Emacs cannot make
heads or tails out of the resulting mess, so it does its best, which
isn't much.

Solution: use a native Windows port of Diff instead of the one that
comes with msysgit.  One such port is available here:

  http://gnuwin32.sourceforge.net/packages/diffutils.htm

Alternatively, set up your Emacs to always use Unix-style EOLs in
files it creates, either in certain volumes/directories or everywhere.
One way of doing this is using by the "untranslated filesystem"
feature, described in the "Text and Binary" node of the Emacs user
manual.  Another way is to customize default-buffer-file-coding-system
to SOMETHING-unix, where SOMETHING is what it is set by default in
your locale.  The former lets you be selective regarding the
directories where this will take place, the latter is global.

> (By the way: these different behaviours cause problems with magit:
> without the ^M's it is not possible to stage a region of a hunk,
> with the ^M's it does work. Normally I would prefer the ^M's to be
> absent.)

If you need this for magit, I guess you must use the Diff program
which came with msysgit, so the 2nd alternative described above is
what you should explore.

> Why is this behaviour dependent on the presence of a non-ascii character?

Because the decoding of the end-of-line (EOL) format is part of
decoding non-ASCII characters.

I'm closing this bug, since it's not an Emacs bug.



--- End Message ---

reply via email to

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