emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: C indentation problem]


From: Basil L. Contovounesios
Subject: Re: address@hidden: C indentation problem]
Date: Mon, 20 May 2019 14:51:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

"Basil L. Contovounesios" <address@hidden> writes:

> Kenichi Handa <address@hidden> writes:
>
>> In article <address@hidden>, Alan Mackenzie <address@hidden> writes:
>>
>>> Sometime between Emacs 21 and Emacs 22 CVS, the indentation in the actual
>>> source code was changed from:
>>
>>> Emacs 21 sources:
>>> #########################################################################
>>> DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "p",
>>>   "Move point right N characters (left if N is negative).\n\
>>> On reaching end of buffer, stop and signal error.")
>>>   (n)                         <======           indentation of 2 columns.
>>>      Lisp_Object n;           <======           indentation of 5 columns.
>>> #########################################################################
>>
>>> to
>>
>>> Emacs 22 sources:
>>> #########################################################################
>>> DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "p",
>>>        doc: /* Move point right N characters (left if N is negative).
>>> On reaching end of buffer, stop and signal error.  */)
>>>      (n)                      <======           indentation of 5 columns.
>>>      Lisp_Object n;           <======           indentation of 5 columns.
>>> #########################################################################
>>
>> Ah!  Yes.  I personally prefer Emacs 21 style (perhaps just
>> because I used to it for long time).
>>
>>> However, CC Mode 5.28 seems to me to indent like the Emacs 22 sources are
>>> indented, i.e. column 5, and 5.
>
> CC Mode 5.33.2 also indents "Emacs 22-style", i.e. to 5 columns, but the
> current sources, AFAICS, are indented to 2 columns, "Emacs 21-style".
>
>>> I suggest the following: a new lineup function,
>>> c-lineup-gnu-DEFUN-intro-cont which would be active only in GNU style,
>>> and would give the offset knr-argdecl-intro (i.e. 5) for the lines
>>> between DEFUN's closing paren and the function's opening brace.  This new
>>> function would be tried only if the existing c-lineup-topmost-intro-cont
>>> returns nil.
>
> Shouldn't the now-existing c-lineup-gnu-DEFUN-intro-cont be changed
> accordingly, to indent to 2 columns instead of 5?

Any thoughts on this?

>>> Question:  Are there any other C macros, besides DEFUN, whose indentation
>>> is also broken at the moment?  (I do not know the C source at all well.)
>>
>> All I noticed is the DEFUN case.
>
> I too have yet to notice a problem with other macros.

Thanks,

-- 
Basil



reply via email to

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