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

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!

2 Pingbacks/Trackbacks

10 responses to “Emacs, artbollocks-mode.el, and writing more clearly”

  1. BeSlayed says:

    Sounds cool, except that the “don’t use passive voice” grammar prescription is itself bollocks….

  2. Kenny Meyer says:

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

    /me adds artbollocks-mode to his .emacs

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

  4. Sacha Chua says:

    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…

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

    Ruben

  6. Sacha Chua says:

    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. =)

  7. Natan Yellin says:

    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.burlingtontelecom.net/~ashawley/gnu/emacs/diction.el

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

  8. TextLint does a similar job and requires no configuration: https://github.com/DamienCassou/textlint.
    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/watch?v=CsG2DKgHanE

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>