summaryrefslogtreecommitdiff
path: root/cider-scratch.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@tradeo.com>2014-07-31 20:42:01 +0300
committerBozhidar Batsov <bozhidar@tradeo.com>2014-07-31 20:42:01 +0300
commita8c77c27bb4b04a8fbee2feccf10c510139c84cf (patch)
treee7510d9d7d3abeb43d149743b6afb59b829e28ca /cider-scratch.el
parent8401323d656e432a0bfadbb46b65953a51401e70 (diff)
Make cider's scratch more consistent with Emacs Lisp's list-interaction-mode
Diffstat (limited to 'cider-scratch.el')
-rw-r--r--cider-scratch.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/cider-scratch.el b/cider-scratch.el
index d7e906e5..a5dfff75 100644
--- a/cider-scratch.el
+++ b/cider-scratch.el
@@ -32,7 +32,7 @@
(require 'cider-interaction)
(require 'clojure-mode)
-(defvar cider-scratch-mode-map
+(defvar cider-clojure-interaction-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map clojure-mode-map)
(define-key map (kbd "C-j") 'cider-eval-print-last-sexp)
@@ -51,13 +51,19 @@
(or (get-buffer cider-scratch-buffer-name)
(cider-create-scratch-buffer)))
+(define-derived-mode cider-clojure-interaction-mode clojure-mode "Clojure Interaction"
+ "Major mode for typing and evaluating Clojure forms.
+Like Lisp mode except that \\[cider-eval-print-last-sexp] evals the Lisp expression
+before point, and prints its value into the buffer, advancing point.
+
+\\{cider-clojure-interaction-mode-map}")
+
(defun cider-create-scratch-buffer ()
"Create a new scratch buffer."
(with-current-buffer (get-buffer-create cider-scratch-buffer-name)
- (clojure-mode)
+ (cider-clojure-interaction-mode)
(insert ";; This buffer is for Clojure experiments and evaluation.\n"
";; Press C-j to evaluate the last expression.\n\n")
- (use-local-map cider-scratch-mode-map)
(current-buffer)))
(provide 'cider-scratch)