A dictionary in Emacs

I explained my need for an English dictionary when I wrote about my own helm-wordnut. To sum it up: my English is good but it’s not David Foster Wallace good, so a dictionary is mandatory.

Last October Torsten Hilbrich added dictionary-el to Emacs master so, in my quest for a Vanilla Emacs appreciation, I decided to give it a try. According to the first line of dictionary.el this library is a client for RFC 2229 dictionary servers, which as the RFC says, rely on the DICT protocol:

The DICT protocol is designed to provide access to multiple databases. Word definitions can be requested, the word index can be searched (using an easily extended set of algorithms), information about the server can be provided (e.g., which index search strategies are supported, or which databases are available), and information about a database can be provided (e.g., copyright, citation, or distribution information). Further, the DICT protocol has hooks that can be used to restrict access to some or all of the databases.

This is very useful because it means that one can collect different definitions from various dictionary and possibly compare synonyms.

This is how I set up dictionary.el in my init.el:

(global-set-key (kbd "C-c d") #'dictionary-search)
(setq dictionary-server "dict.org")

dictionary-search cleverly picks up the word at point which means that when I hit C-c d RET on a word I don’t know I get a *Dictionary* buffer with entries coming from:

  • The Collaborative International Dictionary of English
  • WordNet
  • Moby Thesaurus II

There is much more in dictionary.el, though. I counted 17 defcustoms for starters, so go on and tweak it like any Emacs hacker would do. As for me, the couple of ELisp lines above are adequate.