writegood-mode
writegood-mode copied to clipboard
oxford commas
I know this might be controversial, as there are basically two opposing sides of that debate, but I would love it if writegood-mode could (optionally) outline oxford commas (as a) mistake. Depending on the config, this would be marked as an error:
foo, bar and baz
or this:
foo, bar, and baz
The former could be matched with this regex:
\([[:alpha:]]+,[[:space:]]+\)+[[:alpha:]]+[[:space:]]+\(and\|or\)[[:space:]][[:alpha:]]+
... according to this answer. The latter would be matched with:
\([[:alpha:]]+,[[:space:]]+\){2,}\(and\|or\)[[:space:]][[:alpha:]]+
Would you be open to such an extension, provided it's a toggle?
@anarcat, this is an excellent idea. Would you be able to make a pull request?
Also, I believe that the two regexes you have listed will be incomplete and unable to match lists consisting of elements of multiple words. Consider these examples:
I like The Lord of the Rings, Star Wars and Harry Potter. or I like The Lord of the Rings, Star Wars, and Harry Potter.
ah, true. how do we resolve that conendrum?
i'd be happy to do a PR, but I'm not sure where to begin... pointers in the code? :) i guess i'd need a defcustom for the toggle, is there a list of regex the plugin looks for already?
Thank you for the package @bnbeckwith. I was just wanted to check if this has been included now.
if this issue is still open, i would assume not.