blob: f982685068cf1c2b3e814d97c080cdb0817f8539 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
;;; cider-interaction-mode.el --- Minor mode for REPL interactions
;; Copyright © 2012-2013 Tim King, Phil Hagelberg
;; Copyright © 2013 Bozhidar Batsov, Hugo Duncan, Steve Purcell
;;
;; Author: Tim King <kingtim@gmail.com>
;; Phil Hagelberg <technomancy@gmail.com>
;; Bozhidar Batsov <bozhidar@batsov.com>
;; Hugo Duncan <hugo@hugoduncan.org>
;; Steve Purcell <steve@sanityinc.com>
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;; This file is not part of GNU Emacs.
;;; Commentary:
;; Minor mode for REPL interactions.
;;; Code:
(require 'cider-interaction)
(defvar cider-interaction-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "M-.") 'cider-jump)
(define-key map (kbd "M-,") 'cider-jump-back)
(define-key map (kbd "M-TAB") 'complete-symbol)
(define-key map (kbd "C-M-x") 'cider-eval-expression-at-point)
(define-key map (kbd "C-c C-c") 'cider-eval-expression-at-point)
(define-key map (kbd "C-x C-e") 'cider-eval-last-expression)
(define-key map (kbd "C-c C-e") 'cider-eval-last-expression)
(define-key map (kbd "C-c C-p") 'cider-pprint-eval-last-expression)
(define-key map (kbd "C-c C-r") 'cider-eval-region)
(define-key map (kbd "C-c C-n") 'cider-eval-ns-form)
(define-key map (kbd "C-c C-m") 'cider-macroexpand-1)
(define-key map (kbd "C-c M-m") 'cider-macroexpand-all)
(define-key map (kbd "C-c M-n") 'cider-set-ns)
(define-key map (kbd "C-c C-d") 'cider-doc)
(define-key map (kbd "C-c C-s") 'cider-src)
(define-key map (kbd "C-c C-z") 'cider-switch-to-repl-buffer)
(define-key map (kbd "C-c C-Z") 'cider-switch-to-relevant-repl-buffer)
(define-key map (kbd "C-c M-o") 'cider-find-and-clear-repl-buffer)
(define-key map (kbd "C-c C-k") 'cider-load-current-buffer)
(define-key map (kbd "C-c C-l") 'cider-load-file)
(define-key map (kbd "C-c C-b") 'cider-interrupt)
(define-key map (kbd "C-c C-j") 'cider-javadoc)
(define-key map (kbd "C-c M-s") 'cider-selector)
(define-key map (kbd "C-c M-r") 'cider-rotate-connection)
(define-key map (kbd "C-c M-d") 'cider-display-current-connection-info)
(define-key map (kbd "C-c C-q") 'cider-quit)
map))
;;;###autoload
(define-minor-mode cider-interaction-mode
"Minor mode for REPL interaction from a Clojure buffer.
\\{cider-interaction-mode-map}"
nil
" cider"
cider-interaction-mode-map
(make-local-variable 'completion-at-point-functions)
(add-to-list 'completion-at-point-functions
'cider-complete-at-point))
(easy-menu-define cider-interaction-mode-menu cider-interaction-mode-map
"Menu for CIDER interaction mode"
'("CIDER"
["Jump" cider-jump]
["Jump back" cider-jump-back]
"--"
["Complete symbol" complete-symbol]
"--"
["Eval expression at point" cider-eval-expression-at-point]
["Eval last expression" cider-eval-last-expression]
["Eval last expression in popup buffer" cider-pprint-eval-last-expression]
["Eval region" cider-eval-region]
["Eval ns form" cider-eval-ns-form]
"--"
["Load current buffer" cider-load-current-buffer]
["Load file" cider-load-file]
"--"
["Macroexpand-1 last expression" cider-macroexpand-1]
["Macroexpand-all last expression" cider-macroexpand-all]
"--"
["Display documentation" cider-doc]
["Display Source" cider-src]
["Display JavaDoc" cider-javadoc]
"--"
["Set ns" cider-set-ns]
["Switch to REPL" cider-switch-to-repl-buffer]
["Switch to Relevant REPL" cider-switch-to-relevant-repl-buffer]
["Toggle REPL Pretty Print" cider-pretty-toggle]
["Clear REPL" cider-find-and-clear-repl-buffer]
["Interrupt" cider-interrupt]
["Quit" cider-quit]
["Restart" cider-restart]
"--"
["Display current nrepl connection" cider-display-current-connection-info]
["Rotate current nrepl connection" cider-rotate-connection]
"--"
["Version info" cider-version]))
(provide 'cider-interaction-mode)
;;; cider-interaction-mode.el ends here
|