help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs 20.7.1 forgets c-basic-offset after find-file


From: Kurumi
Subject: Re: emacs 20.7.1 forgets c-basic-offset after find-file
Date: Wed, 14 Jul 2004 05:45:16 GMT
User-agent: MT-NewsWatcher/3.0 (PPC)

In article <m3wu17x306.fsf@eric.rossnet.com>, Michael Slass 
<miknrene@drizzle.com> wrote:

> Kurumi <sales@xupiter.com> writes:
> 
> >I'm running emacs 20.7.1 in Redhat 7.1, Linux 2.4.2-2.
> >
> >I have a modified .emacs file (included) to give me some key
> >bindings matching the other machines I work on. I also
> >have c-basic-offset set to 3.
> >
> >What's annoying is that after I do a "find file" (aka
> >open a file), emacs resets c-basic-offset to 2. This
> >is immediately apparent whenever it auto-indents a
> >line of code. When I do Customize -> specific option
> >-> c-basic-offset, it is indeed at 2, and I have to
> >change it and save it.
> 
> c-mode is overwriting your setting when it loads, so you need to set
> your basic offset in a mode-hook.
> 
> I don't know the customization interface (if any) to the c-mode hook,
> but you can add this to your .emacs:
> 
> (defun kurimi-c-mode-setup ()
>   (setq c-basic-offset 3)
>   ;; other c-mode customizations here
>   )
> 
> (add-hook 'c-mode-hook 'kurimi-c-mode-setup)

Thanks, that worked. (For C++, I included an add-hook for 
'c++-mode-hook.)

-- 
Kurumi http://www.kurumi.com/
3di's, Conn. Roads, maps, interchanges


reply via email to

[Prev in Thread] Current Thread [Next in Thread]