comparison lisp/emacs-lisp/elp.el @ 91304:c938ab6810a4

Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-308
author Miles Bader <miles@gnu.org>
date Wed, 02 Jan 2008 04:13:39 +0000
parents 880960b70474 b8ae06eabc33
children 606f2d163a64
comparison
equal deleted inserted replaced
91303:1ae1f4066439 91304:c938ab6810a4
594 0.0 ;avoid arithmetic div-by-zero errors 594 0.0 ;avoid arithmetic div-by-zero errors
595 (/ (float tt) (float cc))) 595 (/ (float tt) (float cc)))
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
616 (if elp-sort-by-function 635 (if elp-sort-by-function
617 (setq resvec (sort resvec elp-sort-by-function))) 636 (setq resvec (sort resvec elp-sort-by-function)))
619 ;; now pop up results buffer 638 ;; now pop up results buffer
620 (set-buffer curbuf) 639 (set-buffer curbuf)
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))))
628 648
629 (defun elp-unload-function () 649 (defun elp-unload-function ()