-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when >> 1 tag exists, can the order in which they are offered be controlled? #99
Comments
OK, I understand better. How about one small possibility: global with '-l' option finds only entries that are in this directory (and below). This is a powerful way to localize the search and limit the very long lists that come back from global. Perhaps you a numeric argument of "1" (as opposed to c-u which is already used up) can be used to add this "-l" option? Also, ggtags.el is long (and good) - i could not find where for the gtags-global buffer you shorten the long path names to just single characters for directory names. Whereever that is done, could that not be a place to re-order this list by putting things "nearest" to point first in the list? (I will be happy to try to code this up w/ some hints as to if this possible and where might this be done in ggtags.el. (Or is this path name shortening done elsehwere?) Thanks again for good stuff that is ggtags. |
Limit matches to directory sounds like a fine idea. I'll see to it soonish. Ordering is harder. We have to wait until getting all matches before re-ordering it. At the moment, ggtags is async by means of |
Thanks LeoLiu for a rapid response. I will look for this "limit matches to directory" feature when you get to it - appreciate it. Also, understand about async nature of use of global, I may try to find if global has a forum where I might put this idea to them. |
no worries. Yes, |
As an update, I posted to global maillist and got the positive response below. I have downloaded the patch and tried it, and it seems to do what I would expect. Hopefully Leo can implement the "local" option in near future, and then once this feature makes it into global a way can be found to incorporate it as well. (Hopefully "local" would be an easy optional arg or a new function.) Gautam from: [email protected] Hi, The -N (--nearest) option is available with the -S or -l option. $ cd libutil Would you please try it? Regards, |
To keep information flow uptodate I have had the following additional email from Shigio (a developer on 'global') Hi, Inspired by your idea, I'm thinking about new sort method 'Nearness sort' of Nearness sort is invoked by the following option: $ global -x main --nearness-sort Nearness sort is based on the following priority. <1> files under the current directory In every priority, they are sorted by alphabetical order. |
Lovely, I'll see what can be done in the weekend. Thanks for getting this feature done upstream ;) |
To Update once again. Global developer has patched his repo w/ this new capability. I assume it will be in the next release of global. I have downloaded and built the new "global" with this patch, and would like to try it out w/ ggtags (as it gets modified by leoliu). The options --local and --nearness are the once to somehow make available to users of ggtags. I suggest that they be functions that can be bound to keys/mouse by user or would get used based on numeric argument to existing functions (M-., etc.) Thanks again for ggtags. -l, --local |
I was unsure if I should post this much but here it goes. I have a patched "global" that I am using to try to get a jump start on this by trying to use the "-N" option in ggtags.el myself. Here is what I have learned and shared with global developer. --- included text My project root is: /proj/home/gthaker/OpenSplice_from_src/OpenSpliceDDS I am working deep in it at: /proj/home/gthaker/OpenSplice_from_src/OpenSpliceDDS/install/HDE/x86.linux-debug/examples/dcps/HelloWorld/c/src I from ........./c/src above I invoke this "-N" option things work well (nearness is followed.) mint17-32bits> global -N createParticipant However, ggtags.el ends up invoking it from root of project as: mint17-32bits> global -N --from-here=55:install/HDE/x86.linux-debug/examples/dcps/HelloWorld/c/src/HelloWorldDataPublisher.c createParticipant And in this case "global" does not return "examples/dcps/HelloWorld/c/src/DDSEntitiesManager.c" as first choice though this is nearest. Just sharing in hopes this is worthy of a comment. Gautam |
Hi @gthaker, Thanks for the updates. I have just built global CVS and I am looking into how best to ingrate it into ggtags. As you have noted ggtags runs from the project root (if I remember correctly it was so that one could symlink a directory into a project, for example, Cheers, |
Hi @gthaker, Could you try it out and send me any comments that you may have? You need to set Thanks. |
I have downloaded from the repo, set ggtags-sort-by-nearness to t and tried this out. It seems to work well, the "nearest" definition is found first. In the process of testing all this I do have one question. (I am relatively new to global and ggtags, so please forgive me if this is a naive question.) I start w/ a M-. and find one of 54 definitions. (The nearest is first, so I am good there.) I then do, as testing, some M-, command, and move down to say D8/D54. I then do M-* to abort navigation and return to where I started. If I next do another M-. it starts at D8 again! I had thought that M-. would just start the process again as I had "aborted", and would start with D1, and M-, would resume at D8. Can you help me understand better? Thanks. Gautam |
hi @gthaker, See Leo - sent from my phone |
That is a pull request. |
The nearness feature is released in version 6.5: http://lists.gnu.org/archive/html/info-global/2015-06/msg00000.html |
Hi: I have been using global/ggtags (including its latest "nearness" capability), and it is working well for me. I have another question. Can global/ggtags be asked to return a tag for a fully qualifed C++ name such as: retval = OpenDDS::DCPS::DataWriterImpl::write( ...); In this software there are 202 "write()" functions, and getting to the correct one quickly would be a nice help. In this case when I ask global to find this "write" method there is no way, it seems, to tell it the full, entirely qualified name (nor does ggtags try to use the fully qualified name in what it asks global to find - prob. because global doesn't seem to support fully qualified names). Since OpenDDS::DCPS:: are namespace qualifiers it would be nice if global recognized that closest entry is one with the line: path/path1/DataWriterImpl.cpp:1691:DataWriterImpl::write(..) No other entry out of 202 comes close to this match. Is it possible for global to somehow find this entry correctly? "nearness" works great, and has already saved me much time in navigating around. This case of fully qualified names I wish there was support for (or if it exists and I have missed seeing it pl. let me know.) Gautam |
Hi @gthaker, It seems it is impossible at the moment. Many people have requested this feature in Cheers, |
Hi:
I am new to ggtags but it is very nice. I am using it to work on a large system in which there are many many directories (with subdirectories) that each contain one test program. Each of this test program has a function named "Initialize_System()". When I do a "M-." sure enough all 54 choices are offered that I can go thru with M-n/p, but it would be great if the first choice offered would be from a file that is "closest" to where I am doing a M-. By closest I mean:
First match offer should be if that function exists in a file in this directory.
Then 2nd match offer would be if that function is defined in any of the subdirectories of where M-. is done.
Then move up one directory and see if function exists there or in any subdirectory at that level.
Then move up one more directory and repeat the process.
This way I can find definitions that I want to change most quickly. Presumably M-] would also benefit from such "smarts" (which can be controlled by some config setting variable.) I have things like D1/54 and R1/137, sure could use a way to nagivate more quickly.
Thanks again for a great mode.
The text was updated successfully, but these errors were encountered: