From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric Lilja" Newsgroups: gmane.emacs.help Subject: Re: Some problems configuring emacs Date: 25 Nov 2006 13:16:12 -0800 Organization: http://groups.google.com Message-ID: <1164489372.134371.122110@j72g2000cwa.googlegroups.com> References: <1164488413.636232.76140@j72g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1164490876 10711 80.91.229.2 (25 Nov 2006 21:41:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 25 Nov 2006 21:41:16 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 25 22:41:11 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Go5Gd-0007Zm-J6 for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Nov 2006 22:41:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Go5Gd-0005Nr-1A for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Nov 2006 16:40:59 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!j72g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 60 Original-NNTP-Posting-Host: 85.194.49.108 Original-X-Trace: posting.google.com 1164489377 30652 127.0.0.1 (25 Nov 2006 21:16:17 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 25 Nov 2006 21:16:17 +0000 (UTC) In-Reply-To: <1164488413.636232.76140@j72g2000cwa.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.8.1) Gecko/20061010 Firefox/2.0,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: j72g2000cwa.googlegroups.com; posting-host=85.194.49.108; posting-account=VhnPwg0AAAB7O5OQRS5Hs376X47qoQdE Original-Xref: shelby.stanford.edu gnu.emacs.help:143378 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:38995 Archived-At: Eric Lilja skrev: > Hello, I mostly use emacs to code in C, C++, Java, bash scrips and SQL. > My .emacs-file is a mess and I don't understand much of it. In an > attempt to understand it better I tried to configure some CC Mode > related things. Here's a snippet from my file: > > ; c-mode-common-hook: > ; Common hook across all languages. It's run immediately > ; before the language specific hook. > (defun my-c-mode-common-hook () > ;; my customizations for all of c-mode and related modes > ;;(no-case-fold-search) > (setq c-basic-offset 3) > (setq-default indent-tabs-mode nil) ; Use spaces, not tabs, for > indentation. > (delete-selection-mode 1) ; Maybe on by default on windows and off by > default on solaris? > ) > (add-hook 'c-mode-common-hook 'my-c-mode-common-hook) > > (defun my-c++-mode-hook () > ; Customizations for C++ mode in CC Mode > (delete-selection-mode 1) > (set-cursor-color "Red") > (setq c-default-style "ellemtel") > ) > (add-hook 'c++-mode-hook 'my-c++-mode-hook) Think I solved it by changing my-c++-mode-hook to: (defun my-c++-mode-hook () ; Customizations for C++ mode in CC Mode (delete-selection-mode 1) (set-cursor-color "Red") (c-set-style "ellemtel") ; Default style for c++ is "gnu" ) (add-hook 'c++-mode-hook 'my-c++-mode-hook) The changes wasn't visible in already opened c++ files even though I selected byte-compile-and-load. But I restarted emacs it works. Now I need to figure out how to change one setting in ellementel mode. > > First I configure some things that should be regardless of CC mode > language. That seems to work just fine. But I'm having problems with > my-c++-mode-hook. I try to set c-default-style to ellementel but it > doesn't seem to work because indentation doesn't behave the same if > just put (setq c-default-style "ellemtel") alone in the file. What I > really want to do is use ellementel indentation except for C++ access > labels. The hook seems to "run" though, becuase the cursor turns red > (however, it turns red for .c-files too, why?). Is there a better way > to see if a hook runs and why doesn't it change indentation style? Hope > I made some sense... > > / E / E