Re: Iterative visiting of all source files
Eric Ludlam <[email protected]> Mon, 09 Feb 2015 20:53:37 -0500
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <[email protected]> |
On 02/04/2015 12:39 PM, RJD wrote: > I would prefer to use GTAGS as the main source of the lookup for CEDET. At > work we have a huge project. From what I have researched so far the > following are the stages required to set up using gtags (this is basically > my .emacs - at the beginning): > > ========portion of .emacs======== > > ;; MODE: CEDET > (load-file "~/.emacs.d/bzr_cedet/cedet-devel-load.el") ;; This is the latest > dev' version ~~ 26th Jan 2015 > ;; Add further minor-modes to be enabled by semantic-mode. > ;; See doc-string of `semantic-default-submodes' for other things > ;; you can use here. > (add-to-list 'semantic-default-submodes 'global-semantic-idle-summary-mode t) > (add-to-list 'semantic-default-submodes > 'global-semantic-idle-completions-mode t) > (add-to-list 'semantic-default-submodes 'global-cedet-m3-minor-mode t) > (semantic-mode 1) > ;(global-ede-mode 1) > (global-semantic-decoration-mode) > ;(semantic-show-unmatched-syntax-mode t) > ;(speedbar 1) > > ;; MODE: GTAGS (backend for SEMANTIC) > (setq cedet-global-command > "c:/Users/me/Downloads/gnu_global_622wb/gnu_global_622wb/bin/global") > (semanticdb-enable-gnu-global-databases 'c++-mode t) > (semanticdb-enable-gnu-global-databases 'c-mode t) > (setq-default semantic-symref-tool > "c:/Users/me/Downloads/gnu_global_622wb/gnu_global_622wb/bin/global") It is generally safe to leave the symref-tool value as 'detect. Once global is configured, it will detect the GTAGS sfile and use global. The problem you probably have is that it can't use global to detect root until it has detected you want to use global. It uses EDE to detect your project root which you disabled above. If you want to use global, just set the variable to the symbol global. > ========END portion of .emacs==== > > Then, > (http://stackoverflow.com/questions/12791246/how-can-i-tell-if-cedet-is-using-gnu-global) > Eric tells us how to ensure we are using gtags which is basically: > > 1. M-x cedet-gnu-global-show-root RET > ;;;;; For me, this correctly returns the root directory and this is, indeed, > where all the G* files are (such as GTAGS) > > 2. M-: (semantic-symref-detect-symref-tool) > ;;;;; This brings back the string used in my .emacs file. Basically the > function returns: > "c:/Users/me/Downloads/gnu_global_622wb/gnu_global_622wb/bin/global" > > Eric, you say in that stack overflow source: "it will give you a symbol > representing the tool it has chosen to use" - but I do not know what this means. > > I still see no way to definitively finding out whether or not semantic is > using GTAGS. You should be able to set the variable semantic-symref-tool to global: (setq-default semantic-symref-tool 'global) to force it to use GNU Global. The command you quote above will then just return the value of that symbol, so it won't tell you if it is using it or not. You can call M-: (semantic-symref-instantiate) RET directly to create an instantiation of the global search object. If you then do: M-x semantic-symref RET in some function, and shows you all the hits, you can do: M-x semantic-symref-data-debug-last-result There will be a :created-by slot whih will name the tool used, which should be global, and not grep. I hope this helps. Eric ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/