From f4e5c4caf7200522d4236d95778d52808767ece3 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 27 Feb 2013 19:29:09 +0100 Subject: [PATCH] Emacs: fixed completion conflict with semantic and Emacs default. --- .emacs.d/functions.el | 6 +++++- .emacs.d/main.el | 12 ------------ .emacs.d/modes.el | 42 ++++++++++++++++++++++++------------------ 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/.emacs.d/functions.el b/.emacs.d/functions.el index 7d868980..b32c80ee 100644 --- a/.emacs.d/functions.el +++ b/.emacs.d/functions.el @@ -29,11 +29,15 @@ " " ")) -(defun list-buffers-switch () "Same as list buffers but switch to it afterward." +(defun list-buffers-switch () "Same as list-buffers but switch to it afterward." (interactive) (list-buffers) (switch-to-buffer-other-window "*Buffer List*")) (define-key my-keys-minor-mode-map (kbd "C-x C-b") 'list-buffers-switch) +(define-key Buffer-menu-mode-map (kbd "RET") + (lambda () (interactive) + (Buffer-menu-switch-other-window) + (delete-window))) ;;============================================================================== ;; Toggle window split diff --git a/.emacs.d/main.el b/.emacs.d/main.el index 1299cf84..e985651e 100644 --- a/.emacs.d/main.el +++ b/.emacs.d/main.el @@ -132,19 +132,7 @@ ;; Semantic with ghost display (allows M-n and M-p to brwose completion). (semantic-mode 1) (define-key my-keys-minor-mode-map (kbd "C-c , d") 'semantic-ia-show-summary) -(define-key my-keys-minor-mode-map (kbd "M-TAB") 'semantic-complete-analyze-inline) (setq semantic-complete-inline-analyzer-displayor-class 'semantic-displayor-ghost) -(defun my-c-mode-cedet-hook () - (local-set-key "." 'semantic-complete-self-insert) - (local-set-key ">" 'semantic-complete-self-insert)) -(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook) - ;; Electric Pairs () [] {} "" etc; (electric-pair-mode 1) - -;; Buffer-mode convenience. -(add-hook - 'Buffer-menu-mode-hook - (lambda () - (local-set-key "RET" 'Buffer-menu-switch-other-window))) diff --git a/.emacs.d/modes.el b/.emacs.d/modes.el index 190f6b15..087423c0 100644 --- a/.emacs.d/modes.el +++ b/.emacs.d/modes.el @@ -379,25 +379,31 @@ properly escaped with double-quotes in case it has spaces." ;; Identation style (setq c-default-style "linux" c-basic-offset 4) -(add-hook 'c-mode-hook - (lambda () - (unless (file-exists-p "Makefile") - (set (make-local-variable 'compile-command) - ;; emulate make's .c.o implicit pattern rule, but with - ;; different defaults for the CC, CPPFLAGS, and CFLAGS - ;; variables: - ;; $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $< - (let ((file (file-name-nondirectory buffer-file-name))) - (format "%s -o %s %s %s %s" - (or (getenv "CC") "gcc") - (file-name-sans-extension file) - (or (getenv "CPPFLAGS") "-DDEBUG=9") - (or (getenv "CFLAGS") "-ansi -pedantic -std=c99 -Wall -Wextra -Wshadow -lm -g3 -O0") - file)))) +(add-hook + 'c-mode-hook + (lambda () + (unless (file-exists-p "Makefile") + (set (make-local-variable 'compile-command) + ;; emulate make's .c.o implicit pattern rule, but with + ;; different defaults for the CC, CPPFLAGS, and CFLAGS + ;; variables: + ;; $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $< + (let ((file (file-name-nondirectory buffer-file-name))) + (format "%s -o %s %s %s %s" + (or (getenv "CC") "gcc") + (file-name-sans-extension file) + (or (getenv "CPPFLAGS") "-DDEBUG=9") + (or (getenv "CFLAGS") "-ansi -pedantic -std=c99 -Wall -Wextra -Wshadow -lm -pthread -g3 -O0") + file)))) - (local-set-key (kbd "C-c C-c") 'compile) - ;; (global-set-key (kbd "") 'next-error) - )) + (local-set-key (kbd "C-c C-c") 'compile) + (local-set-key (kbd "M-TAB") 'semantic-complete-analyze-inline) + (local-set-key "." 'semantic-complete-self-insert) + (local-set-key ">" 'semantic-complete-self-insert) + (local-set-key (kbd "") 'next-error))) + +;; (defun my-c-mode-cedet-hook () +;; (add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook) ;;============================================================================== ;; Common LISP