6098 comments
2357 subscribers
6259 on Twitter
Subscribe! Feed reader E-mail

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!

Short URL: http://sachachua.com/blog/p/23072
  • http://babbagefiles.blogspot.com BeSlayed

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

  • http://blog.kennymeyer.net Kenny Meyer

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

    /me adds artbollocks-mode to his .emacs

  • http://www.mostlymaths.net Ruben Berenguel

    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

  • http://sachachua.com Sacha Chua

    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…

  • http://www.mostlymaths.net Ruben Berenguel

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

    Ruben

  • http://sachachua.com Sacha Chua

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

  • http://natanyellin.com Natan Yellin

    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

  • http://damiencassou.seasidehosting.st/ Damien Cassou

    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

  • Pingback: The Emacs regexp-opt Function | Irreal

On This Day...

  • 2012: Decision review: Art class (includes sketches) — As part of my resolution to spend more on learning, I went for one-on-one art classes in a nearby studio [...]
  • 2010: More MobileOrg hacking on the Android — I’ve gotten IBM’s permission to contribute my changes back to the MobileOrg project, yay! (Disclaimer: I’m doing this as myself [...]
  • 2009: Conversations with a mentor: chat about plans, mentoring, and knowledge sharing — Conversations with David Singer are usually more laid-back, but I was buzzing with a few things I wanted to pick [...]
  • 2008: The Return on Mistakes — I still remember the round-eyed awe on a first-year computer science student’s face when I walked past the monitor set [...]
  • 2008: Weekly report: Week ending Dec 14 — Last week’s activities: Work: Site moved into user acceptance testing, hooray! Lots of stuff to work on. Reviewed pictures. Got tablet to [...]
  • 2007: Gnus multi-pane tricks, or I heart Planet Emacsen — The tips Joseph Miklojcik shared for reading e-mail in Gnus included this _really_ nifty thing that I hadn’t come across [...]
  • 2007: Status report: Dec 16
  • 2007: Oh, the weather outside is frightful
  • 2007: Outline for task management chapter — Why manage your tasks in Emacs - [ ] What you might be using now - [ ] Your brain [...]
  • 2007: Weekly report — The week was full of starts and stops and starts again. I practiced Christmas carols with Mike Tsang last Tuesday because [...]
  • 2007: Salmon steak with dill
  • 2007: Sketchblogging with the Nintendo DS Lite
  • 2007: He loves to cook
  • 2007: So close!
  • 2005: Friday night — Ack! I guess I really am an extrovert now. I find it to be _dreadfully_ quiet for a Friday night. The [...]
  • 2005: Characters blogged versus bookmarks — My blogging activity is similar to my bookmarking activity, so that means that bookmarking stuff with del.icio.us doesn’t mean I don’t blog [...]
  • 2005: The Year in Bookmarks — Top 10 tags for 2005 productivity(104) web2.0(88) digitalpinay(88) social(84) useful(83) business(80) blogs(70) research(69) lifehacks(68) blogging(60) Check out my year in bookmarks for [...]
  • 2004: YDC Festival: Puppet shows — I caught the tail end of a puppet show carried out with store-bought dolls: Barbie, Billikin… I was surprised at how [...]
  • 2004: Refactoring Planner annotation code — Many planner files just contain code for creating hyperlinks from the current buffer. This does not have anything to do with [...]
  • 2004: Factors for idea growth — From ParaMode in ZhurnalWiki : But the history of Para mode does highlight three deep sources of power that, in one form [...]
  • 2004: Updating the timelog — I often update my task descriptions. We haven’t found a neat way to do this in-buffer, so I use planner-edit-task-description. However, [...]
  • 2004: Kanji for the day — 初めて会う人と話す時、緊張しないで頑張ってきださい。 はじめてあうひととはなすとき、きんじょうしないでがんばってください。 hajimete au hito to hanasu toki, kinjou shinaide ganbatte kudasai. 頑張ってきださい。| Try your best. 緊張しないで頑張ってきださい。| Try your best not to be nervous. 話す時、緊張しないで頑張ってきださい。| [...]
  • 2003: Perl for Windows administration — - Keith_M: One that I use quite often is Win32::AdminMisc by Dave Roth. www.roth.net - Keith_M: Win32API::Net - Keith_M: Win32::Lanman
  • 2003: Oooh, cool way to split — use Text::ParseWords; @new = quotewords(",", 0, $text);
  • 2003: Cultural differences between UNIX and Windows — http://www.joelonsoftware.com/articles/Biculturalism.html E-Mail from Gino LV. Ledesma
  • 2003: Useful Perl resources — - http://learn.perl.org/ - http://www.perlfect.com/articles/ - http://apprentice.perl.org/ - http://www.stonehenge.com/merlyn/PerlJournal/ - http://learn.perl.org/library Teaching.Perl
  • 2003: More stuff from visiting professor — How do you pronounce your name, Dr. Nievergelt? (Neevergelt) - Let me see if I understand your teaching approach. You develop passive [...]
  • 2003: Perl training — Plan: - Day 1 morning: What is Perl? Lay of the land - Day 1 afternoon: Basic syntax, Perl for extracting data - [...]
  • 2003: Hey, more thoughts on kara — Finite state machines are perfect for pen and paper, because students can check it manually – and they can enlist their [...]
  • 2003: Moving computing into the basics — Mathematics users – elementary mathematics, technicians have more mathematics. So the mathematics teachers could say all we have to teach our students [...]
  • 2003: Meeting with Dr. Juerg Nievergelt — - Advocates strong mathematical approach in first year - Upcoming split - Computational science – common math: numeric and symbolic computation (6 [...]
  • 2003: More about group reviews — Perhaps setting up this kind of tutoring in-class is a good way to encourage student interaction and close the gap between [...]
  • 2003: Recipe from [[bbdb://Aadisht][Aadisht Khanna]] — 1. Set Capsicum, Minced Meat, Sweet Corn, Cheese 2. Slice off capsicum tops. 3. Scoop out capsicum innards. 4. Stuff Capsicum with (Cheese&&(Minced [...]
  • 2003: Backlog: Fish – 2003.12.15 — - Find small sections of fish. I haven’t gotten around to eating fish bellies yet, although many people swear by [...]

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging

Free sample!