Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### New Features

* [#2007](https://github.com/clojure-emacs/cider/pull/2007): Fontify code blocks from `cider-grimoire` if possible.
* [#1990](https://github.com/clojure-emacs/cider/issues/1990): Add new customation variable `cider-save-files-on-cider-refresh` to allow auto-saving buffers when `cider-refresh` is called.
* Add new function `cider-load-all-files`, along with menu bar update.
* Add new customization variable `cider-special-mode-truncate-lines`.
Expand Down
3 changes: 2 additions & 1 deletion Cask
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
(files "*.el" (:exclude ".dir-locals.el"))

(development
(depends-on "buttercup"))
(depends-on "buttercup")
(depends-on "markdown-mode"))
8 changes: 8 additions & 0 deletions cider-grimoire.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@

(require 'url-vars)

(declare-function markdown-mode "markdown-mode.el")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also have to declare markdown-toggle-fontify-code-blocks-natively.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing - for this work markdown-mode should actually be present. You can just add markdown-mode to the dev dependencies in Cask.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

(declare-function markdown-toggle-fontify-code-blocks-natively "markdown-mode.el")

(defconst cider-grimoire-url "http://conj.io/")

(defconst cider-grimoire-buffer "*cider-grimoire*")
Expand Down Expand Up @@ -78,6 +81,11 @@ opposite of what that option dictates."
(with-current-buffer (cider-popup-buffer cider-grimoire-buffer t)
(read-only-mode -1)
(insert content)
(when (require 'markdown-mode nil 'noerror)
(markdown-mode)
(cider-popup-buffer-mode 1)
(when (fboundp 'markdown-toggle-fontify-code-blocks-natively)
(markdown-toggle-fontify-code-blocks-natively 1)))
(read-only-mode +1)
(goto-char (point-min))
(current-buffer)))
Expand Down