List:Internals« Previous MessageNext Message »
From:Tor Didriksen Date:July 2 2009 2:12pm
Subject:Re: [style] [annc] Coding style update
View as plain text  
On Thu, 02 Jul 2009 14:34:00 +0200, Tor Didriksen <Tor.Didriksen@stripped>  
wrote:

> On Thu, 02 Jul 2009 14:18:39 +0200, Guilhem Bichot <guilhem@stripped>  
> wrote:
>
>> Hello,
>>
>> Tor Didriksen a écrit, Le 02.07.2009 08:50:
>>> On Mon, 29 Jun 2009 09:53:13 +0200, Konstantin Osipov <kostja@stripped> 
> 
>>> wrote:
>>>
>>>> Hello,
>>>>
>>>> On Friday, 2009-06-26, the group that governs MySQL server coding
>>>> style met for the first time, and considered two proposals:
>>>>
>>>> 1) Removing the switch alignment exception.
>>>>    http://lists.mysql.com/internals/36385
>>>>
>>>> 2) Specifying the function parameter names in declarations.
>>>>   http://lists.mysql.com/internals/36404
>>>>
>>>> Both proposals were accepted by the majority of votes (5 out of 6
>>>> on both).
>>>>
>>>> You can find more details here:
>>>>
>>>> http://forge.mysql.com/wiki/Coding_Style
>>>>
>>>> This change will be effective once the Forge document is updated,
>>>> I will write a separate update on that.
>>>>
>>>> However, in order to do that, I need help:
>>>>
>>>> 1) Could someone using emacs send me the new formatting options
>>>> for emacs to take into account the new switch () style?
>>>  I'm getting exactly the new formatting style with the current emacs  
>>> settings, so nothing needs to be done.
>>
>> Things work differently for me (recent XEmacs).
>> If I copy this from http://forge.mysql.com/wiki/Coding_Style:
>>   switch (a)
>>   {
>>   case 1:
>>     statement;
>>   case 2:
>>     {
>>       statements;
>>     }
>>   }
>> into sql_show.cc (for example) and press "tab" on each line, I rather  
>> get
>> switch (a)
>>   {
>>   case 1:
>>     statement;
>>   case 2:
>>   {
>>     statements;
>>   }
>>   }
>> which is bad.
>> I'm using exactly verbatim the .emacs section listed in
>>
> http://forge.mysql.com/wiki/MySQL_Internals_Coding_Guidelines#Suggested_mode_in_emacs
>> (I checked).
>> Does it really work for you?
>
> oops, not quite.
> I get
>
> switch (a)
> {
> case 1:
>    statement;
> case 2:
> {
>    statements;
> }
> }
>
> which is slightly better.
> using GNU Emacs 22.3.1
>
> I'll have a look at it.
>
> -- didrik
>
>
>

OK, by adding
                          (statement-case-open . +)
to c-offset-alist it seems to be OK with gnu emacs.
I cannot get xemacs to work properly (installed it, but it doesn't even  
know about c-mode etc.)

-- didrik



Thread
[style] [annc] Coding style updateKonstantin Osipov29 Jun
  • re: [style] [annc] Coding style updateMichael Widenius30 Jun
    • Re: [style] [annc] Coding style updateKonstantin Osipov30 Jun
      • Re: [style] [annc] Coding style updateMichael Widenius30 Jun
        • Re: [style] [annc] Coding style updateAlex Esterkin1 Jul
    • Re: [style] [annc] Coding style updateIngo Strüwing1 Jul
  • Re: [style] [annc] Coding style updateTor Didriksen2 Jul
    • Re: [style] [annc] Coding style updateGuilhem Bichot2 Jul
      • Re: [style] [annc] Coding style updateTor Didriksen2 Jul
        • Re: [style] [annc] Coding style updateTor Didriksen2 Jul
          • Re: [style] [annc] Coding style updateGuilhem Bichot2 Jul
      • Re: [style] [annc] Coding style updateIngo Strüwing2 Jul
  • Re: [style] [annc] Coding style updateTor Didriksen3 Jul