[racket-users] Get list of all predefined identifiers for use in vim syntax highlighting
For those who like to write their racket code in vim, the plugin https://github.com/wlangstroth/vim-racket is pretty essential. Unfortunately, it is outdated and many of the new predefined identifiers (e.g. set-add!) are not highlighted. I added a few of these in my personal settings, but it would be nice to have a text file with every special form and every function listed. Is this list floating around somewhere? If not, is there an easy way to generate it? -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Get list of all predefined identifiers for use in vim syntax highlighting
Hi Luke, This script generates a large list of keywords. It was used to generate the keywords for the Github highlighter. https://github.com/soegaard/racket-highlight-for-github/blob/master/generate-keywords.rkt /Jens Axel 2015-06-01 17:07 GMT+02:00 Luke Miles rashreportl...@gmail.com: For those who like to write their racket code in vim, the plugin https://github.com/wlangstroth/vim-racket is pretty essential. Unfortunately, it is outdated and many of the new predefined identifiers (e.g. set-add!) are not highlighted. I added a few of these in my personal settings, but it would be nice to have a text file with every special form and every function listed. Is this list floating around somewhere? If not, is there an easy way to generate it? -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- -- Jens Axel Søgaard -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Get list of all predefined identifiers for use in vim syntax highlighting
The syntax forms should be in the KEYWORDS list; try un-commenting that line. Some highlighters distinguish keywords and builtins, so Jens' script generates those separately. If Vim doesn't care, you could combine them into one big list. (As my other post says, the distinction is kind of squishy in Racket compared to many other languages. You could say the only keywords are a dozen or so forms in fully expanded programs, but that would be weird. Also weird is saying it's the 1400 primtives in C. So that's why Jens' script says it's syntax only from racket (and I might say only from racket/base). It's a judgment call AFAICT.) -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Get list of all predefined identifiers for use in vim syntax highlighting
1. Jens' solution is good. I've used for the Pygments highlighter and for racket-mode. I recommend it! You may want to stop reading now. :) 2. Coincidentally very recently I've been taking a fresh look at this for racket-mode. I think a recent commit message sums it up pretty well: https://github.com/greghendershott/racket-mode/commit/5956f51c0e14d2c295adaf644b0e8c7f6448701d ~~~ The question of what is a keyword and a builtin is not so simple in Racket: 1. The distinction between the two is squishy, and from one point of view Racket has 1400+ primitives (!). 2. As for builtins, there are many, many batteries included libraries in the main distribution. Where to draw the line? 3. More fundamentally, Racket is a language for making languages. Ultimately the only way to be 100% correct is to do something live with namespace-mapped-symbols. But I don't see that as performant for Emacs font-lock. Here I'm saying that: (a) keywords are syntax (only) from racket/base (b) builtins are everything else provided by #lang racket and #lang typed/racket (except the capitalized Types from typed/racket go into their own list). Plus for modern macros, racket/syntax and a few items from syntax/parse (but not all the syntax classes, because things like `id` and `str` are too generic and too likely to be user program identifiers). Is that somewhat arbitrary? Hell yes. It's my least-worst, practical idea for now. Also, IMHO it's an improvement over getting pull requests to add people's favorites, a few at a time. At least this way is consistent, and can be regenerated programatically as Racket evolves. ~~~ TL;DR No fixed list will be correct. Some fixed lists will pragmatically be OK for most people. It's a judgment call where to draw the line -- whether you want to include identifiers also from typed/racket, racket/syntax, syntax/parse, or others. Also I have a commit to support Emacs font-lock-maximum-decoration (the level of font-lock), so people who find the pragmatic list of keywords annoying or distracting can just completely disable highlighting those. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Get list of all predefined identifiers for use in vim syntax highlighting
Thank you very much, Jens. This appears to be all the functions. Do you know of anything for special forms? This would include for, for/and, define-values, etc... On Monday, June 1, 2015 at 11:09:31 AM UTC-4, Jens Axel Søgaard wrote: Hi Luke, This script generates a large list of keywords. It was used to generate the keywords for the Github highlighter. https://github.com/soegaard/racket-highlight-for-github/blob/master/generate-keywords.rkt /Jens Axel 2015-06-01 17:07 GMT+02:00 Luke Miles rashrep...@gmail.com: For those who like to write their racket code in vim, the plugin https://github.com/wlangstroth/vim-racket is pretty essential. Unfortunately, it is outdated and many of the new predefined identifiers (e.g. set-add!) are not highlighted. I added a few of these in my personal settings, but it would be nice to have a text file with every special form and every function listed. Is this list floating around somewhere? If not, is there an easy way to generate it? -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- -- Jens Axel Søgaard -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.