Thread: Re: [cedet-semantic] cedet-semantic post from yupeng82921@163.com requires approval
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2008-12-03 18:14:47
|
>>> yup...@16... requires approval seems to think that: > hello. > >I have two questions about semantic smart completion. > >1. When I call "semantic-ia-complete-symbol-menu", it will show a pop >up menu. But unless I select an option form it, the menu will not >disappear. In fact, I want to find a function, when I call it, it can >show a pop up menu, and I can select a symbol to comple, but if I do >not want to select anyone, I can still insert character to the >current buffer. If there is a function like this, I can bind it to >every key on my keyboard, so whenever I insert a character, I can >always get a completion menu. Is there a function let me do this? The Emacs popup menu is different on different platforms, and different build configurations. The feature you found may not work on very many versions of Emacs. >2. It seems that semantic can only analyze the current file and its >head file. If I want to write a function that never be declared in >the current file, semantic can not comple it. But gnu global can do >this. So I want to add global's completion result to the semantic pop >up menu, could you tell me how could I do that? Additionally, maybe >there are some redundance between semantic and global, I also want to >re-arrange the completion result, could you tell me how to do that? >Or is there other simple method? What language are you using the completion mode in? Each language has a different level of CEDET customization. If you are using something new, then someone would need to reconfigure the completion engine to use a different variety of search. I've been working with GNU Global recently as a back-end to a symbol-referencing tool. Global would form a nice back-end for name-only searches too and that is on my to-do list. The Semantic database framework supports handling any number of different external tools as long as a small wrapper is put around them. semanticdb-ebrowse.el is one such example. Eric -- Eric Ludlam: er...@si... Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net |
From: Eric M. L. <er...@si...> - 2008-12-30 02:06:21
|
Hi Yupeng, It would be wise to subscribe to the mailing list if you would like to get your posts replied to reliably. :) The GNU Global support is not yet magically 100% configured with one step. I'm still in the process of finding the integration paths, and each path must be configured separately. If you want GNU Global to work with finding project includes, you need to first make sure there is an EDE project active, like ede-cpp-root. You also need to enable Global via the EDE variable `ede-locate-setup-options'. Those two together will let Semantic find any file in your project by simple name. To use Global to find symbols via semantic, you need to enable the database backend via `semanticdb-enable-gnu-global-databases'. Be warned, however. This database is only used for wide searches of root symbols. Smart completion doesn't do wide searches, it only searches explicit lists of header files. It would be useful for finding explicit names for a Jump however. I haven't tested this aspect much. As for ebrowse, it is useful for finding tags by name in a directory. Semantic still needs to parse everything. Over time, the ebrowse database becomes less useful as Semantic parses everything normally, so I have stopped using it. Using Exuberant ctags can speed up parsing of C++, but it has some subtle issues of its own. The semantic-ia-fast-jump bug you report sounds like something I had fixed a several weeks ago. I looked, and I don't think I've forgotten to check any of my changes in. If you can specify a precise way to reproduce the bug, that would be helpful. If there is no simple way to reproduce the issue, you should use edebug-defun on `semantic-ia--fast-jump-helper' to find out what is missing. Good Luck Eric >>> yup...@16... seems to think that: >Hi, Eric. > >I'm so excited to see semantic can extract information from gnu global >database. I have check out the last version of CEDET from CVS to try >it. It is pretty wonderful! Now I can get the completion information >from the whole project. > >But I found it is still not perfect enough. It can not get the member >of a structure if I do not specify the include path in EDE. For a >large C program, it may have too many directory to include. I think in >theory, we needn't to specify the include path if we use global. Such >as, when semantic can not find a head file, it can put the name of the >head file to global, then global can tell semantic the directory of >the head file. Or use another method, we use global create a whole >project index, and use ebrowse create index for every folder. When >semantic complete a structure or class member, it search its define in >the current buffer and its head file in the current directory, if do >not find the define, put the structure or class name to global, global >can tell semantic the directory where the structure or class is >defined, them semantic search the ebrowse index in that directory. Are >these two methods possible? > >Another thing. I found when I use "semantic-ia-fast-jump" to find >where a function is defined, and if the function is not defined in the >current buffer, "semantic-ia-fast-jump" can only open the file where >the function is defined but do not set the the buffer which contents >the function define as the current buffer. And if a function is >defined on two files, both file will be open, I think it may be better >to let the user select which file to open. > >yupeng -- Eric Ludlam: er...@si... Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net |
From: bread <bre...@gm...> - 2008-12-30 02:28:06
|
Hi, As mention to semantic-ia-fast-jump, is there a way to jump back? :) -- Zhiqiu Kong (孔直秋) |
From: Eric M. L. <er...@si...> - 2008-12-30 03:38:23
|
>>> bread <bre...@gm...> seems to think that: >Hi, > >As mention to semantic-ia-fast-jump, is there a way to jump back? :) Hi. It pushes the global mark, and it will push the tag mark when the function push-tag-mark is available. (ie, in XEmacs.) That means you can use C-x C-@ (pop-global-mark) or M-* (pop-tag-mark) to go back where you came from. I usually use "C-x b RET", which goes back to the last buffer I was at. If it jumped to the same buffer, then I use C-x C-x (exchange-point-and-mark) to go back. Lastly, if you enable semantic-mru-bookmark-mode, you can use C-x B (capital B) as it magically tracks everything you do, and lets you jump around via a history of tag names you've worked in. This is spiffier since you can use it for any movement in Emacs, and it gives you handy names to remind you where you may be jumping to. Enjoy Eric -- Eric Ludlam: er...@si... Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net |
From: Toby C. <ts...@ca...> - 2008-12-03 20:58:59
Attachments:
completion-ui.el
completion-ui-examples.el
|
Eric M. Ludlam wrote: >>>> yup...@16... requires approval seems to think that: >> hello. >> >> I have two questions about semantic smart completion. >> >> 1. When I call "semantic-ia-complete-symbol-menu", it will show a pop >> up menu. But unless I select an option form it, the menu will not >> disappear. In fact, I want to find a function, when I call it, it can >> show a pop up menu, and I can select a symbol to comple, but if I do >> not want to select anyone, I can still insert character to the >> current buffer. If there is a function like this, I can bind it to >> every key on my keyboard, so whenever I insert a character, I can >> always get a completion menu. Is there a function let me do this? > > The Emacs popup menu is different on different platforms, and > different build configurations. The feature you found may not work on > very many versions of Emacs. As Eric says, this isn't possible on all (any?) platforms, because Emacs menus steal the keyboard focus completely until they're dismissed. You could try my completion-UI package, which supports Semantic (in a fairly rudimentary kind of a way for now). As well as auto-completion, which you mention, it also includes a "pop-up frame", which behaves very like a menu but without stealing keyboard focus, a tooltip in which you can cycle through the entries, much like a menu, and many other goodies besides! (It is nearly Christmas, after all :) I've attached a newer version than is currently available via the web page, which is much easier to set up for non-Elisp-gurus. (I'll release it very soon through the usual channels). See the commentary at the top of completion-ui-examples.el to find out how to install and use it. (If you find any bugs, please report them directly to me, rather than...ahem...bugging people on this mailing list.) HTH, Toby |
From: yupeng82921 <yup...@16...> - 2008-12-04 13:59:21
|
在2008-12-04,"Eric M. Ludlam" <er...@si...> 写道: >>>> yup...@16... requires approval seems to think that: >> hello. >> >>I have two questions about semantic smart completion. >> >>1. When I call "semantic-ia-complete-symbol-menu", it will show a pop >>up menu. But unless I select an option form it, the menu will not >>disappear. In fact, I want to find a function, when I call it, it can >>show a pop up menu, and I can select a symbol to comple, but if I do >>not want to select anyone, I can still insert character to the >>current buffer. If there is a function like this, I can bind it to >>every key on my keyboard, so whenever I insert a character, I can >>always get a completion menu. Is there a function let me do this? > >The Emacs popup menu is different on different platforms, and >different build configurations. The feature you found may not work on >very many versions of Emacs. OK. know I decide to use "semantic-ia-complete-tip" combine with "semantic-ia-complete-symbol" do my completion. > >>2. It seems that semantic can only analyze the current file and its >>head file. If I want to write a function that never be declared in >>the current file, semantic can not comple it. But gnu global can do >>this. So I want to add global's completion result to the semantic pop >>up menu, could you tell me how could I do that? Additionally, maybe >>there are some redundance between semantic and global, I also want to >>re-arrange the completion result, could you tell me how to do that? >>Or is there other simple method? > >What language are you using the completion mode in? Each language has >a different level of CEDET customization. If you are using something >new, then someone would need to reconfigure the completion engine to >use a different variety of search. I use C language write embed system driver. I have a large C language project, it has a lot of directory, and only one directory is belong to me. In fact, semantic can complete almost 90 percent of symbol I write, but sometimes I should call a function in another directory which is never be declared (I can do nothing about the declaration). So I just want to let my auto completion perfecter. > >I've been working with GNU Global recently as a back-end to a >symbol-referencing tool. Global would form a nice back-end for >name-only searches too and that is on my to-do list. The Semantic >database framework supports handling any number of different external >tools as long as a small wrapper is put around them. >semanticdb-ebrowse.el is one such example. > I think combine global with cedet is a good idea. And I will refer to semanticdb-ebrowse.el. >Eric > >-- > Eric Ludlam: er...@si... > Siege: www.siege-engine.com Emacs: http://cedet.sourceforge.net |