Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oxford commas #20

Open
anarcat opened this issue May 20, 2018 · 4 comments
Open

oxford commas #20

anarcat opened this issue May 20, 2018 · 4 comments
Assignees

Comments

@anarcat
Copy link

anarcat commented May 20, 2018

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?

@bnbeckwith
Copy link
Owner

@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.

@anarcat
Copy link
Author

anarcat commented May 22, 2018

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?

@bnbeckwith bnbeckwith self-assigned this Mar 12, 2020
@5uie
Copy link

5uie commented Sep 25, 2022

Thank you for the package @bnbeckwith. I was just wanted to check if this has been included now.

@anarcat
Copy link
Author

anarcat commented Sep 25, 2022

if this issue is still open, i would assume not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants