Created
June 6, 2013 15:15
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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