/[slime]/slime/contrib/slime-hyperdoc.el
ViewVC logotype

Contents of /slime/contrib/slime-hyperdoc.el

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Fri May 28 19:13:17 2010 UTC (3 years, 10 months ago) by heller
Branch: MAIN
CVS Tags: SLIME-2-3, FAIRLY-STABLE, byte-stream, SLIME-2-2, HEAD
Changes since 1.3: +2 -0 lines
Call provide at the end of the file.

* slime-asdf.el slime-banner.el slime-clipboard.el
slime-compiler-notes-tree.el slime-enclosing-context.el
slime-highlight-edits.el slime-hyperdoc.el slime-indentation.el
slime-mdot-fu.el slime-motd.el slime-mrepl.el
slime-presentation-streams.el slime-sbcl-exts.el slime-snapshot.el
slime-sprof.el slime-tramp.el slime-typeout-frame.el
slime-xref-browser.el:
1 trittweiler 1.2 (defvar slime-old-documentation-lookup-function
2     slime-documentation-lookup-function)
3    
4     (define-slime-contrib slime-hyperdoc
5     "Extensible C-c C-d h."
6 trittweiler 1.3 (:authors "Tobias C Rittweiler <tcr@freebits.de>")
7 trittweiler 1.2 (:license "GPL")
8     (:slime-dependencies url-http browse-url)
9     (:swank-dependencies swank-hyperdoc)
10     (:on-load
11     (setq slime-documentation-lookup-function 'slime-hyperdoc-lookup))
12     (:on-unload
13     (setq slime-documentation-lookup-function
14     slime-old-documentation-lookup-function)))
15 trittweiler 1.1
16     ;;; TODO: `url-http-file-exists-p' is slow, make it optional behaviour.
17    
18     (defun slime-hyperdoc-lookup-rpc (symbol-name)
19     (slime-eval-async `(swank:hyperdoc ,symbol-name)
20     (lexical-let ((symbol-name symbol-name))
21     #'(lambda (result)
22     (slime-log-event result)
23     (loop with foundp = nil
24     for (doc-type . url) in result do
25     (when (and url (stringp url)
26     (let ((url-show-status nil))
27     (url-http-file-exists-p url)))
28     (message "Visiting documentation for %s `%s'..."
29     (substring (symbol-name doc-type) 1)
30     symbol-name)
31     (browse-url url)
32     (setq foundp t))
33     finally
34     (unless foundp
35     (error "Could not find documentation for `%s'."
36     symbol-name)))))))
37    
38     (defun slime-hyperdoc-lookup (symbol-name)
39     (interactive (list (slime-read-symbol-name "Symbol: ")))
40     (if (memq :hyperdoc (slime-lisp-features))
41     (slime-hyperdoc-lookup-rpc symbol-name)
42     (slime-hyperspec-lookup symbol-name)))
43 heller 1.4
44     (provide 'slime-hyperdoc)

  ViewVC Help
Powered by ViewVC 1.1.5