From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: HELP with cc-mode and emacs Date: Wed, 13 Jun 2007 19:06:33 +0100 Message-ID: <20070613180633.GA2412@muc.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181752884 20601 80.91.229.12 (13 Jun 2007 16:41:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2007 16:41:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 13 18:41:22 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HyVuL-0006x3-4y for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jun 2007 18:41:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyVuK-0001c3-LK for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jun 2007 12:41:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HyVu3-0001av-NB for help-gnu-emacs@gnu.org; Wed, 13 Jun 2007 12:41:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HyVu2-0001aV-6D for help-gnu-emacs@gnu.org; Wed, 13 Jun 2007 12:41:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyVu1-0001aQ-V3 for help-gnu-emacs@gnu.org; Wed, 13 Jun 2007 12:41:02 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HyVty-0006hE-3V for help-gnu-emacs@gnu.org; Wed, 13 Jun 2007 12:40:59 -0400 Original-Received: (qmail 65457 invoked by uid 3782); 13 Jun 2007 16:40:47 -0000 Original-Received: from acm.muc.de (p54A3D8D0.dip.t-dialin.net [84.163.216.208]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Wed, 13 Jun 2007 18:40:45 +0200 Original-Received: (qmail 2628 invoked by uid 1000); 13 Jun 2007 18:06:33 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: FreeBSD 4.6-4.9 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:45015 Archived-At: Hello again, Chris! On Wed, Jun 13, 2007 at 01:31:56PM +0000, Chris wrote: > Frustration Continues !!! Not good! > I started from scratch > byte compiled the .el files in version 5.31.3 from inside emacs using > the command : > M-0 M-x byte-recompile-directory RET OK. I think you'd compiled CC Mode OK the first time, but recompiling won't have done any harm. > Recieved the following messages: [ snipped ] They look like the expected messages. > > Here is a portion of my .emacs.el: > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; C++ Mode > (autoload 'awk-mode "/net/wally/home/cfoster/.cc-mode-5.31.3/cc-mode" > nil t) That looks fine. > (add-hook 'awk-mode-hook '(lambda () (font-lock-mode 1))) This looks to be not false, but probably not quite what you want. It will enable font-lock only for AWK files. To enable Font Lock for all of the CC Mode modes, use this: (add-hook 'cc-mode-common-hook 'turn-on-font-lock) > (setq auto-mode-alist (cons '("\\.cpp\\'" . awk-mode) auto-mode-alist)) > (setq auto-mode-alist (cons '("\\.c\\'" . awk-mode) auto-mode-alist)) > (setq auto-mode-alist (cons '("\\.h\\'" . awk-mode) auto-mode-alist)) These are definitely wrong. You want to edit .cpp files with c++-mode, not awk-mode. The seven modes (c-mode, c++-mode, java-mode, objc-mode, idl-mode, pike-mode, awk-mode) are variants on a single theme, but aren't identical. You should just remove these three lines; those settings were already in Emacs-21.3. > Any ideas? Thanks Again Er... Um... How is your system, set up as you've just described, not working right at the moment? This is quite helpful information. ;-) > Chris Foster -- Alan Mackenzie (Ittersbach, Germany).