summaryrefslogtreecommitdiff
path: root/cider-stacktrace.el
diff options
context:
space:
mode:
authorVitalie Spinu <spinuvit@gmail.com>2017-08-25 21:39:45 +0200
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2017-10-01 10:12:27 +0200
commit779837f3d87f2c0b7bc597b64af201dcd9dc252c (patch)
tree750ca03db1463323ab73145e85773191f41ad52b /cider-stacktrace.el
parent88c6487d7a1433f34074651b2461279712e0da19 (diff)
Add FILL and FONTIFY arguments to cider-stacktrace-emit-indented
and enhance INDENT argument
Diffstat (limited to 'cider-stacktrace.el')
-rw-r--r--cider-stacktrace.el17
1 files changed, 14 insertions, 3 deletions
diff --git a/cider-stacktrace.el b/cider-stacktrace.el
index b62a53d5..912a53ef 100644
--- a/cider-stacktrace.el
+++ b/cider-stacktrace.el
@@ -596,11 +596,22 @@ prompt and whether to use a new window. Similar to `cider-find-var'."
;; Rendering
-(defun cider-stacktrace-emit-indented (text indent &optional fill)
- "Insert TEXT, and INDENT and optionally FILL the entire block."
- (let ((beg (point)))
+(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
+line is not indented and INDENT defaults to a white-spaced string with
+length given by `current-column'."
+ (let ((text (if fontify
+ (cider-font-lock-as-clojure text)
+ text))
+ (do-first indent)
+ (indent (or indent (make-string (current-column) ? )))
+ (beg (point)))
(insert text)
(goto-char beg)
+ (when do-first
+ (insert indent))
+ (forward-line)
(while (not (eobp))
(insert indent)
(forward-line))