ggtags icon indicating copy to clipboard operation
ggtags copied to clipboard

`ggtags-fontify-code` should be called optionally

Open ooglyhLL opened this issue 3 years ago • 2 comments

Some may prefer no highlighting at all. Also, some modes require (significantly) more context for proper highlighting than just a single line[1]. What about a variable to configure the behaviour? Something along these lines:

ggtags-maybe-fontify-code: t: Fontify if the code buffer has font-lock-mode switched on. nil: Force off

[1] I guess loading the entire file into a temporary buffer, highlighting and extracting the string with text properties might be too expensive in case of large files.

ooglyhLL avatar Jan 10 '22 16:01 ooglyhLL

The plan originally was for people to use (add-function (local 'ggtags-get-definition-function) ...) to override the default. Alternatively you can defalias ggtags-fontify-code to identity.

leoliu avatar Jan 11 '22 04:01 leoliu

Yeah that would work, thanks. I guess having a switch for the default implementation won't hurt though.

ooglyhLL avatar Jan 11 '22 07:01 ooglyhLL