Re[3]: (x)emacs как универсальный редактор
От: aka50 Россия  
Дата: 27.01.05 10:48
Оценка: 12 (2)
Здравствуйте, poiuy, Вы писали:

P>А по подробнее про ecb/cedet можно — как их можно использовать для всего этого?

P>А то что-то я патался это использовать — никак не помогло.
P>Так и бегаю по tag-ам. А для функий использую eldoc-mode.
P>И желательно пример конфига в студию если таковой имеется.

# навигация по файлам: инкрементальный поиск, букмарки, открытие файлов (a la Ctrl+F12 в Delphi) проекта, открытие файлов из #include "..."

это через speedbar делается в ecb
(setq ecb-use-speedbar-instead-native-tree-buffer 1)


# навигация по структуре: переход к классам/переменным/полям/<что там есть в языке>.

Если я правильно понял, то это что-то вроде этого
http://ecb.sourceforge.net/screenshots/1.png
В ECB это работает "из коробки", при рабочем semantic.

# контекстная подсказка: т.е. автокомплит, подсказка по параметрам функций

http://cedet.sourceforge.net/intellisense.shtml — настрока cedet для intellesence,
но это под XEmacs не работает. По этому не скажу как это точно работает, ибо
у меня XEmacs. Но там есть скриншот, который показывает как это
должно работать . И под XEmacs это тоже вроде работает, но там semantic
сломан был. По этому сейчас не вкурсе, может быть починили. Или
использовать не XEmacs, а GNU Emacs, там все работает нормально.
И еще для того, чтоб работало: надо semantic настроить:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Semantics Support
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(unless (fboundp 'subst-char-in-string)

  (defun subst-char-in-string (old-char new-char str)
    "Replaces any occurance of old-char with new-char in str"
    (replace-in-string str (char-to-string old-char) (char-to-string new-char))))
    
(unless (fboundp 'replace-regexp-in-string)
  (defun replace-regexp-in-string (regx subst str)
    "Replaces regx by subst in str"
    (replace-in-string str regx subst)))
    
;;; use semantic package
(setq semantic-load-turn-everything-on t)
(setq semantic-load-turn-useful-things-on t)

(load-file "/usr/local/lib/xemacs/site-lisp/cedet/common/cedet.el")

(require 'cedet)
(require 'semantic-util)
(require 'semantic-load)
(require 'semantic-ia)
(require 'semantic-util)
(require 'semantic-load)

(semantic-load-enable-code-helpers)

;;;; use ~/.xemacs/semdb.cache for caching
(require 'semanticdb)
(global-semanticdb-minor-mode 1)
(semanticdb-load-system-caches)
;;; set directory where to store semantic files
(setq semanticdb-default-save-directory (expand-file-name "~/.xemacs/semdb.cache"))
(setq semanticdb-default-system-save-directory (expand-file-name "~/.xemacs/semdb.sys.cache"))

;; add our project to semdb
(add-to-list 'semanticdb-project-roots (expand-file-name "~/projects"))

и надо еще semanticdb натравить на /usr/include чтоб системные типы/функции комплителись

Для функций до xrefactory пользовался вот такими биндингами
;; Define func-menu
(require 'func-menu)
(add-hook 'find-file-hooks 'fume-add-menubar-entry)
(define-key global-map "\C-cl" 'fume-list-functions)
(define-key global-map "\C-cg" 'fume-prompt-function-goto)
(define-key global-map '(shift button3) 'mouse-function-menu)


Сейчас пользуюсь xrefactory. Очень советую. Умеет не только
intellisence, но и рефакторить
В общем вот с сайта:

Xrefactory features:

* Full integration with Emacs and XEmacs.
* Available on Solaris, Mac OS X, Linux and Windows systems (other platforms on demand).
* Source browsing based on our own tag implementation supporting multiple preprocessing passes and resolving scopes, accessibilities, overloading and polymorphism.
* Functions for finding forgotten symbols.
* Detection of unused variables, methods and functions.
* Browsing of class inheritance tree.
* Code completion auto-updated after each modification of source code without need for recompilation.
* Refactorings for method (function) extraction; renaming of namespaces, classes, parameters, variables, fields (structure records) and methods (functions); insertion, deletion and moving of parameters. Refactorings are safe with detection of possible conflicts.
* Capable of generating HTML documentation with fully cross referenced source code and 100% of correctly resolved symbols.
* Back mapping preprocessor solves problems introduced by macro expansions, conditional directives and file inclusions.
* Professional C++ front-end from EDG allows to accept ANSI C++ as well as GNU g++, Sun CC and Microsoft MSVC++ language dialects.
* Designed to work with the largest projects. Xrefactory can index millions of lines of code within several minutes. It is capable of updating its index by reparsing only modified files.
* Multiple projects support with project auto-detection.
* Interfacing Emacs IDE functions from the compile.el and comint.el packages.
* Full undo under Emacs and XEmacs.


Новая версия денег стоит из за фронтенда от EDG... но она стоит своих 200уе
С сайта можно взять старую версию http://www.xref-tech.com/xrefactory-java/download.html.
Она даром . И даже старая лучше cedet (ИМХО).
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.