cgestes / ctafconf

configuration for emacs/zsh/bash/etc.
http://www.ctaf.free.fr/dokuwiki/doku?id=ctafconf
13 stars 7 forks source link

emacs: No coloration when opening a CMakeLists.txt #5

Closed baptistemarchand closed 13 years ago

baptistemarchand commented 13 years ago

Here is an (ugly) fix:

From a4575bf3d8247c8940afb3095c841d622138daa2 Mon Sep 17 00:00:00 2001
From: bmarchand 
Date: Wed, 31 Aug 2011 10:57:06 +0200
Subject: [PATCH] emacs: Fix bug: cmake-mode was not started when opening CMakeLists.txt
 Is something wrong with the add-to-list statements ?

---
 etc/emacs/ctafconf_prog.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/etc/emacs/ctafconf_prog.el b/etc/emacs/ctafconf_prog.el
index 5e7d871..910eb91 100644
--- a/etc/emacs/ctafconf_prog.el
+++ b/etc/emacs/ctafconf_prog.el
@@ -130,8 +130,10 @@

 ;;Cmake
 (autoload 'cmake-mode "cmake-mode" "major cmake mode" t)
-(add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-mode))
 (add-to-list 'auto-mode-alist '("\\.cmake\\'"         . cmake-mode))
+(setq auto-mode-alist
+      (append '(("CMakeLists\\.txt\\'" . cmake-mode))
+              auto-mode-alist))

 ;;AsciiDoc
 (autoload 'doc-mode "doc-mode" "major asciidoc mode" t)
-- 
1.7.4.1
cgestes commented 13 years ago

works here without the patch.

could you provide your output of Messages without the patch applied?

baptistemarchand commented 13 years ago

Here is the content of Messages :

Company back-end 'company-pysmell' could not be initialized:
Symbol's function definition is void: company-pysmell
Company back-end 'company-clang' could not be initialized:
Setting current directory: no such file or directory, /build/buildd/emacs23-23.2+1/debian/build-x/src/
ECB 2.40 uses CEDET 1.0pre7 (contains semantic 2.0pre7, eieio 1.2, speedbar 1.0).
Loading /home/baptiste/.config/ctafconf/etc/emacs/ctafconf_prog.el (source)...done
Loading /home/baptiste/.config/ctafconf/etc/emacs/ctafconf_bindings.el (source)...
.
ctafconf loading: BINDINGS.EMACS
Loading /home/baptiste/.config/ctafconf/etc/emacs/ctafconf_bindings.el (source)...done
Loading /home/baptiste/.config/ctafconf/etc/emacs/ctafconf_profile.el (source)...
Setting up indent for shell type zsh
setting up indent stuff
Indentation variables are now local.
Indentation setup for shell type zsh
Setting up indent for shell type zsh
setting up indent stuff
Indentation variables are now local.
Indentation setup for shell type zsh
Loading /home/baptiste/.config/ctafconf/etc/emacs/ctafconf_profile.el (source)...done
Loading /home/baptiste/.config/ctafconf/etc/emacs/ctafconf.el (source)...done
Loading /home/baptiste/.emacs.post.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-git...done
Quit

P.S: I just found that replacing

(add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-mode))

with

(add-to-list 'auto-mode-alist '("\\CMakeLists\\.txt\\'" . cmake-mode))

also fixes the problem...