summaryrefslogtreecommitdiff
path: root/nrepl.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2013-02-09 23:00:05 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-02-09 23:00:05 +0100
commit78da3e9514ebf7325a52a13d8e81aff47575ae81 (patch)
tree85446261b0dd6ebc8bc9f1174acc42a1350f20c1 /nrepl.el
parentbd6a160e6a814f88341102a65dc8ae35b1617aec (diff)
New customization variable: nrepl-popup-stacktraces-in-repl
We use nrepl-popup-stacktraces only non-REPL buffers, and introduce a specific flag for the latter.
Diffstat (limited to 'nrepl.el')
-rw-r--r--nrepl.el21
1 files changed, 15 insertions, 6 deletions
diff --git a/nrepl.el b/nrepl.el
index a478cd75..8f0a3490 100644
--- a/nrepl.el
+++ b/nrepl.el
@@ -194,9 +194,17 @@ joined together.")
"Available nREPL server ops (from describe).")
(defcustom nrepl-popup-stacktraces t
- "Non-nil means pop-up error stacktraces.
-Nil means show only an error message in the minibuffer;
-useful when in REPL or you don't care about the stacktraces."
+ "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
+for REPL buffers."
+ :type 'boolean
+ :group 'nrepl)
+
+(defcustom nrepl-popup-stacktraces-in-repl 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)
@@ -728,8 +736,9 @@ Removes any leading slash if on Windows. Uses `find-file'."
(defun nrepl-default-err-handler (buffer ex root-ex session)
;; TODO: use ex and root-ex as fallback values to display when pst/print-stack-trace-not-found
- (if (or nrepl-popup-stacktraces
- (not (member (buffer-local-value 'major-mode buffer) '(nrepl-mode clojure-mode))))
+ (let ((replp (equal 'nrepl-mode (buffer-local-value 'major-mode buffer))))
+ (if (or (and nrepl-popup-stacktraces-in-repl replp)
+ (and nrepl-popup-stacktraces (not replp)))
(progn
(with-current-buffer buffer
(nrepl-send-string "(if-let [pst+ (clojure.core/resolve 'clj-stacktrace.repl/pst+)]
@@ -743,7 +752,7 @@ Removes any leading slash if on Windows. Uses `find-file'."
(nrepl-highlight-compilation-error-line buffer))
;; TODO: maybe put the stacktrace in a tmp buffer somewhere that the user
;; can pull up with a hotkey only when interested in seeing it?
- ))
+ )))
(defun nrepl-highlight-compilation-error-line (buffer)
"Highlight compilation error line in BUFFER."