[erlang-patches] [erlang-bugs] erlang.el indenter
Tuncer Ayaz
tuncer.ayaz@REDACTED
Fri Jan 24 17:52:56 CET 2014
On Fri, Jan 24, 2014 at 5:49 PM, Tuncer Ayaz <tuncer.ayaz@REDACTED> wrote:
> On Fri, Jan 24, 2014 at 3:55 PM, Henrik Nord <henrik@REDACTED> wrote:
>> Ping?!
>>
>> Any update regarding this?
>
> Fredrik's patch introduced a regression, so should not be merged, but
Sorry, that should have said Thomas (not Fredrik).
> the bugs in the indenter are still there.
>
> Steve Vinoski also analyzed the issues a couple days ago, and he has
> a more complete understanding of the Elisp code. Steve, can you
> summarize what's broken?
>
>> On 2012-08-22 19:10, Tuncer Ayaz wrote:
>>>
>>> On Wed, Aug 22, 2012 at 12:14 PM, Fredrik wrote:
>>>>
>>>> Hello Tomas,
>>>> We have included this patch in the 'pu' branch.
>>>> Thank you for the contribution!
>>>
>>> A quick test revealed that erlang.el from 'pu' erroneously
>>> re-indents the already correctly indented rebar:option_spec_list/0
>>> and also rebar:commands/0. Can you reproduce the regression?
>>>
>>>> On 08/21/2012 11:00 PM, Tomas Abrahamsson wrote:
>>>>>
>>>>> On Mon, Aug 6, 2012 at 7:42 PM, Tuncer Ayaz wrote:
>>>>>>
>>>>>> There seems to be a bug in the indenter that mis-indents
>>>>>> rebar.erl:commands/0, if it's indented as part of a larger region.
>>>>>> The multi-line binary string seems to be the problem.
>>>>>>
>>>>>> rebar.erl:commands/0:
>>>>>> https://github.com/basho/rebar/blob/491d52298e2/src/rebar.erl#L275-311
>>>>>>
>>>>>> It works correctly when indenting the function itself with C-c C-q.
>>>>>
>>>>> Hi,
>>>>>
>>>>> Here is a patch for indenting of multi-line strings, like the
>>>>> one previously reported by Tuncer Ayaz.
>>>>>
>>>>> git fetch git://github.com/tomas-abrahamsson/otp.git
>>>>> emacs-indent-multi-line-string
>>>>>
>>>>>
>>>>>
>>>>> https://github.com/tomas-abrahamsson/otp/compare/emacs-indent-multi-line-string
>>>>>
>>>>>
>>>>> https://github.com/tomas-abrahamsson/otp/compare/emacs-indent-multi-line-string.patch
>>>>>
>>>>> Here's an illustration of what the patch does,
>>>>> excerpt from the commit msg:
>>>>>
>>>>> Previously, typing C-M-\ or M-x indent-region RET on the
>>>>> following:
>>>>>
>>>>> somefunction() ->
>>>>> S =<<"
>>>>> text1 somemore1
>>>>> text2 somemore2
>>>>> ">>,
>>>>> io:put_chars(S).
>>>>>
>>>>> resulted in this (note the "text2" line):
>>>>>
>>>>> somefunction() ->
>>>>> S =<<"
>>>>> text1 somemore1
>>>>> text2 somemore2
>>>>> ">>,
>>>>> io:put_chars(S).
>>>>>
>>>>> Now, the indentation inside the multi-line string is left
>>>>> unchanged.
>>>>> This is in line with how the Emacs C and Lisp mode treats
>>>>> multi-line
>>>>> strings when indenting regions.
More information about the erlang-patches
mailing list