Ergus / gtags-mode

Gnu Global integration for emacs as simple as possible with TRAMP support.
14 stars 7 forks source link

Only run update on after-save-hook in Global projects. #6

Closed MagielBruntink closed 5 months ago

MagielBruntink commented 5 months ago

Hi @Ergus ,

This is a small PR that fixes an issue (IMO) where gtags-mode's after-save-hook tries to call global or gtags even if the saved file is not in a project where global/gtags is active. Currently if you save a file in a random non-global project, gtags-mode will try to create a local-plist, which in turn calls global to provide the database location. That fails, and the user is shown the error in the echo area. This PR makes sure that the after-save-hook only proceeds if there is a gtags-mode-local-plist defined for the saved file.

Ergus commented 5 months ago

Hi @MagielBruntink :

Very thanks for the merge request. I has been a while I cannot use gtags, so I will accept the change and hope I can test it soon. (I know I must write some tests... but who has time these days?)