aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2007-12-31 23:23:39 +0000
committerNick Roberts2007-12-31 23:23:39 +0000
commit1fb7205b0189dc6a7a51566d9bb8a18caad4598b (patch)
tree61b77ab248a74792d09e4aadbeb03aa91eb2b16a
parentad16855cbe2a3a25817120e6772e71340988640b (diff)
downloademacs-1fb7205b0189dc6a7a51566d9bb8a18caad4598b.tar.gz
emacs-1fb7205b0189dc6a7a51566d9bb8a18caad4598b.zip
(elp-results): Use header-line-format for header. Move point to the start of
the buffer.
-rw-r--r--lisp/emacs-lisp/elp.el50
1 files changed, 35 insertions, 15 deletions
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index c4ba3e4ca9c..0ef9cc89ba4 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -596,20 +596,39 @@ displayed."
596 symname))))) 596 symname)))))
597 elp-all-instrumented-list)) 597 elp-all-instrumented-list))
598 ) ; end let* 598 ) ; end let*
599 (insert title) 599 ;; If printing to stdout, insert the header so it will print.
600 (if (> longest titlelen) 600 ;; Otherwise use header-line-format.
601 (progn 601 (setq elp-field-len (max titlelen longest))
602 (insert-char 32 (- longest titlelen)) 602 (if (or elp-use-standard-output noninteractive)
603 (setq elp-field-len longest))) 603 (progn
604 (insert " " cc-header " " et-header " " at-header "\n") 604 (insert title)
605 (insert-char ?= elp-field-len) 605 (if (> longest titlelen)
606 (insert " ") 606 (progn
607 (insert-char ?= elp-cc-len) 607 (insert-char 32 (- longest titlelen))))
608 (insert " ") 608 (insert " " cc-header " " et-header " " at-header "\n")
609 (insert-char ?= elp-et-len) 609 (insert-char ?= elp-field-len)
610 (insert " ") 610 (insert " ")
611 (insert-char ?= elp-at-len) 611 (insert-char ?= elp-cc-len)
612 (insert "\n") 612 (insert " ")
613 (insert-char ?= elp-et-len)
614 (insert " ")
615 (insert-char ?= elp-at-len)
616 (insert "\n"))
617 (let ((column 0))
618 (setq header-line-format
619 (mapconcat
620 (lambda (title)
621 (prog1
622 (concat
623 (propertize " "
624 'display (list 'space :align-to column)
625 'face 'fixed-pitch)
626 title)
627 (setq column (+ column 1
628 (if (= column 0)
629 elp-field-len
630 (length title))))))
631 (list title cc-header et-header at-header) ""))))
613 ;; if sorting is enabled, then sort the results list. in either 632 ;; if sorting is enabled, then sort the results list. in either
614 ;; case, call elp-output-result to output the result in the 633 ;; case, call elp-output-result to output the result in the
615 ;; buffer 634 ;; buffer
@@ -621,7 +640,8 @@ displayed."
621 (pop-to-buffer resultsbuf) 640 (pop-to-buffer resultsbuf)
622 ;; copy results to standard-output? 641 ;; copy results to standard-output?
623 (if (or elp-use-standard-output noninteractive) 642 (if (or elp-use-standard-output noninteractive)
624 (princ (buffer-substring (point-min) (point-max)))) 643 (princ (buffer-substring (point-min) (point-max)))
644 (goto-char (point-min)))
625 ;; reset profiling info if desired 645 ;; reset profiling info if desired
626 (and elp-reset-after-results 646 (and elp-reset-after-results
627 (elp-reset-all)))) 647 (elp-reset-all))))