Closed chansey97 closed 2 years ago
Thanks for reporting this. Probably the ^M
a.k.a. \r
is due to Windows using \r\n
line endings instead of \n
. The buffer contents come from the command-line diff
utility.
I am using cygwin, so racket-mode maybe call cygwin version of diff
.
Where is the diff
used in racket-mode source file? Perhaps I could try to add some options or using other diff
tools.
Edit: I found it (in racket\commands\macro.rkt), you call racket to do such thing.
Adding --strip-trailing-cr
to the macro.rkt
, the issue can be fixed.
A quick path:
- (system (format "diff -U ~a ~a ~a" -U before-file after-file))
+ (if (eq? (system-type) 'windows)
+ (system (format "diff --strip-trailing-cr -U ~a ~a ~a" -U before-file after-file))
+ (system (format "diff -U ~a ~a ~a" -U before-file after-file)))
I have created a pull request.
I am trying to use macro expander in racket-mode.
Everything is fine, except that the stepper buffer will display an extra
^M
For example,
Placing the mouse cursor at
(baz (1 2) (11 22))|
andM-x racket-expand-last-sexp
, the stepper buffer will show:Thank you for this great work.
My racket-mode version is racket-mode-20220216.1917 from elpa, operation system is windows 7, Racket v8.0 [bc].
racket-bug-report: