From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bcochofel Newsgroups: gmane.emacs.help Subject: Emacs and C source files Date: Fri, 10 Nov 2006 04:01:34 -0800 (PST) Message-ID: <7275598.post@talk.nabble.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1163160118 10220 80.91.229.2 (10 Nov 2006 12:01:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Nov 2006 12:01:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 10 13:01:54 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 1GiV4z-00083E-5g for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Nov 2006 13:01:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GiV4y-0001Q9-Ni for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Nov 2006 07:01:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GiV4i-0001P6-K0 for help-gnu-emacs@gnu.org; Fri, 10 Nov 2006 07:01:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GiV4h-0001Ot-Qe for Help-gnu-emacs@gnu.org; Fri, 10 Nov 2006 07:01:36 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GiV4h-0001Oq-Lb for Help-gnu-emacs@gnu.org; Fri, 10 Nov 2006 07:01:35 -0500 Original-Received: from [72.21.53.35] (helo=talk.nabble.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GiV4g-0003zm-Tg for Help-gnu-emacs@gnu.org; Fri, 10 Nov 2006 07:01:35 -0500 Original-Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GiV4g-0007mT-1R for Help-gnu-emacs@gnu.org; Fri, 10 Nov 2006 04:01:34 -0800 Original-To: Help-gnu-emacs@gnu.org X-Nabble-From: bruno.cochofel@gmail.com 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:38614 Archived-At: Hi, I use emacs to edit all my code in different languages and I get this weard behavior when I use .c files, my CPU goes to 99% busy while the .c file is open. Here's my .emacs file: ------------------------------------------------------------------------------------------------------------------- ;;; Ficheiro de configuracao do emacs ;;; seccao de configuracao ;;; ---------------------- ;; email (setq user-mail-address "bc@domain.pt") ;; load dos ficheiros lisp ;; plataforma Dos-Windows ;(setq load-path (cons (expand-file-name "c:/.emacs.d/lisp") load-path)) ;; plataforma Linux (setq load-path (cons (expand-file-name "~/.emacs.d/lisp") load-path)) ;; syntax colorization (if (fboundp 'global-font-lock-mode) (global-font-lock-mode 1) ; GNU Emacs (setq font-lock-auto-fontify t)) ; XEmacs ;(global-font-lock-mode t) ;; transient mark mode - fill region (setq transient-mark-mode 1) ;; hitting delete will delete the highlighted region (pending-delete-mode 1) ;; Always end a file with a newline (setq require-final-newline t) ;; Stop at the end of the file, not just add lines (setq next-line-add-newlines nil) ;; don't show the startup message every time, I know I'm using emacs (setq inhibit-startup-message t) ;; use y or n instead of yes or no (fset 'yes-or-no-p 'y-or-n-p) '(ispell-program-name "aspell") ;Agora tornando o dicionario brasileiro como o default (setq ispell-dictionary "portuguese") ;;; Text mode and Auto Fill mode ;; The next three lines put Emacs into Text mode ;; and Auto Fill mode, and are for writers who ;; want to start writing prose rather than code. (setq default-major-mode 'text-mode) (add-hook 'text-mode-hook 'text-mode-hook-identify) (add-hook 'text-mode-hook 'turn-on-auto-fill) ;; line number mode (line-number-mode 1) ;; column number mode (column-number-mode 1) ;; 2 spaces after a colon (setq colon-double-space t) ;;; seccao de diario/calendario ;;; --------------------------- ;(setq diary-file "~/diario") ;(setq european-calendar-style t) ;; para gerar alertas de apontamentos ;(display-time) ;(add-hook 'diary-hook 'appt-make-list) ;(diary 0) ;;; seccao para programacao em perl ;;; ------------------------------- ;; cperl-mode instead of perl-mode (mapc (lambda (pair) (if (eq (cdr pair) 'perl-mode) (setcdr pair 'cperl-mode))) (append auto-mode-alist interpreter-mode-alist)) ;; cperl-mode is preferred to perl-mode ;; "Brevity is the soul of wit" (defalias 'perl-mode 'cperl-mode) ;; expand keywords (setq cperl-electric-keywords t) ;; expands for keywords such as ;; foreach, while, etc... ;;; seccao para programacao em c ;;; ---------------------------- (require 'cc-mode) ;; comment column (setq-default comment-column 70) ;; hungry delete (c-toggle-hungry-state 1) ;; c warn mode (global-cwarn-mode t) ;; definicao do estilo (add-hook 'c-mode-common-hook '(lambda () (c-set-style "linux") (c-set-offset 'case-label 4) (setq c-basic-offset 4 tab-width 4 indent-tabs-mode t))) ;; hide-ifdef-mode automatico (add-hook 'c-mode-common-hook '(lambda() (hide-ifdef-mode 1))) ;;; compilacao ;; tamanho da janela de compilacao (setq compilation-window-height 8) ;; scroll automatico da janela de compilacao (setq compilation-scroll-output 1) ;; janela de compilacao fecha automaticamente se ;; nao ocorrerem erros (setq compilation-finish-function (lambda (buf str) (if (string-match "exited abnormally" str) ;;there were errors (message "compilation errors, press C-x ` to visit") ;;no errors, make the compilation window go away in 0.5 seconds (run-at-time 0.5 nil 'delete-windows-on buf) (message "NO COMPILATION ERRORS!")))) ;;; debug ;; estilo de janelas para o gdb (setq gdb-many-windows 1) ;;; seccao para o cedet ;;; ------------------- ;; Load CEDET (load-file "~/.emacs.d/lisp/cedet-1.0pre3/common/cedet.el") ;; Enabling various SEMANTIC minor modes. See semantic/INSTALL for more ideas. ;; Select one of the following (semantic-load-enable-code-helpers) ;; (semantic-load-enable-guady-code-helpers) ;; (semantic-load-enable-excessive-code-helpers) ;; Enable this if you develop in semantic, or develop grammars ;; (semantic-load-enable-semantic-debugging-helpers) ;; Load ECB (add-to-list 'load-path "~/.emacs.d/lisp/ecb") (require 'ecb) ;; Load Doxygen comments (require 'doxygen) ;; Load Templates (require 'template) (template-initialize) ;;; seccao programacao para latex ;;; ----------------------------- ;; auctex (load "auctex.el" nil t t) (load "preview-latex.el" nil t t) ; multiple files (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) ;;; seccao programacao para a web ;;; ----------------------------- ;; programacao em javascript (require 'javascript-mode) ;; programacao em php (require 'php-mode) (add-hook 'php-mode-user-hook 'turn-on-font-lock) (add-hook 'php-mode-user-hook '(lambda () (define-abbrev php-mode-abbrev-table "ex" "extends"))) ;; programacao css (autoload 'css-mode "css-mode" "Mode for editing CSS files" t) (setq auto-mode-alist (append '(("\\.css$" . css-mode)) auto-mode-alist)) ;; programacao psgml ;(autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t) ;(autoload 'xml-mode "psgml" "Major mode to edit XML files." t) ;; nxml-mode (load "~/.emacs.d/lisp/nxml/rng-auto.el") (add-to-list 'auto-mode-alist (cons (concat "\\." (regexp-opt '("xml" "xsd" "sch" "rng" "xslt" "svg" "rss") t) "\\'") 'nxml-mode)) (unify-8859-on-decoding-mode) (setq magic-mode-alist (cons '("<\\?xml " . nxml-mode) magic-mode-alist)) (fset 'xml-mode 'nxml-mode) ; para editar html no modo nxml-mode ;(fset 'html-mode 'nxml-mode) ;; programacao multi mode (require 'mmm-auto) (setq mmm-global-mode 'maybe) (mmm-add-mode-ext-class 'html-mode "\\.php\\'" 'html-php) ;;************************************************************ ;; configure HTML editing ;;************************************************************ ;; ;(require 'php-mode) ;; ;; configure css-mode ;(autoload 'css-mode "css-mode") ;(add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode)) (setq cssm-indent-function #'cssm-c-style-indenter) (setq cssm-indent-level '2) ;; ;(add-hook 'php-mode-user-hook 'turn-on-font-lock) ;; ;(require 'mmm-mode) ;(setq mmm-global-mode 'maybe) ;; ;; set up an mmm group for fancy html editing (mmm-add-group 'fancy-html '( (html-php-tagged :submode php-mode :face mmm-code-submode-face :front "<[?]php" :back "[?]>") (html-css-attribute :submode css-mode :face mmm-declaration-submode-face :front "style=\"" :back "\""))) ;; ;; What files to invoke the new html-mode for? (add-to-list 'auto-mode-alist '("\\.inc\\'" . html-mode)) (add-to-list 'auto-mode-alist '("\\.phtml\\'" . html-mode)) (add-to-list 'auto-mode-alist '("\\.php[34]?\\'" . html-mode)) (add-to-list 'auto-mode-alist '("\\.[sj]?html?\\'" . html-mode)) (add-to-list 'auto-mode-alist '("\\.jsp\\'" . html-mode)) ;; ;; What features should be turned on in this html-mode? (add-to-list 'mmm-mode-ext-classes-alist '(html-mode nil html-js)) (add-to-list 'mmm-mode-ext-classes-alist '(html-mode nil embedded-css)) (add-to-list 'mmm-mode-ext-classes-alist '(html-mode nil fancy-html)) ;; ;; Not exactly related to editing HTML: enable editing help with mouse-3 in all sgml files ;(defun go-bind-markup-menu-to-mouse3 () ; (define-key sgml-mode-map [(down-mouse-3)] 'sgml-tags-menu)) ;; ;(add-hook 'sgml-mode-hook 'go-bind-markup-menu-to-mouse3) (set-face-background 'mmm-default-submode-face nil) ;;; seccao de definicao das teclas de atalho ;;; ---------------------------------------- (global-set-key [f1] 'help) (global-set-key [f2] 'tmm-menubar) (global-set-key [f3] 'tags-search) (global-set-key [f4] 'complete-symbol) (global-set-key [f5] 'point-to-register) (global-set-key [f6] 'jump-to-register) (global-set-key [f7] 'hexl-mode) (global-set-key [f8] 'perl-mode) (global-set-key [f9] 'compile) (global-set-key [f10] 'kill-compilation) (global-set-key [f11] 'next-error) (global-set-key [f12] 'add-change-log-entry-other-window) ------------------------------------------------------------------------------------------------------------------- Can someone help me with this? Thanks, Bruno -- View this message in context: http://www.nabble.com/Emacs-and-C-source-files-tf2607249.html#a7275598 Sent from the Emacs - Help mailing list archive at Nabble.com.