jschaf / esup

ESUP - Emacs Start Up Profiler
398 stars 22 forks source link

There is a empty line at the beginning when there is no error #49

Closed xuchunyang closed 6 years ago

xuchunyang commented 6 years ago

When M-x esup is finished, there is no error detected. In buffer *esup*, the first line is empty and point is at the beginning, n (esup-next-result) doesn't work here and says

funcall-interactively: Beginning of buffer

The following fix the issue by not insert the empty line when there is no error.

diff -u --label /Users/xcy/.emacs.d/elpa-27.0.50/esup-20170923.1328/esup.el --label \#\<buffer\ esup.el\> /Users/xcy/.emacs.d/elpa-27.0.50/esup-20170923.1328/esup.el /var/folders/7f/s191h4q97p90374yw15ssrs00000gn/T/buffer-content-S2prZQ
--- /Users/xcy/.emacs.d/elpa-27.0.50/esup-20170923.1328/esup.el
+++ #<buffer esup.el>
@@ -462,7 +462,8 @@
     (with-current-buffer (esup-buffer)
       (erase-buffer)
       (esup-update-percentages results)
-      (insert (esup-render-errors esup-errors) result-break)
+      (when esup-errors
+        (insert (esup-render-errors esup-errors) result-break))
       (insert (esup-render-summary results) result-break)
       (cl-loop for result in results
                do (insert (render result) result-break))

Diff finished.  Sat Dec 30 14:45:58 2017
jschaf commented 6 years ago

Thanks for the patch. Just fixed it.