[llvm-bugs] [Bug 31092] New: clang-format Emacs integration breaks on Windows

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 21 06:41:55 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31092

            Bug ID: 31092
           Summary: clang-format Emacs integration breaks on Windows
           Product: clang
           Version: 3.9
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Romain at alazartech.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

Running `clang-format-buffer` from clang-format.el on any file that contains
multiple lines under Windows throws an error, even if the file contains only
ASCII characters:

    (clang-format failed with code 1: error: invalid length 34, offset + length
(34) is outside the file.)

The issues comes from the fact that Emacs uses `undecided-unix` encoding by
default to send data to subprocesses, but `undecided-dos` to receive data from
them, as shown by calling `describe-coding-system` on any buffer.

This problem can be fixed by calling `(setq default-process-coding-system
'(undecided-dos . undecided-dos))` in `.emacs`.

I am not sure if this issue can or should be solved at clang-format.el level,
but I thought it is worth pointing out since it affects every Emacs user on
Windows that hasn't fiddled with the `default-process-coding-system` variable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161121/c4a2de50/attachment.html>


More information about the llvm-bugs mailing list