leoliu / ggtags

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

Should 'ggtags-include-pattern' be a buffer local variable? #200

Closed ooglyhLL closed 4 years ago

ooglyhLL commented 4 years ago

It seems there are just too many different languages out there, and my impression is that this would be helped by making the variable buffer local. The documentation could be extended accordingly, suggesting that language modes should set this to an appropriate value.

leoliu commented 4 years ago

Check the variable in emacs using C-h v it's already marked safe to set buffer-local if it's a string.

ooglyhLL commented 4 years ago

Yes, thanks. I was thinking that it should actually be buffer local in any case. Otherwise many different language modes or user init files would need to include a spell involving make-variable-buffer-local. Regarding the safe as string (only): Looking at the more complex syntax of e.g. Python import statements, or that of some other languages, I'd argue that in many cases the variable will end up being a mode-specific function. WDYT?

leoliu commented 4 years ago

Use setq-local.

ooglyhLL commented 4 years ago

Didn't even know that. We never stop learning, do we. Thanks.