diff options
author | Miles Bader <miles@gnu.org> | 2008-01-02 04:13:39 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2008-01-02 04:13:39 +0000 |
commit | 43a8b8ca5797923a7a9848a513ecc8cfff655e17 (patch) | |
tree | 1fcd51822e01c6017347954e46b788faa2bf728f /lisp/emacs-lisp/elp.el | |
parent | e97d3ec0184763b2479224486e70d23f03bd340f (diff) | |
parent | aacde24f5cdebc6d7ccb2f50a9d8e413906c4497 (diff) | |
download | emacs-43a8b8ca5797923a7a9848a513ecc8cfff655e17.tar.gz emacs-43a8b8ca5797923a7a9848a513ecc8cfff655e17.tar.bz2 emacs-43a8b8ca5797923a7a9848a513ecc8cfff655e17.zip |
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-308
Diffstat (limited to 'lisp/emacs-lisp/elp.el')
-rw-r--r-- | lisp/emacs-lisp/elp.el | 50 |
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." symname))))) elp-all-instrumented-list)) ) ; end let* - (insert title) - (if (> longest titlelen) - (progn - (insert-char 32 (- longest titlelen)) - (setq elp-field-len longest))) - (insert " " cc-header " " et-header " " at-header "\n") - (insert-char ?= elp-field-len) - (insert " ") - (insert-char ?= elp-cc-len) - (insert " ") - (insert-char ?= elp-et-len) - (insert " ") - (insert-char ?= elp-at-len) - (insert "\n") + ;; If printing to stdout, insert the header so it will print. + ;; Otherwise use header-line-format. + (setq elp-field-len (max titlelen longest)) + (if (or elp-use-standard-output noninteractive) + (progn + (insert title) + (if (> longest titlelen) + (progn + (insert-char 32 (- longest titlelen)))) + (insert " " cc-header " " et-header " " at-header "\n") + (insert-char ?= elp-field-len) + (insert " ") + (insert-char ?= elp-cc-len) + (insert " ") + (insert-char ?= elp-et-len) + (insert " ") + (insert-char ?= elp-at-len) + (insert "\n")) + (let ((column 0)) + (setq header-line-format + (mapconcat + (lambda (title) + (prog1 + (concat + (propertize " " + 'display (list 'space :align-to column) + 'face 'fixed-pitch) + title) + (setq column (+ column 1 + (if (= column 0) + elp-field-len + (length title)))))) + (list title cc-header et-header at-header) "")))) ;; if sorting is enabled, then sort the results list. in either ;; case, call elp-output-result to output the result in the ;; buffer @@ -621,7 +640,8 @@ displayed." (pop-to-buffer resultsbuf) ;; copy results to standard-output? (if (or elp-use-standard-output noninteractive) - (princ (buffer-substring (point-min) (point-max)))) + (princ (buffer-substring (point-min) (point-max))) + (goto-char (point-min))) ;; reset profiling info if desired (and elp-reset-after-results (elp-reset-all)))) |