summaryrefslogtreecommitdiff
path: root/cider-interaction.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2016-02-24 17:07:54 +0200
committerBozhidar Batsov <bozhidar@batsov.com>2016-02-24 17:07:54 +0200
commit6a88da56d3c6c35cf0d8c9ec5ac7f778825ca92b (patch)
tree3d1e4adbeacac293d5399c1b95350d3536cd1cc7 /cider-interaction.el
parent0b8676685f58b364a6f74b0bad4c0793091563c4 (diff)
Add a command to display the refcard
Diffstat (limited to 'cider-interaction.el')
-rw-r--r--cider-interaction.el23
1 files changed, 19 insertions, 4 deletions
diff --git a/cider-interaction.el b/cider-interaction.el
index 53ae7a7a..59cd56bf 100644
--- a/cider-interaction.el
+++ b/cider-interaction.el
@@ -1655,18 +1655,33 @@ With a prefix argument, prompt for function to run instead of -main."
(defconst cider-manual-url "https://github.com/clojure-emacs/cider/blob/%s/README.md"
"The URL to CIDER's manual.")
+(defun cider--github-version ()
+ "Convert the version to a GitHub-friendly version."
+ (if (string-match-p "-snapshot" cider-version)
+ "master"
+ (concat "v" cider-version)))
+
(defun cider-manual-url ()
"The CIDER manual's url."
- (let ((version (if (string-match-p "-snapshot" cider-version)
- "master"
- (concat "v" cider-version))))
- (format cider-manual-url version)))
+ (format cider-manual-url (cider--github-version)))
(defun cider-view-manual ()
"View the manual in your default browser."
(interactive)
(browse-url (cider-manual-url)))
+(defconst cider-refcard-url "https://github.com/clojure-emacs/cider/raw/%s/doc/cider-refcard.pdf"
+ "The URL to CIDER's refcard.")
+
+(defun cider-refcard-url ()
+ "The CIDER manual's url."
+ (format cider-refcard-url (cider--github-version)))
+
+(defun cider-view-refcard ()
+ "View the refcard in your default browser."
+ (interactive)
+ (browse-url (cider-refcard-url)))
+
(defconst cider-report-bug-url "https://github.com/clojure-emacs/cider/issues/new"
"The URL to report a CIDER issue.")