Skip to content

Commit

Permalink
Fontify Grimoire code blocks if possible
Browse files Browse the repository at this point in the history
Fixes #1959.
  • Loading branch information
xiongtx committed Jun 11, 2017
1 parent 7ffc207 commit 82b85b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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
7 changes: 7 additions & 0 deletions cider-grimoire.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

(require 'url-vars)

(declare-function markdown-mode "markdown-mode.el")

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

(defconst cider-grimoire-buffer "*cider-grimoire*")
Expand Down Expand Up @@ -78,6 +80,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

0 comments on commit 82b85b1

Please sign in to comment.