From 779837f3d87f2c0b7bc597b64af201dcd9dc252c Mon Sep 17 00:00:00 2001 From: Vitalie Spinu Date: Fri, 25 Aug 2017 21:39:45 +0200 Subject: Add FILL and FONTIFY arguments to cider-stacktrace-emit-indented and enhance INDENT argument --- cider-stacktrace.el | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'cider-stacktrace.el') 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)) -- cgit v1.2.3