forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-common-lisp.el
43 lines (38 loc) · 1.72 KB
/
init-common-lisp.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
;; See http://bc.tech.coop/blog/070927.html
(add-auto-mode 'lisp-mode "\\.cl\\'")
(add-hook 'lisp-mode-hook (lambda ()
(unless (featurep 'slime)
(require 'slime)
(normal-mode))))
(eval-after-load 'slime
'(progn
(add-to-list 'slime-lisp-implementations
'(sbcl ("sbcl") :coding-system utf-8-unix))
(add-to-list 'slime-lisp-implementations
'(cmucl ("lisp") :coding-system iso-latin-1-unix))))
;; From http://bc.tech.coop/blog/070515.html
(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")))))))
(define-key lisp-mode-map (kbd "C-c l") 'lispdoc)
(provide 'init-common-lisp)