summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-10-21 23:20:45 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-10-21 23:27:01 +0100
commit33263a858cd4aa228f990cfc82e64a9a7a3b3c0a (patch)
tree7dbdf36473b73641d4997f55ebfba6a4ab8cf5f5
parentad89ee9e35d8eb4326cf2e81a9cb3544a4b56523 (diff)
Remove many uses of `newline' for (insert "\n")
-rw-r--r--cider-apropos.el9
-rw-r--r--cider-classpath.el3
-rw-r--r--cider-doc.el20
-rw-r--r--cider-inspector.el4
-rw-r--r--cider-interaction.el11
-rw-r--r--cider-stacktrace.el19
-rw-r--r--cider-test.el7
7 files changed, 31 insertions, 42 deletions
diff --git a/cider-apropos.el b/cider-apropos.el
index 1d39c643..4fcacce6 100644
--- a/cider-apropos.el
+++ b/cider-apropos.el
@@ -79,11 +79,10 @@
(insert ": ")
(let ((beg (point)))
(if docs-p
- (progn (insert (cider-apropos-highlight doc query))
- (newline))
- (progn (insert doc)
- (fill-region beg (point)))))
- (newline)))))
+ (insert (cider-apropos-highlight doc query) "\n")
+ (insert doc)
+ (fill-region beg (point))))
+ (insert "\n")))))
(declare-function cider-mode "cider-mode")
diff --git a/cider-classpath.el b/cider-classpath.el
index a435a30c..d5184c2d 100644
--- a/cider-classpath.el
+++ b/cider-classpath.el
@@ -57,8 +57,7 @@
(let ((inhibit-read-only t))
(erase-buffer)
(dolist (item items)
- (insert item)
- (newline))
+ (insert item "\n"))
(goto-char (point-min)))))
(defun cider-classpath-properties (text)
diff --git a/cider-doc.el b/cider-doc.el
index e69f39d7..8669ccd7 100644
--- a/cider-doc.el
+++ b/cider-doc.el
@@ -376,8 +376,8 @@ Tables are marked to be ignored by line wrap."
(cl-flet ((emit (text &optional face)
(insert (if face
(propertize text 'font-lock-face face)
- text))
- (newline)))
+ text)
+ "\n")))
(emit (if class java-name clj-name) 'font-lock-function-name-face)
(when super
(emit (concat " Extends: " (cider-font-lock-as 'java-mode super))))
@@ -386,7 +386,7 @@ Tables are marked to be ignored by line wrap."
(dolist (iface (cdr ifaces))
(emit (concat " "(cider-font-lock-as 'java-mode iface)))))
(when (or super ifaces)
- (newline))
+ (insert "\n"))
(when (or forms args)
(emit (cider-font-lock-as-clojure (or forms args))))
(when (or special macro)
@@ -399,26 +399,22 @@ Tables are marked to be ignored by line wrap."
(cider-docview-render-java-doc (current-buffer) doc)
(emit (concat " " doc)))
(when url
- (newline)
- (insert " Please see ")
+ (insert "\n Please see ")
(insert-text-button url
'url url
'follow-link t
'action (lambda (x)
(browse-url (button-get x 'url))))
- (newline))
+ (insert "\n"))
(when javadoc
- (newline)
- (newline)
- (insert "For additional documentation, see the ")
+ (insert "\n\nFor additional documentation, see the ")
(insert-text-button "Javadoc"
'url javadoc
'follow-link t
'action (lambda (x)
(browse-url (button-get x 'url))))
- (insert ".")
- (newline))
- (newline)
+ (insert ".\n"))
+ (insert "\n")
(insert-text-button "[source]"
'follow-link t
'action (lambda (_x)
diff --git a/cider-inspector.el b/cider-inspector.el
index 2ccf2e0a..983b53ef 100644
--- a/cider-inspector.el
+++ b/cider-inspector.el
@@ -181,7 +181,7 @@ Current page will be reset to zero."
(let ((inhibit-read-only t))
(condition-case nil
(cider-irender* (car (read-from-string str)))
- (error (newline) (insert "Inspector error for: " str))))
+ (error (insert "\nInspector error for: " str))))
(goto-char (point-min))))
(defun cider-irender* (elements)
@@ -192,7 +192,7 @@ Current page will be reset to zero."
(cond ((symbolp el) (insert (symbol-name el)))
((stringp el) (insert (propertize el 'font-lock-face 'font-lock-keyword-face)))
((and (consp el) (eq (car el) :newline))
- (newline))
+ (insert "\n"))
((and (consp el) (eq (car el) :value))
(cider-irender-value (cadr el) (cl-caddr el)))
(t (message "Unrecognized inspector object: %s" el))))
diff --git a/cider-interaction.el b/cider-interaction.el
index 83dbd322..c896c1ec 100644
--- a/cider-interaction.el
+++ b/cider-interaction.el
@@ -1465,13 +1465,10 @@ the string contents of the region into a formatted string."
(t "Unknown"))))
(with-current-buffer (cider-popup-buffer cider-nrepl-session-buffer)
(read-only-mode -1)
- (insert (format "Session: %s" session-id))
- (newline)
- (insert (format "Type: %s session" session-type))
- (newline)
- (insert (format "Supported ops:"))
- (newline)
- (mapc (lambda (op) (insert (format " * %s" op)) (newline)) ops)))
+ (insert (format "Session: %s\n" session-id)
+ (format "Type: %s session\n" session-type)
+ (format "Supported ops:\n"))
+ (mapc (lambda (op) (insert (format " * %s\n" op))) ops)))
(display-buffer cider-nrepl-session-buffer))))
(defun cider-close-nrepl-session ()
diff --git a/cider-stacktrace.el b/cider-stacktrace.el
index 835c4c3a..768f18a6 100644
--- a/cider-stacktrace.el
+++ b/cider-stacktrace.el
@@ -480,8 +480,7 @@ it wraps to 0."
(insert " "))
(let ((hidden "(0 frames hidden)"))
(put-text-property 0 (length hidden) 'hidden-count t hidden)
- (insert " " hidden))
- (newline)))
+ (insert " " hidden "\n"))))
(defun cider-stacktrace-render-frame (buffer frame)
"Emit into BUFFER function call site info for the stack FRAME.
@@ -506,7 +505,7 @@ This associates text properties to enable filtering and source navigation."
(p3 (search-forward-regexp "[^/$]+")))
(put-text-property p1 p4 'font-lock-face 'cider-stacktrace-ns-face)
(put-text-property p2 p3 'font-lock-face 'cider-stacktrace-fn-face)))
- (newline)))))
+ (insert "\n")))))
(defun cider-stacktrace--create-go-to-err-button (beg message)
"Create a button that jumps to the relevant error.
@@ -542,21 +541,21 @@ MESSAGE is parsed to find line, col and buffer name to jump to."
(cider-propertize-region '(detail 0)
(insert (format "%d. " num)
(propertize note 'font-lock-face 'font-lock-comment-face) " "
- (propertize class 'font-lock-face class-face))
- (newline))
+ (propertize class 'font-lock-face class-face)
+ "\n"))
;; Detail level 1: message + ex-data
(cider-propertize-region '(detail 1)
(let ((beg (point)))
(cider-stacktrace-emit-indented
(propertize (or message "(No message)") 'font-lock-face message-face) indent t)
(cider-stacktrace--create-go-to-err-button beg message))
- (newline)
+ (insert "\n")
(when data
(cider-stacktrace-emit-indented
(cider-font-lock-as-clojure data) indent nil)))
;; Detail level 2: stacktrace
(cider-propertize-region '(detail 2)
- (newline)
+ (insert "\n")
(let ((beg (point))
(bg `(:background ,cider-stacktrace-frames-background-color)))
(dolist (frame stacktrace)
@@ -564,7 +563,7 @@ MESSAGE is parsed to find line, col and buffer name to jump to."
(overlay-put (make-overlay beg (point)) 'font-lock-face bg)))
;; Add line break between causes, even when collapsed.
(cider-propertize-region '(detail 0)
- (newline)))))))
+ (insert "\n")))))))
(defun cider-stacktrace-initialize (causes)
"Set and apply CAUSES initial visibility, filters, and cursor position."
@@ -590,13 +589,13 @@ MESSAGE is parsed to find line, col and buffer name to jump to."
(with-current-buffer buffer
(let ((inhibit-read-only t))
(erase-buffer)
- (newline)
+ (insert "\n")
;; Stacktrace filters
(cider-stacktrace-render-filters
buffer
`(("Clojure" clj) ("Java" java) ("REPL" repl)
("Tooling" tooling) ("Duplicates" dup) ("All" ,nil)))
- (newline)
+ (insert "\n")
;; Stacktrace exceptions & frames
(let ((num (length causes)))
(dolist (cause causes)
diff --git a/cider-test.el b/cider-test.el
index 35df3629..d9c365b1 100644
--- a/cider-test.el
+++ b/cider-test.el
@@ -277,8 +277,7 @@ With the actual value, the outermost '(not ...)' s-expression is removed."
(cider-insert (format "%d errors" error) 'cider-test-error-face t))
(when (zerop (+ fail error))
(cider-insert (format "%d passed" pass) 'cider-test-success-face t))
- (newline)
- (newline))))
+ (insert "\n\n"))))
(defun cider-test-render-assertion (buffer test)
"Emit into BUFFER report detail for the TEST assertion."
@@ -298,9 +297,9 @@ With the actual value, the outermost '(not ...)' s-expression is removed."
'follow-link t
'action '(lambda (_button) (cider-test-stacktrace))
'help-echo "View causes and stacktrace")
- (newline))
+ (insert "\n"))
(insert (cider-font-lock-as-clojure actual)))))
- (newline))))
+ (insert "\n"))))
(defun cider-test-render-report (buffer ns summary results)
"Emit into BUFFER the report for the NS, SUMMARY, and test RESULTS."