Re: Proposal: fixing Todo highlighting chaos
Ben Fritz wrote: Well, sure it's easy to override one file. But you would need to do that for literally every filetype you edit in Vim! That's a much taller order! I'm not so sure about that. * option 1: wait for approval of idea, then wait for many maintainers to change their syntax highlighting files to accommodate the new approach, then wait for it all to show up. Benefits available in indefinite future. * option 2: do it yourself as I outlined. How many filetypes do you use? I suspect its 10 or less, with only a very few often used. Benefits available immediately. Regards, Chip -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups vim_dev group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Proposal: fixing Todo highlighting chaos
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22-Jul-2015 19:42, Charles E Campbell wrote: Ben Fritz wrote: Well, sure it's easy to override one file. But you would need to do that for literally every filetype you edit in Vim! That's a much taller order! I'm not so sure about that. * option 1: wait for approval of idea, then wait for many maintainers to change their syntax highlighting files to accommodate the new approach, then wait for it all to show up. Benefits available in indefinite future. * option 2: do it yourself as I outlined. How many filetypes do you use? I suspect its 10 or less, with only a very few often used. Benefits available immediately. How about a combination of the two? Quickly approve the concept of configurable TODOs (on this list, by Bram), mention this in :help 44.12 (Portable syntax file layout) with an appropriate example snippet, and syntax plugin authors will pick this up. (Realistically, some sooner, many later, a lot never). Depending on which syntaxes you use, you'll like cover widespread (updated) syntaxes ones with the new, single-place configuration, and only have to implement special overrides for the (gradually shrinking) remainder (and can encourage those authors to adopt the new config, best with a simple patch). - -- regards, ingo -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.17 (MingW32) iQEcBAEBAgAGBQJVr+68AAoJEA7ziXlAzQ/vpQQH/2GOPqeO/tpbmGuEixJ+cmF2 XoLZUgaaZmIpRI0f9oga7aBxKB0w1W+JUcvU6ljh3YaSNAnOJcoEjDHyUJ8emOfU 70tmam1pCo/OLxx8mH4NXAob+5ykx2UxfHSyvj2LXTEr0ruIspAqlKkIqLL4evLS b7bBoA7RxvZNq/Qs8kjqfI+VA0Wje5+pOqGNt2JtwXZngphMsNRbBgYS9UFP3hvm psYUnk49WvGcftHTUZhjBA2MbX59EzfvcaOAl+cion0SY2ODOf/OvJX1bv96rVOH 4diF/G/570fuifDgeCUPS5VpQG+aeVmlQ0tlBfnw/DIVWf/r0AjYExXaBfonb4Y= =EoHo -END PGP SIGNATURE- -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups vim_dev group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Proposal: fixing Todo highlighting chaos
Well, sure it's easy to override one file. But you would need to do that for literally every filetype you edit in Vim! That's a much taller order! -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups vim_dev group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Proposal: fixing Todo highlighting chaos
Jean-François Bignolles wrote: Hello, Using different languages, I remarked that the Todo system (highlighting of special words inside comments) was currently a bit chaotic: some keywords are highlighted for one syntax, but not for an another one. (I won't talk here of syntax files which doesn't support this at all, syntax files which have special needs, i.e. syntax match / syntax region, etc.) Out of curiosity, I searched all the (uniques) lists of Todo keywords; currently there are about 40 (!) different variants: snip OK -- assume that the user doesn't like the current list of Todo keywords provided by c.vim; s/he wants LOOKATTHIS instead. It isn't that hard: syn clear cTodo syn keyword cTodo contained LOOKATTHIS Place into .vim/after/syntax/c.vim Regards, Chip Campbell -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups vim_dev group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Proposal: fixing Todo highlighting chaos
Hi Jean-François On 2015-07-06 Monday at 14:16 -0700 Jean-François Bignolles wrote: Using different languages, I remarked that the Todo system (highlighting of special words inside comments) was currently a bit chaotic: some keywords are highlighted for one syntax, but not for an another one. (I won't talk here of syntax files which doesn't support this at all, syntax files which have special needs, i.e. syntax match / syntax region, etc.) Out of curiosity, I searched all the (uniques) lists of Todo keywords; currently there are about 40 (!) different variants: TODO TODO BUG FIX TODO BUG FIXME HACK REFACTOR REVIEW TEMP XXX TODO COMBAK DEBUG FIXME XXX TODO COMBAK FIXME XXX TODO DEBUG FIXME NOTE XXX TODO FIXME TODO FIXME DEBUG NOTE XXX TODO FIXME NOT XXX TODO FIXME NOTE TODO FIXME NOTE NOTES XXX TODO FIXME NOTE OPTIMIZE XXX TODO FIXME NOTE XXX TODO FIXME REVIEW TBD XXX[X] TODO FIXME TBD TODO FIXME TBD XXX TODO FIXME XXX TODO FIXME XXX[X] TODO NOTE XXX TODO TODO: FIXME FIXME: NOTE NOTE: TBD TBD: XXX XXX: TODO Todo COMBAK DEBUG FIXME XXX TODO Todo DEBUG TODO Todo todo TODO XXX TODO XXX FIXME TODO XXX FIXME BUG TODO display FIXME XXX TODO lout Lout LOUT TODO todo FIXME NOTE OPTIMIZE XXX TODO todo FIXME fixme TBD tbd Todo todo todo todo: combak combak: todo combak fixme xxx todo attention note fixme readme todo fixme todo fixme bugbug todo: bugbug: note: todo fixme xxx todo test The problem is that each syntax file contains the hard-coded preferences of its author. However the end user may want to have some keywords added to the Todo list, to have some other keywords removed, or may even want to have the Todo system completely switched off! And above all, the end user probably wants the same Todo list for whatever syntax he uses! Of course one can take a Vim syntax file, tweak it for his own needs, and drop it into his personal configuration directory. But it's a bit radical when few lines must be changed! To solve this, just for simple cases where a syntax keyword is used (around 240 syntax files), the proposal is: - to let the user defines its list of Todo matches, using a Vim-standardized global variable; for instance: let g:todo_keywords = 'Todo FIX MyTodo' - to update Vim documentation (mostly syntax.txt and user_44.txt) to replace hard-coded Todo, explain the usage of the variable, etc. - modify syntax files to use this variable (and do nothing when undefined) to build syntax commands. Taking c.vim as an example of adaptation: Original .. syn keyword cTodo contained TODO FIXME XXX [...] cCommentGroup allows adding matches for special things in comments syn cluster cCommentGroup contains=cTodo,cBadContinuation New version ... cCommentGroup allows adding matches for special things in comments syn cluster cCommentGroup contains=cBadContinuation if exists ('g:todo_keywords') exe 'syntax keyword cTodo contained ' g:todo_keywords syn cluster cCommentGroup add=cTodo endif Note that some syntax files (sinda, tak, trasys) already allows the user user to define its own list of Todo keywords. However the variable name (thermal_todo) isn't too generic! The proposal involves small changes to a lot of files. I've started to test this with some syntax file (c, tcl, vhdl) and seen no problem. Other remark: sometimes the contained keyword isn't used to declare Todo lists; I'm not sure it's needed or not, but here's the list of syntax files: arch, cdrdaoconf, falcon, initex, lace, modconf, nsis, pli, plsql, sqlinformix, stp Many thanks for your contribution! Your concept looks to me (1) reasonable (2) reusable: • for other popular keywords, e.g. “Note” which I would keep separate from “Todo”, because the former may be just a hint to avoid reintroduction of an already fixed bug, whereas the latter mostly regards to not yet fixed bugs or scheduled or considered improvements • Maybe automatic update of timestamps could be generalized similarly [1] (3) valuable: yields benefits for all three groups: users, maintainers, developers Just my humble subjective opinion, to encourage your work. [1] See my separate mail “Proposal: Generalization of automatic update of timestamps in lines like Last Change: 2015-07-07”. -- Best regards, Roland Eggner -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit