All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Teemu Likonen <tlikonen@iki.fi>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Johannes Weiner <hannes@saeurebad.de>,
	Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH v2] Documentation: update CodingStyle tips for Emacs users
Date: Mon, 26 Jan 2009 09:13:02 -0800	[thread overview]
Message-ID: <497DEF1E.2060504@oracle.com> (raw)
In-Reply-To: <1232989279-7452-1-git-send-email-tlikonen@iki.fi>

Teemu Likonen wrote:
> With the previous Emacs tips example the kernel style was made available
> for files in the kernel-tree only. This patch updates the tip to add a
> separate cc-mode indent style ("linux-tabs-only"). This makes it easy to
> switch between different indent styles and also makes the kernel style
> easily available for any filetype mode (c++, awk, ...) that is managed
> by the Emacs cc-mode.
> 
> Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
> ---
>  Documentation/CodingStyle |   15 +++++++++++----
>  1 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
> index 1875e50..7b5762e 100644
> --- a/Documentation/CodingStyle
> +++ b/Documentation/CodingStyle
> @@ -483,6 +483,16 @@ values.  To do the latter, you can stick the following in your .emacs file:
>      (* (max steps 1)
>         c-basic-offset)))
>  
> +(add-hook 'c-mode-common-hook
> +          (lambda ()
> +            ;; Add kernel style
> +            (c-add-style
> +             "linux-tabs-only"
> +             '("linux" (c-offsets-alist
> +                        (arglist-cont-nonempty
> +                         c-lineup-gcc-asm-reg
> +                         c-lineup-arglist-tabs-only))))))
> +
>  (add-hook 'c-mode-hook
>            (lambda ()
>              (let ((filename (buffer-file-name)))
> @@ -490,10 +500,7 @@ values.  To do the latter, you can stick the following in your .emacs file:
>                (when (and filename
>                           (string-match "~/src/linux-trees" filename))
>                  (setq indent-tabs-mode t)
> -                (c-set-style "linux")
> -                (c-set-offset 'arglist-cont-nonempty
> -                              '(c-lineup-gcc-asm-reg
> -                                c-lineup-arglist-tabs-only))))))
> +                (c-set-style "linux-tabs-only")))))
>  
>  This will make emacs go better with the kernel coding style for C
>  files below ~/src/linux-trees.


I don't see Dan's patch merged into this one... ?

-- 
~Randy

  reply	other threads:[~2009-01-26 17:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-18 17:18 [PATCH] Documentation: update CodingStyle tips for Emacs users Teemu Likonen
2009-01-26 15:20 ` Teemu Likonen
2009-01-26 16:38   ` Randy Dunlap
2009-01-26 16:56     ` Teemu Likonen
2009-01-26 17:01       ` [PATCH v2] " Teemu Likonen
2009-01-26 17:13         ` Randy Dunlap [this message]
2009-01-26 17:21           ` Teemu Likonen
2009-01-26 17:23             ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=497DEF1E.2060504@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=error27@gmail.com \
    --cc=hannes@saeurebad.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=tlikonen@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.