2881 (setq tag (my-ido-complete-tag (buffer-substring (car bounds) (cdr bounds)))) |
2881 (setq tag (my-ido-complete-tag (buffer-substring (car bounds) (cdr bounds)))) |
2882 (delete-region (car bounds) (cdr bounds))) |
2882 (delete-region (car bounds) (cdr bounds))) |
2883 (insert tag)))) |
2883 (insert tag)))) |
2884 |
2884 |
2885 (global-set-key [M-return] #'my-complete-tag) |
2885 (global-set-key [M-return] #'my-complete-tag) |
2886 |
|
2887 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
2888 (message "CEDET, semantic, SRecord") |
|
2889 |
|
2890 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'. |
|
2891 |
|
2892 (eval-when 'compile |
|
2893 (require 'cedet nil t) |
|
2894 (require 'srecode nil t) |
|
2895 (require 'srecode/table nil t) |
|
2896 (require 'semantic nil t) |
|
2897 (require 'semantic/idle nil t) |
|
2898 (require 'ede/linux nil t)) |
|
2899 |
|
2900 (eval-and-compile |
|
2901 (when (or |
|
2902 (and (= emacs-major-version 23) (>= emacs-minor-version 2)) |
|
2903 (>= emacs-major-version 24) ) |
|
2904 (require 'cedet) |
|
2905 (require 'mode-local))) |
|
2906 |
|
2907 (defun my-srecode-reload-templates () |
|
2908 "Reload all templates under `srecode-map-load-path'. Useful |
|
2909 during template developing." |
|
2910 (interactive) |
|
2911 (setq srecode-mode-table-list nil |
|
2912 srecode-current-map nil) |
|
2913 (srecode-map-update-map) ) |
|
2914 |
|
2915 (defun my-c-mode-cedet-hook () |
|
2916 ;; (local-set-key [C-return] 'semantic-complete-symbol) |
|
2917 ;; (local-set-key [C-return] 'semantic-complete-analyze-inline) |
|
2918 ;; (local-set-key "." 'semantic-complete-self-insert) |
|
2919 ;; (local-set-key ">" 'semantic-complete-self-insert) |
|
2920 ) |
|
2921 (add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook) |
|
2922 |
|
2923 (when (featurep 'cedet) |
|
2924 (require 'semantic) |
|
2925 (global-semantic-idle-scheduler-mode 1) |
|
2926 (global-semantic-idle-summary-mode 1) |
|
2927 (global-semantic-idle-completions-mode -1) |
|
2928 (global-semantic-mru-bookmark-mode 1) |
|
2929 ;; (setq semantic-stickyfunc-sticky-classes '(function type variable include package)) |
|
2930 (global-semantic-stickyfunc-mode -1) |
|
2931 (global-semantic-highlight-func-mode -1) |
|
2932 (global-semantic-decoration-mode 1) |
|
2933 (when (fboundp 'global-semantic-idle-local-symbol-highlight-mode) |
|
2934 (global-semantic-idle-local-symbol-highlight-mode 1)) |
|
2935 (setq semantic-idle-scheduler-idle-time 10) |
|
2936 (setq semantic-idle-scheduler-work-idle-time 60) |
|
2937 (setq semantic-idle-scheduler-max-buffer-size 100000) |
|
2938 ;; (setq semantic-idle-work-parse-neighboring-files-flag nil) |
|
2939 ;; semantic-dependency-system-include-path, semantic-customize-system-include-path |
|
2940 ;; file local project unloaded system recursive |
|
2941 (setq-mode-local c-mode semanticdb-find-default-throttle '(file local)) |
|
2942 (add-hook 'c-mode-hook (lambda nil (semantic-add-system-include "~/.emacs.d/include" 'c-mode))) |
|
2943 (add-hook 'c-mode-hook (lambda nil (semantic-add-system-include "~/.emacs.d/include" 'c++-mode))) |
|
2944 (global-semanticdb-minor-mode 1) |
|
2945 (ignore-errors |
|
2946 (global-cedet-m3-minor-mode 1)) |
|
2947 (semantic-mode 1) |
|
2948 (global-ede-mode 1) |
|
2949 (require 'srecode) |
|
2950 (defvar srecode-map-load-path nil) |
|
2951 (add-to-list 'srecode-map-load-path (locate-user-emacs-file "srecode/")) |
|
2952 (global-srecode-minor-mode 1) |
|
2953 (add-hook 'prog-mode-hook 'srecode-minor-mode) |
|
2954 (ignore-errors |
|
2955 (cedet-ectag-version-check) |
|
2956 (semantic-load-enable-primary-ectags-support)) |
|
2957 (ignore-errors |
|
2958 (cedet-gnu-global-version-check) |
|
2959 (require 'cedet-global) |
|
2960 (semanticdb-enable-gnu-global-databases 'c-mode) |
|
2961 (semanticdb-enable-gnu-global-databases 'c++-mode)) |
|
2962 (ignore-errors |
|
2963 (require 'cedet-java)) |
|
2964 (setq project-linux-build-directory-default 'same |
|
2965 project-linux-architecture-default "x86") |
|
2966 ;; (require 'semantic/db-javap) |
|
2967 ;; (add-to-list 'ede-locate-setup-options 'ede-locate-idutils) |
|
2968 ;; (add-to-list 'ede-locate-setup-options 'ede-locate-global) |
|
2969 ;; (ignore-errors (require 'cedet-idutils)) |
|
2970 (ignore-errors |
|
2971 (require 'semantic/ia) |
|
2972 (define-key semantic-mode-map (kbd "C-c , .") 'semantic-ia-fast-jump) |
|
2973 (define-key semantic-mode-map (kbd "C-c , d") 'semantic-ia-show-doc) |
|
2974 (define-key semantic-mode-map (kbd "C-c , D") 'semantic-ia-show-summary) |
|
2975 (define-key semantic-mode-map (kbd "C-c , ?") 'semantic-ia-complete-symbol-menu) |
|
2976 ;; (define-key semantic-mode-map [(control return)] 'semantic-ia-complete-symbol) |
|
2977 ;; (define-key semantic-mode-map (kbd "C-c , C") 'semantic-ia-describe-class) |
|
2978 ;; semantic-decoration-include-visit |
|
2979 ;; semantic-analyze-proto-impl-toggle |
|
2980 ) |
|
2981 ;; END OF: (when (featurep 'cedet) ...) |
|
2982 ) |
|
2983 |
2886 |
2984 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2887 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2985 (message "imenu") |
2888 (message "imenu") |
2986 |
2889 |
2987 (require 'imenu) |
2890 (require 'imenu) |