Kconfig lexer: recognise Trac setting 'tab_width'

#100 Declined
Repository
kriegaex
Branch
default
Repository
birkenfeld
Branch
default
Author
  1. Alexander Kriegisch
Reviewers
Description

Thanks for importing my Kconfig lexer, but because the patch was old there was an update that went unnoticed. I just committed it and kindly request you to pull it upstream. It should simplify Trac integration, but uses reflection (import inspect), so please review it before pulling. I hope it is acceptable.

Reference changeset from the Freetz project: http://freetz.org/changeset?reponame=&new=7939%40trunk%2Ftools%2Fdeveloper%2Fkconfig.pygments.patch&old=7914%40trunk%2Ftools%2Fdeveloper%2Fkconfig.pygments.patch

Comments (1)

  1. Alexander Kriegisch author

    Sounds reasonable from a Pygments perspective. The thing is, I guess Trac does tab expansion either for all files or for none, and I guess it does so before sending them to Pygments. So indentation-aware support would only work for Kconfig if it would also be applicable to tab-expanded files with a variable tab width (we use 4 at Freetz). I.e. Pygments would not see any tabs and it would not be safe to asssume that a tab always equals 8 spaces. This is what makes my lexer so complicated and why I added this hack in the first place.

    Should you ever add indentation-aware support in the way Kconfig files sent by Trac need it, please do not hesitate to ask me to be a tester. I am no longer with Freetz, but this ugly little lexer is my baby, so I will test it for you.

    P.S.: Maybe you can accept the comment updates unrelated to Trac, i.e. everything in this patch except "import inspect" and the "special case" hunk? It is just cosmetics, but anyway.