Skip to content

Instantly share code, notes, and snippets.

@alexott
Created October 28, 2012 13:42
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexott/3968635 to your computer and use it in GitHub Desktop.
Save alexott/3968635 to your computer and use it in GitHub Desktop.
Working configuration for CEDET 1.1 & below (only separate releases, not included into GNU Emacs)
;;; cedet-1.1-startup.el --- Working configuration for CEDET 1.1 & below
;; Copyright (C) Alex Ott
;;
;; Author: Alex Ott <alexott@gmail.com>
;; Keywords: CEDET 1.1,
;; Requirements: CEDET 1.1 or below
(load-file "~/tmp/cedet-1.1/common/cedet.el")
(require 'semantic-decorate-include)
(require 'semantic-gcc)
(require 'semantic-ia)
(require 'eassist)
(require 'semantic-lex-spp)
(semantic-load-enable-excessive-code-helpers)
(custom-set-variables
'(semantic-idle-scheduler-idle-time 3)
'(semantic-self-insert-show-completion-function
(lambda nil (semantic-ia-complete-symbol-menu (point))))
'(global-semantic-tag-folding-mode t nil (semantic-util-modes)))
(setq senator-minor-mode-name "SN")
(setq semantic-imenu-auto-rebuild-directory-indexes nil)
(global-srecode-minor-mode 1)
(global-semantic-mru-bookmark-mode 1)
(global-semantic-tag-folding-mode 1)
(setq-mode-local c-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
(setq-mode-local c++-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
(setq-mode-local erlang-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
;; customisation of modes
(defun alexott/cedet-hook ()
(local-set-key [(control return)] 'semantic-ia-complete-symbol-menu)
(local-set-key "\C-c?" 'semantic-ia-complete-symbol)
;;
(local-set-key "\C-c>" 'semantic-complete-analyze-inline)
(local-set-key "\C-c=" 'semantic-decoration-include-visit)
(local-set-key "\C-cj" 'semantic-ia-fast-jump)
(local-set-key "\C-cq" 'semantic-ia-show-doc)
(local-set-key "\C-cs" 'semantic-ia-show-summary)
(local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
(local-set-key (kbd "C-c <left>") 'semantic-tag-folding-fold-block)
(local-set-key (kbd "C-c <right>") 'semantic-tag-folding-show-block)
)
(add-hook 'c-mode-common-hook 'alexott/cedet-hook)
(add-hook 'lisp-mode-hook 'alexott/cedet-hook)
(add-hook 'scheme-mode-hook 'alexott/cedet-hook)
(add-hook 'emacs-lisp-mode-hook 'alexott/cedet-hook)
(add-hook 'erlang-mode-hook 'alexott/cedet-hook)
(defun alexott/c-mode-cedet-hook ()
(local-set-key "\C-ct" 'eassist-switch-h-cpp)
(local-set-key "\C-xt" 'eassist-switch-h-cpp)
(local-set-key "\C-ce" 'eassist-list-methods)
(local-set-key "\C-c\C-r" 'semantic-symref)
)
(add-hook 'c-mode-common-hook 'alexott/c-mode-cedet-hook)
;; hooks, specific for semantic
(defun alexott/semantic-hook ()
(imenu-add-to-menubar "TAGS")
)
(add-hook 'semantic-init-hooks 'alexott/semantic-hook)
;; gnu global support
(when (cedet-gnu-global-version-check t)
(require 'semanticdb-global)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode))
;; ctags
(when (cedet-ectag-version-check t)
(require 'semanticdb-ectag)
(semantic-load-enable-primary-exuberent-ctags-support))
;;; ede customization
(global-ede-mode t)
(ede-enable-generic-projects)
;;; cedet-1.1-startup.el ends here
@xuewei4d
Copy link

Thanks for your configuration file. I just run into a problem when I use scheme. When I define the following functions,

(define (even? x)
  (= (remainder x 2) 0))
(define (odd? x)
  (not (= (remainder x 2) 0)))

(define (same-parity x . y)
  (filter (if (even? x)
          even?
          odd?)
      (cons x y)))

The semantic will get get Debugger entered. It seems semantic has problems with the definition of functions that accept any number of arguments.

Debugger entered: ((93 186))
  byte-code("\301\302!\210\303�!\207" [tag message "A Rule must return a single tag-line list!" debug] 2)
  semantic--tag-expand((93 186))
  semantic-repeat-parse-whole-stream(((semantic-list 1 . 43) (semantic-list 44 . 91) (semantic-list 93 . 186)) nil nil)
  semantic-parse-region-default(1 188 nil nil nil)
  semantic-parse-region(1 188)
  semantic-fetch-tags()
  byte-code("\212\212\300 \210*\301\207" [semantic-fetch-tags nil] 1)
  semantic-idle-scheduler-refresh-tags()
  byte-code("\306�\307p\307\306\310\311\312 \"\"\"�\306\211��\306�
;\205��\313
!�%�&\205^�\314\315!\205+��
?\205^��'?\205^��%\204E�
;\203E�\316
!\204R��%\205^�\313
\306\317#\205^��(\320X\206^�\321 �(W)\203\200�\212�)��*\203p�\322 \202t�\323\324\325\217�   \306�+\211�,\203���,@�+�-\203\231�\326 \204\223�\327 \203\231�\330�-\331\"\210r�+q\210�)\f=\203��
;\205\255�\313
!�%�&\205\357�\314\315!\205\274��
?\205\357��'?\205\357��%\204\326�
;\203\326�\316
!\204\343��%\205\357�\313
\306\317#\205\357��(\320X\206\357�\321 �(W)\203\n��*\203\376�\322 \210\202\n�\323\332\333\217\210\202\n�p�B�)�,A\211�,\204��*��)�.\306�/\211�,\203���,@�/\212�-\203>�\326 \2048�\327 \203>�\330�-\334\"\210�0\203Q�\335�/D�1\336\337\340�1#)\210�*\203]��/ \210\202b�\323\341\342\217\210�0\203u�\343�/D�1\336\337\340�1#)\210)�,A\211�,\204#�*\212 \306�+\211�,\203���,@�+�-\203\245�\326 \204\237�\327 \203\245�\330�-\344\"\210r�+q\210
;\205\262�\313
!�%�&\205\364�\314\315!\205\301��
?\205\364��'?\205\364��%\204\333�
;\203\333�\316
!\204\350��%\205\364�\313
\306\317#\205\364��(\320X\206\364�\321 �(W)\203\373�\322 \210)�,A\211�,\204\213�.�\306\207" [inhibit-quit buffers safe others mode buffer-file-name nil delq mapcar #[(b) "\301�!\205���\207" [b buffer-file-name] 2] buffer-list file-remote-p boundp semantic-debug-enabled file-exists-p t 0 buffer-size semantic-idle-scheduler-refresh-tags err (semantic-idle-scheduler-refresh-tags) ((error (byte-code "\301\302\303\304p\305�!#\"\210\306\207" [err message "Idle Parse Error: %S" format "%S - %s" error-message-string nil] 7))) input-pending-p accept-process-output throw parsing-mode-buffers (semantic-idle-scheduler-refresh-tags) ((error (byte-code "\301\302\303\304p\305�!#\"\207" [err message "Idle Parse Error: %S" format "%S - %s" error-message-string] 7))) idle-queue "IDLE: execute service %s..." apply fame-temp-message-internal message (funcall service) ((error (byte-code "\302\303\304�\"\303\305p\306    !#\"\207" [service err message format "Idle Service Error %s: %%S" "%S - %s" error-message-string] 7))) "IDLE: execute service %s...done" parsing-other-buffers remote-file\? semantic-idle-scheduler-mode semantic-lex-debug semantic-idle-scheduler-max-buffer-size major-mode debug-on-error b --dolist-tail-- semantic-current-input-throw-symbol semantic-idle-scheduler-queue service semantic-idle-scheduler-verbose-flag args] 8)
  semantic-idle-core-handler()
  semantic-idle-scheduler-function()
  apply(semantic-idle-scheduler-function nil)
  byte-code("r\301�\302H�\303H\"\210)\301\207" [timer apply 5 6] 4)
  timer-event-handler([t 0 1 0 t semantic-idle-scheduler-function nil idle 0])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment