Skip to content

Commit 26fa6cf

Browse files
committed
Fontify Grimoire code blocks if possible
Fixes #1959.
1 parent 7ffc207 commit 26fa6cf

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
@@ -4,6 +4,7 @@
44

55
### New Features
66

7+
* [#2007](https://github.com/clojure-emacs/cider/pull/2007): Fontify code blocks from `cider-grimoire` if possible.
78
* [#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.
89
* Add new function `cider-load-all-files`, along with menu bar update.
910
* Add new customization variable `cider-special-mode-truncate-lines`.

cider-grimoire.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535

3636
(require 'url-vars)
3737

38+
(declare-function markdown-mode "markdown-mode.el")
39+
(declare-function markdown-toggle-fontify-code-blocks-natively "markdown-mode.el")
40+
3841
(defconst cider-grimoire-url "http://conj.io/")
3942

4043
(defconst cider-grimoire-buffer "*cider-grimoire*")
@@ -78,6 +81,11 @@ opposite of what that option dictates."
7881
(with-current-buffer (cider-popup-buffer cider-grimoire-buffer t)
7982
(read-only-mode -1)
8083
(insert content)
84+
(when (require 'markdown-mode nil 'noerror)
85+
(markdown-mode)
86+
(cider-popup-buffer-mode 1)
87+
(when (fboundp 'markdown-toggle-fontify-code-blocks-natively)
88+
(markdown-toggle-fontify-code-blocks-natively 1)))
8189
(read-only-mode +1)
8290
(goto-char (point-min))
8391
(current-buffer)))

0 commit comments

Comments
 (0)