Skip to content

Instantly share code, notes, and snippets.

@bhyde
Last active December 18, 2015 05:48
Show Gist options
  • Save bhyde/5735219 to your computer and use it in GitHub Desktop.
Save bhyde/5735219 to your computer and use it in GitHub Desktop.
Hand off slime doc search to a website, bound to C-c C-d C-s, defaults to quickdocs.org.
;;; -*- lexical-binding: t -*-
(define-slime-contrib slime-documentation-search
"Hand off a documenation search to a web site."
(:authors "Ben Hyde <bhyde@pobox.com>")
(:license "GPL")
(:on-load
(define-key slime-doc-map "\C-s" 'slime-documention-search)
(define-key slime-doc-map "s" 'slime-documention-search)))
(defvar slime-documentation-search-site-format
"http://quickdocs.org/search?q=%s"
"Format string to create url to hand off to.")
;; Some alternatives...
; (setf slime-documentation-search-site-format "http://l1sp.org/search?q=%s")
; (setf slime-documentation-search-site-format "http://quickdocs.org/search?q=%s")
; (setf slime-documentation-search-site-format "http://lispdoc.com/?q=%s&search=Full+text+search")
; (setf slime-documentation-search-site-format "http://lisp-search.acceleration.net/search?q=%s")
(require 'browse-url)
(defun slime-documention-search (name)
"Hand off search request to a web site."
(interactive (list (slime-read-symbol-name "search for: ")))
(browse-url (format slime-documentation-search-site-format
(browse-url-encode-url name))))
(provide 'slime-documentation-search)
@aarvid
Copy link

aarvid commented Aug 16, 2013

I wrote a refactoring of this for my own personal use:

https://gist.github.com/aarvid/6250845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment