diff options
Diffstat (limited to 'lisp/emacs-lisp/chart.el')
-rw-r--r-- | lisp/emacs-lisp/chart.el | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 19766feac5a..31aeb1f8076 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -1,4 +1,4 @@ -;;; chart.el --- Draw charts (bar charts, etc) +;;; chart.el --- Draw charts (bar charts, etc) -*- lexical-binding: t -*- ;; Copyright (C) 1996, 1998-1999, 2001, 2004-2005, 2007-2012 ;; Free Software Foundation, Inc. @@ -62,8 +62,8 @@ (require 'eieio) ;;; Code: -(defvar chart-mode-map (make-sparse-keymap) "Keymap used in chart mode.") (define-obsolete-variable-alias 'chart-map 'chart-mode-map "24.1") +(defvar chart-mode-map (make-sparse-keymap) "Keymap used in chart mode.") (defvar chart-local-object nil "Local variable containing the locally displayed chart object.") @@ -82,7 +82,7 @@ Colors will be the background color.") Useful if new Emacs is used on B&W display.") (defcustom chart-face-use-pixmaps nil - "*Non-nil to use fancy pixmaps in the background of chart face colors." + "Non-nil to use fancy pixmaps in the background of chart face colors." :group 'eieio :type 'boolean) @@ -156,7 +156,7 @@ Returns the newly created buffer." ) "Superclass for all charts to be displayed in an Emacs buffer.") -(defmethod initialize-instance :AFTER ((obj chart) &rest fields) +(defmethod initialize-instance :AFTER ((obj chart) &rest _fields) "Initialize the chart OBJ being created with FIELDS. Make sure the width/height is correct." (oset obj x-width (- (window-width) 10)) @@ -276,7 +276,7 @@ START and END represent the boundary." (float (- (cdr range) (car range))))))))) ) -(defmethod chart-axis-draw ((a chart-axis-range) &optional dir margin zone start end) +(defmethod chart-axis-draw ((a chart-axis-range) &optional dir margin zone _start _end) "Draw axis information based upon a range to be spread along the edge. A is the chart to draw. DIR is the direction. MARGIN, ZONE, START, and END specify restrictions in chart space." @@ -329,7 +329,7 @@ Automatically compensates for direction." (+ m -1 (round (* lpn (+ 1.0 (float n)))))) )) -(defmethod chart-axis-draw ((a chart-axis-names) &optional dir margin zone start end) +(defmethod chart-axis-draw ((a chart-axis-names) &optional dir margin zone _start _end) "Draw axis information based upon A range to be spread along the edge. Optional argument DIR is the direction of the chart. Optional arguments MARGIN, ZONE, START and END specify boundaries of the drawing." @@ -675,28 +675,14 @@ SORT-PRED if desired." (defun chart-emacs-storage () "Chart the current storage requirements of Emacs." (interactive) - (let* ((data (garbage-collect)) - (names '("strings/2" "vectors" - "conses" "free cons" - "syms" "free syms" - "markers" "free mark" - ;; "floats" "free flt" - )) - (nums (list (/ (nth 3 data) 2) - (nth 4 data) - (car (car data)) ; conses - (cdr (car data)) - (car (nth 1 data)) ; syms - (cdr (nth 1 data)) - (car (nth 2 data)) ; markers - (cdr (nth 2 data)) - ;(car (nth 5 data)) ; floats are Emacs only - ;(cdr (nth 5 data)) - ))) + (let* ((data (garbage-collect))) ;; Let's create the chart! (chart-bar-quickie 'vertical "Emacs Runtime Storage Usage" - names "Storage Items" - nums "Objects"))) + (mapcar (lambda (x) (symbol-name (car x))) data) + "Storage Items" + (mapcar (lambda (x) (* (nth 1 x) (nth 2 x))) + data) + "Bytes"))) (defun chart-emacs-lists () "Chart out the size of various important lists." |