summaryrefslogtreecommitdiff
path: root/cider-stacktrace.el
diff options
context:
space:
mode:
authorDmitry Matveyev <dm.matveyev@protonmail.com>2018-07-23 20:18:55 +0300
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2018-07-24 09:36:30 +0300
commit3e645d1baf5bae686a548afe8d1b6a70dc0d8ec0 (patch)
tree05a305bca74e09500faa8f66ebe5895834076ac1 /cider-stacktrace.el
parentaef642f518992975f51b40e1f347f482a26e9ae6 (diff)
[Fix #2291] Fix `cider-use-tooltips` variable to work as expected
Diffstat (limited to 'cider-stacktrace.el')
-rw-r--r--cider-stacktrace.el29
1 files changed, 20 insertions, 9 deletions
diff --git a/cider-stacktrace.el b/cider-stacktrace.el
index 5daed06c..494d5c94 100644
--- a/cider-stacktrace.el
+++ b/cider-stacktrace.el
@@ -602,6 +602,10 @@ prompt and whether to use a new window. Similar to `cider-find-var'."
;; Rendering
+(defun cider-stacktrace-tooltip (tooltip)
+ "Return TOOLTIP if `cider-use-tooltips' is set to true, nil otherwise."
+ (when cider-use-tooltips tooltip))
+
(defun cider-stacktrace-emit-indented (text &optional indent fill fontify)
"Insert TEXT, and optionally FILL and FONTIFY as clojure the entire block.
INDENT is a string to insert before each line. When INDENT is nil, first
@@ -638,8 +642,9 @@ others."
'filter (cadr filter)
'follow-link t
'action 'cider-stacktrace-filter
- 'help-echo (format "Toggle %s stack frames"
- (car filter)))
+ 'help-echo (cider-stacktrace-tooltip
+ (format "Toggle %s stack frames"
+ (car filter))))
(insert " "))
(insert "\n")
(insert " Hide: ")
@@ -648,8 +653,9 @@ others."
'filter (cadr filter)
'follow-link t
'action 'cider-stacktrace-filter
- 'help-echo (format "Toggle %s stack frames"
- (car filter)))
+ 'help-echo (cider-stacktrace-tooltip
+ (format "Toggle %s stack frames"
+ (car filter))))
(insert " "))
(let ((hidden "(0 frames hidden)"))
@@ -664,7 +670,8 @@ others."
(insert-text-button "M-x cider-report-bug"
'follow-link t
'action (lambda (_button) (cider-report-bug))
- 'help-echo "Report bug to the CIDER team.")
+ 'help-echo (cider-stacktrace-tooltip
+ "Report bug to the CIDER team."))
(insert "`.\n\n")
(insert "\
If these stacktraces are occuring frequently, consider using the
@@ -682,8 +689,9 @@ others."
'face (if suppressed
'cider-stacktrace-suppressed-button-face
'cider-stacktrace-promoted-button-face)
- 'help-echo (format "Click to %s these stacktraces."
- (if suppressed "promote" "suppress"))))
+ 'help-echo (cider-stacktrace-tooltip
+ (format "Click to %s these stacktraces."
+ (if suppressed "promote" "suppress")))))
(insert " ")))))
(defun cider-stacktrace-render-frame (buffer frame)
@@ -700,7 +708,8 @@ This associates text properties to enable filtering and source navigation."
'name name 'file file 'line line
'flags flags 'follow-link t
'action 'cider-stacktrace-navigate
- 'help-echo "View source at this location"
+ 'help-echo (cider-stacktrace-tooltip
+ "View source at this location")
'font-lock-face 'cider-stacktrace-face
'type 'cider-plain-button)
(save-excursion
@@ -726,7 +735,9 @@ This associates text properties to enable filtering and source navigation."
'file file 'line line 'column column 'follow-link t
'action (lambda (_button)
(cider-jump-to (cider-find-file file)
- (cons line column))))
+ (cons line column)))
+ 'help-echo (cider-stacktrace-tooltip
+ "Jump to the line that caused the error"))
(insert (propertize (format " at (%d:%d)" line column)
'font-lock-face message-face))))))