summaryrefslogtreecommitdiff
path: root/cider-doc.el
diff options
context:
space:
mode:
Diffstat (limited to 'cider-doc.el')
-rw-r--r--cider-doc.el19
1 files changed, 15 insertions, 4 deletions
diff --git a/cider-doc.el b/cider-doc.el
index 52a953a0..3c867ea0 100644
--- a/cider-doc.el
+++ b/cider-doc.el
@@ -1,6 +1,6 @@
;;; cider-doc.el --- CIDER documentation functionality -*- lexical-binding: t -*-
-;; Copyright © 2014-2017 Bozhidar Batsov, Jeff Valk and CIDER contributors
+;; Copyright © 2014-2018 Bozhidar Batsov, Jeff Valk and CIDER contributors
;; Author: Jeff Valk <jv@jeffvalk.com>
@@ -36,6 +36,7 @@
(require 'org-table)
(require 'button)
(require 'easymenu)
+(require 'cider-browse-spec)
;;; Variables
@@ -46,6 +47,11 @@
:group 'cider)
+(declare-function cider-apropos "cider-apropos")
+(declare-function cider-apropos-select "cider-apropos")
+(declare-function cider-apropos-documentation "cider-apropos")
+(declare-function cider-apropos-documentation-select "cider-apropos")
+
(defvar cider-doc-map
(let (cider-doc-map)
(define-prefix-command 'cider-doc-map)
@@ -461,9 +467,14 @@ Tables are marked to be ignored by line wrap."
(insert ".\n"))
(insert "\n")
(when spec
- (emit "Spec: " 'font-lock-function-name-face)
- (mapc (lambda (s) (insert s "\n")) spec)
- (insert "\n"))
+ (emit "Spec:" 'font-lock-function-name-face)
+ (insert (cider-browse-spec--pprint-indented spec))
+ (insert "\n\n")
+ (insert-text-button "Browse spec"
+ 'follow-link t
+ 'action (lambda (_)
+ (cider-browse-spec (format "%s/%s" ns name))))
+ (insert "\n\n"))
(if cider-docview-file
(progn
(insert (propertize (if class java-name clj-name)