Skip to content

Commit 33d7f42

Browse files
committed
Add a command to view the official cheatsheet
1 parent c1fb341 commit 33d7f42

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* New interactive command `clojure-mode-report-bug`.
88
* New interactive command `clojure-view-guide`.
99
* New interactive command `clojure-view-reference-section`.
10+
* New interactive command `clojure-view-cheatsheet`.
1011
* Make the refactoring keymap prefix customizable via `clojure-refactor-map-prefix`.
1112

1213
## 5.5.2 (2016-08-03)

clojure-mode.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ Out-of-the box clojure-mode understands lein, boot and gradle."
262262
"--"
263263
["View a Clojure guide" clojure-view-guide]
264264
["View a Clojure reference section" clojure-view-reference-section]
265+
["View the Clojure cheatsheet" clojure-view-cheatsheet]
265266
"--"
266267
["Report a clojure-mode bug" clojure-mode-report-bug]
267268
["Clojure-mode version" clojure-mode-display-version]))
@@ -366,6 +367,13 @@ The command will prompt you to select one of the available sections."
366367
(let ((section-url (concat clojure-reference-base-url (cdr (assoc section clojure-reference-sections)))))
367368
(browse-url section-url)))))
368369

370+
(defconst clojure-cheatsheet-url "http://clojure.org/api/cheatsheet"
371+
"The URL of the official Clojure cheatsheet.")
372+
373+
(defun clojure-view-cheatsheet ()
374+
"Open the Clojure cheatsheet in your default browser."
375+
(interactive)
376+
(browse-url clojure-cheatsheet-url))
369377

370378
(defun clojure-space-for-delimiter-p (endp delim)
371379
"Prevent paredit from inserting useless spaces.

0 commit comments

Comments
 (0)