From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kurumi Newsgroups: gmane.emacs.help Subject: Re: emacs 20.7.1 forgets c-basic-offset after find-file Date: Wed, 14 Jul 2004 05:45:16 GMT Organization: Fighting Spyware Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1089784075 17482 80.91.224.253 (14 Jul 2004 05:47:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Jul 2004 05:47:55 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 14 07:47:44 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BkccK-0006fU-00 for ; Wed, 14 Jul 2004 07:47:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bkcej-0005Lg-KM for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jul 2004 01:50:13 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!prodigy.com!newsmst01a.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr27.news.prodigy.com.POSTED!bc7e87f0!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: MT-NewsWatcher/3.0 (PPC) Original-Lines: 37 Original-NNTP-Posting-Host: 69.111.162.90 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr27.news.prodigy.com 1089783916 ST000 69.111.162.90 (Wed, 14 Jul 2004 01:45:16 EDT) Original-NNTP-Posting-Date: Wed, 14 Jul 2004 01:45:16 EDT X-UserInfo1: OPYQBTKGAZUSP_@YMZJ\_Q\@TJ_ZTB\MV@BL\QMIWIWTEPIB_NVUAH_[BL[\IRKIANGGJBFNJF_DOLSCENSY^U@FRFUEXR@KFXYDBPWBCDQJA@X_DCBHXR[C@\EOKCJLED_SZ@RMWYXYWE_P@\\GOIW^@SYFFSWHFIXMADO@^[ADPRPETLBJ]RDGENSKQQZN Original-Xref: shelby.stanford.edu gnu.emacs.help:124289 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:19624 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19624 In article , Michael Slass wrote: > Kurumi 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