1 ;; Configuration file for cc-ide.el (Emacs C++ IDE extension, see http://g0dil.de)
5 (c-backslash-column . 98)
6 (c-cleanup-list . (empty-defun-braces
10 (c-hanging-braces-alist . ((namespace-open after)
11 (namespace-close before after)
14 (substatement-open after)
15 (block-close . c-snug-do-while)
16 (extern-lang-open after)
17 (inexpr-class-open after)
18 (inexpr-class-close before)))
19 (c-offsets-alist . ((namespace-open . 0)
22 (statement-block-intro . +)
23 (substatement-open . 0)
25 (statement-cont . +))) ))
27 (c-add-style "senf" senf-c-style)
29 (set (make-local-variable 'ccide-file-vars)
30 '(( fill-column . 100 )
31 ( comment-column . 40 )
32 ( c-file-style . "senf" )
33 ( indent-tabs-mode . nil )
34 ( ispell-local-dictionary . "american" )
35 ( compile-command . "scons -u test") ))
37 (set (make-local-variable 'ccide-default-copyright)
39 "// This program is free software; you can redistribute it and/or modify\n"
40 "// it under the terms of the GNU General Public License as published by\n"
41 "// the Free Software Foundation; either version 2 of the License, or\n"
42 "// (at your option) any later version.\n"
44 "// This program is distributed in the hope that it will be useful,\n"
45 "// but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
46 "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
47 "// GNU General Public License for more details.\n"
49 "// You should have received a copy of the GNU General Public License\n"
50 "// along with this program; if not, write to the\n"
51 "// Free Software Foundation, Inc.,\n"
52 "// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"))
54 (set (make-local-variable 'ccide-project-name) "SENF")
56 (let ((local-conf (ccide-project-search-upwards "project-local.el")))
58 (load-file local-conf)))
60 (defun flyspell-cc-progmode-verify ()
61 "Replacement for standard flyspell-generic-progmode-verify which
62 checks for C/C++ preproc directives. Additionally, anything after ^L
63 is ignored (Those are the file local variables and local words)."
64 (let ((f (get-text-property (point) 'face)))
65 (and (memq f flyspell-prog-text-faces)
68 (looking-at "\\(//\\)?#")))
69 (not (let ((l (max (point-min) (- (point-max) 4096))))
71 (save-excursion (search-backward "
\f" l t))))))))
73 (defun flyspell-cc-mode ()
74 "Torn on `flyspell-mode` for comments and strings in C/C++ mode."
76 (setq flyspell-generic-check-word-p 'flyspell-cc-progmode-verify)
79 ;; Better set this here than in the file variables since the setting
80 ;; is only valid if project.el is loaded ...
81 (set (make-local-variable 'ispell-personal-dictionary)
82 (expand-file-name "senf.dict" ccide-project-root))
85 (defun senf-new-file-hook ()
86 (when (string-match "\\.test\\.cc$" (buffer-file-name))
88 (goto-char (point-min))
89 (search-forward "auto_unit_test.hpp")
91 (delete-region (point) (progn (end-of-line) (point)))
93 (string-replace "[^/]+/" "../" (substring (file-name-directory (buffer-file-name))
94 (length ccide-project-root)) t)
95 "Utils/auto_unit_test.hh\""))))
97 (add-hook 'ccide-new-file-hooks 'senf-new-file-hook nil t)