Skip to content

Instantly share code, notes, and snippets.

@bhyde
Created June 6, 2013 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhyde/5722301 to your computer and use it in GitHub Desktop.
Save bhyde/5722301 to your computer and use it in GitHub Desktop.
An alternate binding for slime's slime-documentation-lookup-function. Uses l1sp.org if invoked with a prefix arg.
(defun slime-hyperspec-plus-l1sp-lookup (symbol-name)
"The usual hyperspec lookup, but with a prefix arg uses l1sp.org instead"
(interactive (list (let* ((symbol-at-point (slime-symbol-at-point))
(stripped-symbol
(and symbol-at-point
(downcase
(common-lisp-hyperspec-strip-cl-package
symbol-at-point)))))
(if (and stripped-symbol
(or current-prefix-arg
(intern-soft stripped-symbol
common-lisp-hyperspec-symbols)))
stripped-symbol
(completing-read
"Look up symbol in Common Lisp HyperSpec: "
common-lisp-hyperspec-symbols #'boundp
t stripped-symbol
'common-lisp-hyperspec-history)))))
(if current-prefix-arg
(browse-url (format "http://l1sp.org/search?q=%s" symbol-name))
(slime-hyperspec-lookup symbol-name)))
(setf slime-documentation-lookup-function 'slime-hyperspec-plus-l1sp-lookup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment