emacsorphanage / helm-gtags

GNU GLOBAL helm interface
203 stars 32 forks source link

add helm-gtags-process-environment to support buffer local GTAGSLIBPATH #178

Open tctony opened 6 years ago

tctony commented 6 years ago

hi,

Currently we have to add all tag lib path to 'GTAGSLIBPATH' in global 'process-environment' which may lead to incorrect jump if several lib path contains the same 'TAG'.

For example, I have TAG file for emacs lisp at '\~/.gtags/emacs-lisp' and c include header at '\~/.gtags/c'. global 'GTAGSLIBPATH' would be set to '\~/.gtags/emacs-lisp:\~/.gtags/c'. Both of them contain a 'sort' TAG. if I was editing a 'test.c' file, and querying a 'sort' TAG, I will jump to 'sort' TAG from '~/.gtags/emacs-lisp' which is wrong.

So this PR add a buffer local variable 'helm-gtags-process-environment' (just like 'ggtags-process-environment' in ggtags) to solve this problem. 'helm-gtags-process-environment' will be prepend to 'process-environment' when needed. And we could set 'GTAGSLIBPATH' to different value for different programming language in mode hook.

Best regards.