From: Johannes Weiner <hannes@saeurebad.de>
To: David Brown <lkml@davidb.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Update emacs indentation instructions.
Date: Sun, 20 Jan 2008 02:40:29 +0100 [thread overview]
Message-ID: <87fxwt5l6a.fsf@saeurebad.de> (raw)
In-Reply-To: <1200783192-24399-1-git-send-email-lkml@davidb.org> (David Brown's message of "Sat, 19 Jan 2008 14:53:12 -0800")
Hi,
David Brown <lkml@davidb.org> writes:
> +Fortunately, modern versions of GNU emacs support different indentation
> +styles. If you want to use the Linux kernel style for all C code, place
> +the following in your .emacs file:
> +
> +(setq c-default-style "linux")
This variable is not defined when emacs starts up. Best is to always
use a hook.
So I'd suggest either
(add-hook 'c-mode-hook (lambda () (c-set-style "linux")))
or for the conditional case
(add-hook 'c-mode-hook
(lambda ()
(c-set-style
(or (and (string-match "/usr/src/linux"
(or (buffer-file-name) ""))
"linux")
"free-group-style"))))
Perhaps the logic could be a bit more readable :-)
Other than that, good idea to finally remove this ugly recommendation!
Hannes
next prev parent reply other threads:[~2008-01-20 1:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-19 22:53 [PATCH] Update emacs indentation instructions David Brown
2008-01-20 1:40 ` Johannes Weiner [this message]
2008-01-20 4:53 ` David Brown
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=87fxwt5l6a.fsf@saeurebad.de \
--to=hannes@saeurebad.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml@davidb.org \
--cc=torvalds@linux-foundation.org \
/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.