leoliu / ggtags

Emacs frontend to GNU Global source code tagging system.
http://elpa.gnu.org
575 stars 56 forks source link

Add support for find-tag-other-window #142

Open punitagrawal opened 7 years ago

punitagrawal commented 7 years ago

While navigating in complex source code it is very useful to be able to lookup tag definitions/references in another emacs window. This feature is supported by the the default etags.el and overridden in gtags.el that ships with Gnu Global. It would be great to have this support in ggtags as well.

I tried to extend ggtags for this by looking at how gtags.el does it by my emacs-fu is not strong enough.

Maybe adding support for find-tag-other-frame at the same time also makes sense. I noticed a related discussion in #126 but the requirement there seems too specific so creating a separate issue.

leoliu commented 7 years ago

Yes, this is tricky to pull off because ggtags builds on compile.el which has its pros and cons. You are hitting one of compile.el's weaknesses. compile.el uses display-buffer (see compilation-goto-locus) so to control the window you need to configure display-buffer-alist and the like.

punitagrawal commented 7 years ago

That explains what all the compile-* calls are in ggtags.el.

Thanks for the pointer to compilation-goto-locus (and display-buffer) - I think I'll need some time to figure out the right incantation if I'm to make this work. :)

In the meanwhile, please feel free to throw prototype/patch at me and I am happy to test it for you.