* Starting in c-set-style linux
@ 2004-04-21 23:39 News @adelphia
2004-04-22 0:18 ` Mike Irwin
2004-04-22 13:31 ` Alan Mackenzie
0 siblings, 2 replies; 6+ messages in thread
From: News @adelphia @ 2004-04-21 23:39 UTC (permalink / raw)
I'm new to emacs, and I was wondering what I need to do in order to start
emacs in linux mode with out have to "M-x c-set-style linux" every time I
start emacs. I've looked all over the web and can't find anything on the
subject. If anyone can point me in the right direction I'd be very greatful.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Starting in c-set-style linux
2004-04-21 23:39 Starting in c-set-style linux News @adelphia
@ 2004-04-22 0:18 ` Mike Irwin
2004-04-22 3:58 ` Jesse B.
2004-04-22 13:31 ` Alan Mackenzie
1 sibling, 1 reply; 6+ messages in thread
From: Mike Irwin @ 2004-04-22 0:18 UTC (permalink / raw)
"News @adelphia" <jakle131@adelphia.net> writes:
> I'm new to emacs, and I was wondering what I need to do in order to start
> emacs in linux mode with out have to "M-x c-set-style linux" every time I
> start emacs. I've looked all over the web and can't find anything on the
> subject. If anyone can point me in the right direction I'd be very greatful.
(defun my-linux-c-mode ()
"C mode with adjusted defaults for use with the linux kernel."
(c-set-style "linux"))
(add-hook 'c-mode-hook 'my-linux-c-mode)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Starting in c-set-style linux
2004-04-22 0:18 ` Mike Irwin
@ 2004-04-22 3:58 ` Jesse B.
0 siblings, 0 replies; 6+ messages in thread
From: Jesse B. @ 2004-04-22 3:58 UTC (permalink / raw)
"Mike Irwin" wrote:
>
> (defun my-linux-c-mode ()
> "C mode with adjusted defaults for use with the linux kernel."
> (c-set-style "linux"))
>
> (add-hook 'c-mode-hook 'my-linux-c-mode)
Thank you very much. That's the ticket I've been looking for. Works like a
charm. I've been pulling my hair out googling and looking through docs for
that info. I appritiate you taking the time to help out a newcomer like
myself.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Starting in c-set-style linux
2004-04-21 23:39 Starting in c-set-style linux News @adelphia
2004-04-22 0:18 ` Mike Irwin
@ 2004-04-22 13:31 ` Alan Mackenzie
2004-04-23 16:08 ` Kevin Rodgers
1 sibling, 1 reply; 6+ messages in thread
From: Alan Mackenzie @ 2004-04-22 13:31 UTC (permalink / raw)
News @adelphia <jakle131@adelphia.net> wrote on Wed, 21 Apr 2004 19:39:31
-0400:
> I'm new to emacs, and I was wondering what I need to do in order to
> start emacs in linux mode with out have to "M-x c-set-style linux"
> every time I start emacs. I've looked all over the web and can't find
> anything on the subject. If anyone can point me in the right direction
> I'd be very greatful.
Set the variable `c-default-style' in your .emacs file. This is fully
documented in the CC Mode manual, page "Choosing a Style". Something
like the following in your .emacs should work:
(eval-after-load "cc-mode" '(setq c-default-style "linux"))
[The eval-after-load bit is to make sure that you don't try and set the
variable's value before the code has been loaded.]
--
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Starting in c-set-style linux
2004-04-22 13:31 ` Alan Mackenzie
@ 2004-04-23 16:08 ` Kevin Rodgers
2004-04-24 7:51 ` Alan Mackenzie
0 siblings, 1 reply; 6+ messages in thread
From: Kevin Rodgers @ 2004-04-23 16:08 UTC (permalink / raw)
Alan Mackenzie wrote:
> Set the variable `c-default-style' in your .emacs file. This is fully
> documented in the CC Mode manual, page "Choosing a Style". Something
> like the following in your .emacs should work:
>
> (eval-after-load "cc-mode" '(setq c-default-style "linux"))
>
> [The eval-after-load bit is to make sure that you don't try and set the
> variable's value before the code has been loaded.]
eval-after-load shouldn't be necessary, if the variable is defined in
the usual defvar/defcustom way.
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Starting in c-set-style linux
2004-04-23 16:08 ` Kevin Rodgers
@ 2004-04-24 7:51 ` Alan Mackenzie
0 siblings, 0 replies; 6+ messages in thread
From: Alan Mackenzie @ 2004-04-24 7:51 UTC (permalink / raw)
Kevin Rodgers <ihs_4664@yahoo.com> wrote on Fri, 23 Apr 2004 10:08:35
-0600:
> Alan Mackenzie wrote:
> > Set the variable `c-default-style' in your .emacs file. This is
> > fully documented in the CC Mode manual, page "Choosing a Style".
> > Something like the following in your .emacs should work:
> > (eval-after-load "cc-mode" '(setq c-default-style "linux"))
> > [The eval-after-load bit is to make sure that you don't try and set the
> > variable's value before the code has been loaded.]
> eval-after-load shouldn't be necessary, if the variable is defined in
> the usual defvar/defcustom way.
Whoops! Thanks.
Yes, an eval-after-load is needed for functions (unless they're
autoloaded), but not for variables.
> Kevin Rodgers
--
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-04-24 7:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-21 23:39 Starting in c-set-style linux News @adelphia
2004-04-22 0:18 ` Mike Irwin
2004-04-22 3:58 ` Jesse B.
2004-04-22 13:31 ` Alan Mackenzie
2004-04-23 16:08 ` Kevin Rodgers
2004-04-24 7:51 ` Alan Mackenzie
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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.