summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@tradeo.com>2013-10-16 16:20:05 +0300
committerBozhidar Batsov <bozhidar@tradeo.com>2013-10-16 16:20:05 +0300
commite2894f975156c8ed8898014bc67bf2082670a4b8 (patch)
treeace9e8233446b5b5e2bdfa0242f9e01303689bae
parent8a5111fb7ae5e53be1f13a9f56a6c005de7a91ce (diff)
Rename some REPL variables
-rw-r--r--README.md6
-rw-r--r--nrepl-interaction.el4
-rw-r--r--nrepl-repl.el63
3 files changed, 36 insertions, 37 deletions
diff --git a/README.md b/README.md
index 57c7d8f4..39dc2865 100644
--- a/README.md
+++ b/README.md
@@ -116,14 +116,14 @@ because you're used to completing with <kbd>M-TAB</kbd>) use the
following snippet:
```el
-(setq nrepl-tab-command 'indent-for-tab-command)
+(setq nrepl-repl-tab-command 'indent-for-tab-command)
```
* Prevent the auto-display of the REPL buffer in a separate window
after connection is established:
```el
-(setq nrepl-pop-to-repl-buffer-on-connect nil
+(setq nrepl-repl-pop-to-buffer-on-connect nil
```
* Stop the error buffer from popping up while working in buffers other
@@ -136,7 +136,7 @@ than the REPL:
* Enable error buffer popping also in the REPL:
```el
-(setq nrepl-popup-stacktraces-in-repl t)
+(setq nrepl-repl-popup-stacktraces t)
```
* To auto-select the error buffer when it's displayed:
diff --git a/nrepl-interaction.el b/nrepl-interaction.el
index c9eaf5b1..38b77798 100644
--- a/nrepl-interaction.el
+++ b/nrepl-interaction.el
@@ -55,7 +55,7 @@
(defcustom nrepl-popup-stacktraces t
"Non-nil means pop-up error stacktraces for evaluation errors.
Nil means show only an error message in the minibuffer. See also
-`nrepl-popup-stacktraces-in-repl', which overrides this setting
+`nrepl-repl-popup-stacktraces', which overrides this setting
for REPL buffers."
:type 'boolean
:group 'nrepl)
@@ -628,7 +628,7 @@ They exist for compatibility with `next-error'."
"Make an error handler for BUFFER, EX, ROOT-EX and SESSION."
;; TODO: use ex and root-ex as fallback values to display when pst/print-stack-trace-not-found
(let ((replp (equal 'nrepl-repl-mode (buffer-local-value 'major-mode buffer))))
- (if (or (and nrepl-popup-stacktraces-in-repl replp)
+ (if (or (and nrepl-repl-popup-stacktraces replp)
(and nrepl-popup-stacktraces (not replp)))
(lexical-let ((nrepl-popup-on-error nrepl-popup-on-error))
(with-current-buffer buffer
diff --git a/nrepl-repl.el b/nrepl-repl.el
index f389eb3e..9657f3bd 100644
--- a/nrepl-repl.el
+++ b/nrepl-repl.el
@@ -34,60 +34,59 @@
(require 'nrepl-interaction)
(require 'nrepl-version)
-(defface nrepl-prompt-face
+(defgroup nrepl-repl nil
+ "Interaction with the REPL."
+ :prefix "nrepl-repl-"
+ :group 'nrepl)
+
+(defface nrepl-repl-prompt-face
'((t (:inherit font-lock-keyword-face)))
"Face for the prompt in the REPL buffer."
- :group 'nrepl)
+ :group 'nrepl-repl)
-(defface nrepl-output-face
+(defface nrepl-repl-output-face
'((t (:inherit font-lock-string-face)))
"Face for output in the REPL buffer."
- :group 'nrepl)
-
-(defface nrepl-error-face
- '((t (:inherit font-lock-string-face)))
- "Face for errors in the REPL buffer."
- :group 'nrepl)
+ :group 'nrepl-repl)
-(defface nrepl-input-face
+(defface nrepl-repl-input-face
'((t (:bold t)))
"Face for previous input in the REPL buffer."
- :group 'nrepl)
+ :group 'nrepl-repl)
-(defface nrepl-result-face
+(defface nrepl-repl-result-face
'((t ()))
"Face for the result of an evaluation in the REPL buffer."
- :group 'nrepl)
+ :group 'nrepl-repl)
-(defcustom nrepl-popup-stacktraces-in-repl nil
+(defcustom nrepl-repl-popup-stacktraces nil
"Non-nil means pop-up error stacktraces in the REPL buffer.
Nil means show only an error message in the minibuffer. This variable
overrides `nrepl-popup-stacktraces' in REPL buffers."
:type 'boolean
- :group 'nrepl)
+ :group 'nrepl-repl)
-(defcustom nrepl-pop-to-repl-buffer-on-connect t
+(defcustom nrepl-repl-pop-to-buffer-on-connect t
"Controls whether to pop to the REPL buffer on connect.
When set to nil the buffer will only be created."
:type 'boolean
- :group 'nrepl)
+ :group 'nrepl-repl)
-(defcustom nrepl-use-pretty-printing nil
+(defcustom nrepl-repl-use-pretty-printing nil
"Control whether the results in REPL are pretty-printed or not.
The `nrepl-toggle-pretty-printing' command can be used to interactively
change the setting's value."
:type 'boolean
- :group 'nrepl)
+ :group 'nrepl-repl)
-(defcustom nrepl-tab-command 'nrepl-indent-and-complete-symbol
+(defcustom nrepl-repl-tab-command 'nrepl-indent-and-complete-symbol
"Select the command to be invoked by the TAB key.
The default option is `nrepl-indent-and-complete-symbol'. If
you'd like to use the default Emacs behavior use
`indent-for-tab-command'."
:type 'symbol
- :group 'nrepl)
-
+ :group 'nrepl-repl)
;;;; REPL buffer local variables
(defvar nrepl-input-start-mark)
@@ -123,7 +122,7 @@ joined together.")
(defun nrepl-tab ()
"Invoked on TAB keystrokes in `nrepl-repl-mode' buffers."
(interactive)
- (funcall nrepl-tab-command))
+ (funcall nrepl-repl-tab-command))
(defun nrepl-reset-markers ()
"Reset all REPL markers."
@@ -156,7 +155,7 @@ positions before and after executing BODY."
(nrepl-init-repl-buffer
process
(let ((buffer-name (nrepl-repl-buffer-name)))
- (if nrepl-pop-to-repl-buffer-on-connect
+ (if nrepl-repl-pop-to-buffer-on-connect
(pop-to-buffer buffer-name)
(generate-new-buffer buffer-name))
buffer-name)))
@@ -330,7 +329,7 @@ If BACKWARD is non-nil search backward."
(defun nrepl-mark-output-end ()
"Marke the output end."
(add-text-properties nrepl-output-start nrepl-output-end
- '(face nrepl-output-face
+ '(face nrepl-repl-output-face
rear-nonsticky (face))))
;;;;; History
@@ -612,7 +611,7 @@ Return the position of the prompt beginning."
(let ((prompt-start (point))
(prompt (format "%s> " namespace)))
(nrepl-propertize-region
- '(face nrepl-prompt-face read-only t intangible t
+ '(face nrepl-repl-prompt-face read-only t intangible t
nrepl-prompt t
rear-nonsticky (nrepl-prompt read-only face intangible))
(insert-before-markers prompt))
@@ -628,7 +627,7 @@ If BOL is non-nil insert at the beginning of line."
(nrepl-save-marker nrepl-output-end
(goto-char position)
(when (and bol (not (bolp))) (insert-before-markers "\n"))
- (nrepl-propertize-region `(face nrepl-output-face
+ (nrepl-propertize-region `(face nrepl-repl-output-face
rear-nonsticky (face))
(insert-before-markers string)
(when (and (= (point) nrepl-prompt-start-mark)
@@ -669,7 +668,7 @@ If BOL is non-nil insert at the beginning of the line."
(nrepl-save-marker nrepl-output-end
(goto-char nrepl-input-start-mark)
(when (and bol (not (bolp))) (insert-before-markers "\n"))
- (nrepl-propertize-region `(face nrepl-result-face
+ (nrepl-propertize-region `(face nrepl-repl-result-face
rear-nonsticky (face))
(insert-before-markers string)))))
(nrepl-show-maximum-output)))
@@ -742,9 +741,9 @@ If NEWLINE is true then add a newline at the end of the input."
;; These properties are on an overlay so that they won't be taken
;; by kill/yank.
(overlay-put overlay 'read-only t)
- (overlay-put overlay 'face 'nrepl-input-face)))
+ (overlay-put overlay 'face 'nrepl-repl-input-face)))
(let* ((input (nrepl-current-input))
- (form (if (and (not (string-match "\\`[ \t\r\n]*\\'" input)) nrepl-use-pretty-printing)
+ (form (if (and (not (string-match "\\`[ \t\r\n]*\\'" input)) nrepl-repl-use-pretty-printing)
(format "(clojure.pprint/pprint %s)" input) input)))
(goto-char (point-max))
(nrepl-mark-input-start)
@@ -812,9 +811,9 @@ text property `nrepl-old-input'."
(defun nrepl-toggle-pretty-printing ()
"Toggle pretty-printing in the REPL."
(interactive)
- (setq nrepl-use-pretty-printing (not nrepl-use-pretty-printing))
+ (setq nrepl-repl-use-pretty-printing (not nrepl-repl-use-pretty-printing))
(message "Pretty printing in nREPL %s."
- (if nrepl-use-pretty-printing "enabled" "disabled")))
+ (if nrepl-repl-use-pretty-printing "enabled" "disabled")))
(defvar nrepl-clear-buffer-hook)