Lispdoc - Online Lisp Documentation Search
Tuesday, May 15, 2007
William Bland just keeps on improving lispdoc, his online Lisp documentation search utility. The utility has a lot of neat features:
- A search brings up links to both the CLHS and key CL books and also provides a usage example.
- Content is provided from Practical Common Lisp (PCL), Successful Lisp, On Lisp, the HyperSpec, and the docstrings of SBCL (and, soon, from CLtL2 as well).
- Example code is from Practical Common Lisp, PAIP, ANSI Common Lisp, and a bunch of ASDF-installable libraries.
- There is a Firefox plugin that lets you do searches easily in Firefox.
- There is an htmlize utility that lets you input a snippet of lisp code and get a colorized HTML representation of that code (convenient for quickly getting something that you can put in a web page).
- It provides documentation lookup for a lot of commonly-used CL libraries.
- You can input search terms in a manner similar to SLIME's "fuzzy-complete" (e.g. - if you enter "m-v-b" in the search dialog, it returns the documentation for "multiple-value-bind").
(defun lispdoc ()
"Searches lispdoc.com for SYMBOL, which is by default the symbol
currently under the curser"
(interactive)
(let* ((word-at-point (word-at-point))
(symbol-at-point (symbol-at-point))
(default (symbol-name symbol-at-point))
(inp (read-from-minibuffer
(if (or word-at-point symbol-at-point)
(concat "Symbol (default " default "): ")
"Symbol (no default): "))))
(if (and (string= inp "") (not word-at-point) (not
symbol-at-point))
(message "you didn't enter a symbol!")
(let ((search-type (read-from-minibuffer
"full-text (f) or basic (b) search (default b)? ")))
(browse-url (concat "http://lispdoc.com?q="
(if (string= inp "")
default
inp)
"&search="
(if (string-equal search-type "f")
"full+text+search"
"basic+search")))))))
You can just access it with "M-x lispdoc" and it defaults to the
documentation for the symbol that the cursor is positioned on; however, you might find
it more convenient to bind it to something:(define-key lisp-mode-map (kbd "C-c l") 'lispdoc)Since lispdoc also brings up an example of usage and links to books that contain more examples, it is a really convenient tool when you're either learning lisp or exploring functionality that you may not use on a regular basis.

