List:Internals« Previous MessageNext Message »
From:Tor Didriksen Date:July 3 2009 6:18am
Subject:Re: [style] [annc] Coding style update
View as plain text  
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 will try to handle the task for vim but won't mind a helping
> hand here either.

This seems to work, added only (statement-case-open . +)

-- didrik


(c-add-style "MY"
  '("K&R"
      (c-basic-offset . 2)
      (c-comment-only-line-offset . 0)
      (c-offsets-alist . ((statement-block-intro . +)
                          (knr-argdecl-intro . 0)
                          (substatement-open . 0)
                          (label . -)
                          (statement-cont . +)
                          (arglist-intro .  
c-lineup-arglist-intro-after-paren)
                          (arglist-close . c-lineup-arglist)
                          (innamespace . 0)
                          (inline-open . 0)
                          (statement-case-open . +)
                          ))
      ))

(defun mysql-c-mode-hook ()
   (interactive)
   (require 'cc-mode)
   (c-set-style "MY")
   (setq indent-tabs-mode nil)
   (setq comment-column 48))

(add-hook 'c-mode-common-hook 'mysql-c-mode-hook)

>
> 2) The second proposal conflicts with some ctags usage patterns.
> I will need to investigate whether it indeed confuses ctags, and
> whether this can be avoided.
>


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