Last active
December 18, 2015 05:48
-
-
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.
This file contains 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
;;; -*- 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wrote a refactoring of this for my own personal use:
https://gist.github.com/aarvid/6250845