Live data from Hacker News

Dumb-jump: an Emacs “jump to definition” package

github.com

41–50 of 53 posts

Re: Dumb-jump: an Emacs “jump to definition” package

#41
post #2

Still learning VIM user here, do we have something like this?

Are you aware of '*' and '#', and 'gd'? http://vim.wikia.com/wiki/Go_to_definition_using_g

These only work if your definition is in the same file, though.

Re: Dumb-jump: an Emacs “jump to definition” package

#42
post #40
post #39

For C/C++ RTags ( https://github.com/Andersbakken/rtags ) together with company-mode and fly-check can do jump-to-definition, auto-completion and on-the-fly-syntax-checking. Super easy to use if using cmake as build system. Respond to this comment if you need pointers on how to set things up.

Any equivalent options for make?

For make you could use bear (https://github.com/rizsotto/Bear). It allows you to generate a compilation database that is equivalent to that of cmake projects.

Re: Dumb-jump: an Emacs “jump to definition” package

#45
post #18

Earlier quoted context omitted.

Building a tags file is not trivial.For example if you cloned a random repository on github you'd want to just jump around and not have to have the additional step of generating it and keeping it up to date.

Can't it just be done automatically and on-the-fly using ctags or another appropriate command?

Maybe this changed in the last few years but the problem with TAGS files was that you have to rebuild it at every change you make. I had a cron that rebuilt the ones of the projects I was working on, but it's not efficient and not up to date. Maybe a process that monitors changes to files is a better approach. Still, rebuilding the TAGS file is useless if ag is fast enough. SSDs and lots of RAM to cache files help.

The only problem with ag is that it can't find definitions until you save the buffer to a file. Not that ctags does any better. Some tool running inside emacs could do that too but it's not so important.

Re: Dumb-jump: an Emacs “jump to definition” package

#47

Ah yes, yet another proof that the Wrong Thing™ isn't necessarily the wrong thing. Sure it's objectively worse than [ce]tags, but haven't you heard? Worse is Better. :-D

I am not sure "proof" is the appropriate word. > Dumb Jump uses The Silver Searcher ag (and falls back to grep) ... [and] a set of regular expressions If you're going to install ag, you might as well install universal-ctags[1], a revival of ctags with many improved and new parsers. It allowed me to discard my C and javascript ctags config entirely. Combined with gutentags[2] you have a "just works" and "Less Dumb" se…

The advantage of ag is that it is dumb brute (very brute) force. You do not need an up to date index as it will search whatever is on disk.

I have rtags set up, but it periodically stops working (too many parsing errors, indexer crashes, etc) or it is just slow, then I fall back to ag. It can search a ~1M lines C++ codebase in seconds (and you can start browsing the results while the search is in progress of course). Of couse it also works if you do not have a project setup, or you just switched to a wildly diverged git branch.

I'm definitely going to try this dumb-jump.

Re: Dumb-jump: an Emacs “jump to definition” package

#48
post #45

Earlier quoted context omitted.

Can't it just be done automatically and on-the-fly using ctags or another appropriate command?

Maybe this changed in the last few years but the problem with TAGS files was that you have to rebuild it at every change you make. I had a cron that rebuilt the ones of the projects I was working on, but it's not efficient and not up to date. Maybe a process that monitors changes to files is a better approach. Still, rebuilding the TAGS file is useless if ag is fast enough. SSDs and lots of RAM to cache files help. T…

It shouldn't be too hard to write a grep-buffers command (I was using one version for a while), exclude open files from ag searches and merge the result of ag+grep-buffers in a single output (eh, in fact I should just write it).

Re: Dumb-jump: an Emacs “jump to definition” package

#49

Why is so much Emacs stuff hosted on GitHub these days? It seems antithetical to the spirit of the project as a whole.

What spirit of the project are you thinking of, and how is hosting stuff on Github antithetical to it?

>What spirit of the project are you thinking of

Free Software: http://www.gnu.org/philosophy/free-sw.html

>how is hosting stuff on Github antithetical to it?

Github is s a proprietary cloud service: http://www.gnu.org/philosophy/who-does-that-server-really-se...

Re: Dumb-jump: an Emacs “jump to definition” package

#50

Why is so much Emacs stuff hosted on GitHub these days? It seems antithetical to the spirit of the project as a whole.

As opposed to what? Buying a domain and hosting your own server? To answer your question: Some small programs would probably not exist at all without a service like github.
Post reply on HN