Emacs, artbollocks-mode.el, and writing more clearly

Posted: - Modified: | blogging, emacs, writing

Analyzing the text of my blog showed me that I use some phrases way too much. Fortunately, Emacs can shame me into writing better, thanks to Art Bollocks Mode. (Update 2012-06-16: I’ve forked it and cleaned up the naming conventions: https://github.com/sachac/artbollocks-mode)

Art Bollocks Mode monitors your writing and highlights words or patterns you may want to reconsider. It can detect repeated words which sometimes slip past proof-reading. It has a list of common passive verbs, making it easier for you to rewrite the sentences to use the active voice. It detects weasel words like “many” and “surprisingly”. It even comes with jargon catchers for art critics (“postmodern”, “ironic”, and so forth) – hence artbollocks-mode.el.

Whenever you use a phrase that matches its patterns, Emacs highlights it, turning it an ugly orange-on-white and underlining it for emphasis. You can still go ahead and write it, but at least the words jump out. Like this: it’s really pretty obvious…

image

I want to use it to write clearer notes and blog posts, so here’s how I’ve tweaked my configuration. Many of the items below are words and phrases I want to use less. Others are part of work jargon that I’m trying my best to keep out of my regular use.

(require 'artbollocks-mode)
;; Avoid these phrases
(setq weasel-words-regex
      (concat "\\b" (regexp-opt
                     '("one of the"
                       "should"
                       "just"
                       "sort of"
                       "a lot"
                       "probably"
                       "maybe"
                       "perhaps"
                       "I think"
                       "really"
                       "pretty"
                       "maybe"
                       "nice"
                       "action"
                       "utilize"
                       "leverage") t) "\\b"))
;; Fix a bug in the regular expression to catch repeated words
(setq lexical-illusions-regex "\\b\\(\\w+\\)\\W+\\(\\1\\)\\b")
;; Don't show the art critic words, or at least until I figure
;; out my own jargon
(setq artbollocks nil)
;; Make sure keywords are case-insensitive
(defadvice search-for-keyword (around sacha activate)
  "Match in a case-insensitive way."
  (let ((case-fold-search t))
    ad-do-it))

(Isn’t regexp-opt so cool?)

artbollocks-mode.el also includes some basic readability statistics like the Flesch reading ease and Flesch-Kincaid grade level. When I analyzed my blog contents without source code blocks (all the Emacs Lisp code snippets were throwing off my numbers!), it turned out that my blog hovers around 65 in terms of Flesch reading ease, or around the same as Reader’s Digest (as reported by Wikipedia). The Flesch-Kincaid grade level for my posts in 2011 was around 8.4.

I’d use artbollocks-mode.el’s tools for calculating word count and readability, except that Emacs ends up including source code blocks because Art Bollocks doesn’t know about Org Mode. I might be able to work around that by defining more advice or creating my own functions that extract the relevant text into a temporary buffer before determining the text statistics. I can leave that for another day, though.

I’ll experiment with making it part of org-capture-mode for now. If I find that getting editing feedback distracts me too much from writing, I’ll remove it from the hook and toggle it when I’m ready. Here’s the code to turn it on automatically for org-capture:

(add-hook 'org-capture-mode-hook 'artbollocks-mode)

Thanks to dotemax for tweeting about writegood and artbollocks-mode.el. Onward and upward!

You can view 11 comments or e-mail me at sacha@sachachua.com.

11 comments

Sounds cool, except that the "don't use passive voice" grammar prescription is itself bollocks....

Kenny Meyer

2011-12-16T22:44:10Z

Have you seen the follow-up tweet from Dot Emax, where he mentions writegood-mode?

/me adds artbollocks-mode to his .emacs

Ruben Berenguel

2011-12-17T02:17:10Z

Nice! I was looking for readability indexes a few months ago for emacs... Looks like I have them now :)

Any idea on how to tweak the fontify regexp to catch close repeated words? For example, I may want to have example highlighted in this phrase, in case I'm using a repeated word too close to the same word. I tried to tweak the regexp in writegood mode a long time ago, but didn't manage to do it (or maybe I did but got tired of seeing red rows of "the" and I forgot).

Ruben

Ruben: You might be able to repurpose code from the Remembrance Agent, which continuously looks at X words around the point. Hmm, maybe a new tool that looks for the minimum distances between word repetitions...

Ruben Berenguel

2011-12-17T03:42:15Z

I'll have to dig the code for Rememb, it looks like a very interesting concept! Do you use it?

Ruben

Ruben: I played around with it back in 2004, but I haven't been using it since then because I've been on Windows as a base platform. =( It would be an excellent way to take advantage of extra CPU/memory, I think. =)

Natan Yellin

2011-12-18T23:36:13Z

Hey Sacha,
Long time reader here. Are you familiar with diction.el? (I had trouble getting to to work, but I can't recall what the issue was.)
http://www.burlingtonteleco...

If you're interested, I created an el-get recipe to install artbollocks: https://github.com/aantn/el...

Damien Cassou

2011-12-19T13:04:07Z

TextLint does a similar job and requires no configuration: https://github.com/DamienCa....
It uses the compilation mode to provide shortcuts such as C-x ` to go to the next error.

Have a look at the screencast: http://www.youtube.com/watc...

Phil Carter

2017-05-20T12:27:14Z

Hi Sacha,
I have a problem with artbollocks-mode (great name for a mode). I can't get case-insensitive searching to work. I have only a sketchy understanding of Emacs Lisp. I don't understand the defadvice function, but there does not appear be a function named "search-for-keyword" in artbollocks.el, but there is a function called "artbollocks-search-for-keyword".
Has the name "sacha" got any special significance to the function?
Thanks for your help, and thanks for writing up artbollocks mode.
Phil Carter

defadvice is old-style, so you probably shouldn't bother with it anyway. =) The config above is out of date, since I've renamed the functions at https://github.com/sachac/a... (so it's now artbollocks-search-for-keyword, etc.). I've just pushed a small change which should make keyword searching case insensitive. Could you try that? In general, you can customize the case-fold-search variable and set it to t if you want case-insensitive searching.

artbollocks-mode isn't mine, I just cleaned it up a little. =)

Incidentally, you might like this recent discussion about flycheck and a natural language linter: https://www.reddit.com/r/em...