bnbeckwith/writegood-mode — pull request #9 by heikkil (2014-11-12 05:32:10+00:00)
Title: Change weasel words runtime, add user word list

This patch makes it possible to modify the weasel word list and see
them recognized in the text without reloading the package.

I've taken defvars writegood-weasels-font-lock-keywords-regexp and
writegood-weasels-font-lock-keywords that are there only to process
writegood-weasel-words list, and turned
writegood-weasels-font-lock-keywords into a function that processes
writegood-weasel-words and a new list writegood-more-weasel-words. The
list writegood-more-weasel-words is initially empty, so user can
maintain his/her own word collection.

The advantage of this is that if you want to add new weasel words, the
original weasel word list need not to touched and it is easy to add
new words in runtime. The performance hit caused by turning the list of
weasel words into regular expression every time the mode is toggled
seems to be negligible.

With these changes, it is possible to modify the user word list, e.g.

(setq writegood-more-weasel-words
'("for the purpose of" "for the purposes of"))

and toggle on writegood-mode, to see them highlighted in the text. The
main weasel word list can be modified similarly.