Skip to content

Commit adfd31a

Browse files
committed
Add an interactive command to toggle Clojure font-locking in the REPL
1 parent fd6d514 commit adfd31a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* [#2800](https://github.com/clojure-emacs/cider/pull/2800): Add support for force-out debugger command.
1313
* Add support for nREPL 0.8 `completions` op. It's used if `cider-nrepl` is not available.
1414
* Add `browser` to the list of supported ClojureScript REPL types.
15+
* Add an interactive command to toggle Clojure font-locking in the REPL (`cider-repl-toggle-clojure-font-lock`).
1516

1617
### Changes
1718

cider-repl.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,13 @@ text property `cider-old-input'."
10121012
(message "Content-type support in REPL %s."
10131013
(if cider-repl-use-content-types "enabled" "disabled")))
10141014

1015+
(defun cider-repl-toggle-clojure-font-lock ()
1016+
"Toggle pretty-printing in the REPL."
1017+
(interactive)
1018+
(setq cider-repl-use-clojure-font-lock (not cider-repl-use-clojure-font-lock))
1019+
(message "Clojure font-locking in REPL %s."
1020+
(if cider-repl-use-clojure-font-lock "enabled" "disabled")))
1021+
10151022
(defun cider-repl-switch-to-other ()
10161023
"Switch between the Clojure and ClojureScript REPLs for the current project."
10171024
(interactive)
@@ -1487,6 +1494,7 @@ constructs."
14871494
(cider-repl-add-shortcut "clear-help-banner" #'cider-repl-clear-help-banner)
14881495
(cider-repl-add-shortcut "ns" #'cider-repl-set-ns)
14891496
(cider-repl-add-shortcut "toggle-pretty" #'cider-repl-toggle-pretty-printing)
1497+
(cider-repl-add-shortcut "toggle-font-lock" #'cider-repl-toggle-clojure-font-lock)
14901498
(cider-repl-add-shortcut "browse-ns" (lambda () (interactive) (cider-browse-ns (cider-current-ns))))
14911499
(cider-repl-add-shortcut "classpath" #'cider-classpath)
14921500
(cider-repl-add-shortcut "history" #'cider-repl-history)
@@ -1656,6 +1664,7 @@ constructs."
16561664
"--"
16571665
["Set REPL ns" cider-repl-set-ns]
16581666
["Toggle pretty printing" cider-repl-toggle-pretty-printing]
1667+
["Toggle Clojure font-lock" cider-repl-toggle-clojure-font-lock]
16591668
["Require REPL utils" cider-repl-require-repl-utils]
16601669
"--"
16611670
["Browse classpath" cider-classpath]

0 commit comments

Comments
 (0)