diff options
| author | Stefan Monnier | 2012-07-19 07:39:38 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-07-19 07:39:38 -0400 |
| commit | 5db81e33629049da22e7d0ff6c28a5cae31edac9 (patch) | |
| tree | a30274d3c351832f8ed0baacd2d178bd0e0fe93c /lisp | |
| parent | 5b835e1d6e0c6fafc7f27174889358bfde5f2449 (diff) | |
| download | emacs-5db81e33629049da22e7d0ff6c28a5cae31edac9.tar.gz emacs-5db81e33629049da22e7d0ff6c28a5cae31edac9.zip | |
* lisp/emacs-lisp/chart.el: Use lexical-binding.
(chart-emacs-storage): Don't hardcode the list of entries.
* src/alloc.c (Fgarbage_collect): Tweak docstring.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/chart.el | 38 |
2 files changed, 15 insertions, 28 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 12186c7bef7..170982d724e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/chart.el: Use lexical-binding. | ||
| 4 | (chart-emacs-storage): Don't hardcode the list of entries. | ||
| 5 | |||
| 1 | 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru> | 6 | 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 7 | ||
| 3 | Next round of tweaks caused by Fgarbage_collect changes. | 8 | Next round of tweaks caused by Fgarbage_collect changes. |
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 1451e1a2af4..31aeb1f8076 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; chart.el --- Draw charts (bar charts, etc) | 1 | ;;; chart.el --- Draw charts (bar charts, etc) -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996, 1998-1999, 2001, 2004-2005, 2007-2012 | 3 | ;; Copyright (C) 1996, 1998-1999, 2001, 2004-2005, 2007-2012 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| @@ -156,7 +156,7 @@ Returns the newly created buffer." | |||
| 156 | ) | 156 | ) |
| 157 | "Superclass for all charts to be displayed in an Emacs buffer.") | 157 | "Superclass for all charts to be displayed in an Emacs buffer.") |
| 158 | 158 | ||
| 159 | (defmethod initialize-instance :AFTER ((obj chart) &rest fields) | 159 | (defmethod initialize-instance :AFTER ((obj chart) &rest _fields) |
| 160 | "Initialize the chart OBJ being created with FIELDS. | 160 | "Initialize the chart OBJ being created with FIELDS. |
| 161 | Make sure the width/height is correct." | 161 | Make sure the width/height is correct." |
| 162 | (oset obj x-width (- (window-width) 10)) | 162 | (oset obj x-width (- (window-width) 10)) |
| @@ -276,7 +276,7 @@ START and END represent the boundary." | |||
| 276 | (float (- (cdr range) (car range))))))))) | 276 | (float (- (cdr range) (car range))))))))) |
| 277 | ) | 277 | ) |
| 278 | 278 | ||
| 279 | (defmethod chart-axis-draw ((a chart-axis-range) &optional dir margin zone start end) | 279 | (defmethod chart-axis-draw ((a chart-axis-range) &optional dir margin zone _start _end) |
| 280 | "Draw axis information based upon a range to be spread along the edge. | 280 | "Draw axis information based upon a range to be spread along the edge. |
| 281 | A is the chart to draw. DIR is the direction. | 281 | A is the chart to draw. DIR is the direction. |
| 282 | MARGIN, ZONE, START, and END specify restrictions in chart space." | 282 | MARGIN, ZONE, START, and END specify restrictions in chart space." |
| @@ -329,7 +329,7 @@ Automatically compensates for direction." | |||
| 329 | (+ m -1 (round (* lpn (+ 1.0 (float n)))))) | 329 | (+ m -1 (round (* lpn (+ 1.0 (float n)))))) |
| 330 | )) | 330 | )) |
| 331 | 331 | ||
| 332 | (defmethod chart-axis-draw ((a chart-axis-names) &optional dir margin zone start end) | 332 | (defmethod chart-axis-draw ((a chart-axis-names) &optional dir margin zone _start _end) |
| 333 | "Draw axis information based upon A range to be spread along the edge. | 333 | "Draw axis information based upon A range to be spread along the edge. |
| 334 | Optional argument DIR is the direction of the chart. | 334 | Optional argument DIR is the direction of the chart. |
| 335 | Optional arguments MARGIN, ZONE, START and END specify boundaries of the drawing." | 335 | Optional arguments MARGIN, ZONE, START and END specify boundaries of the drawing." |
| @@ -675,32 +675,14 @@ SORT-PRED if desired." | |||
| 675 | (defun chart-emacs-storage () | 675 | (defun chart-emacs-storage () |
| 676 | "Chart the current storage requirements of Emacs." | 676 | "Chart the current storage requirements of Emacs." |
| 677 | (interactive) | 677 | (interactive) |
| 678 | (let* ((data (garbage-collect)) | 678 | (let* ((data (garbage-collect))) |
| 679 | (cons-info (nth 0 data)) | ||
| 680 | (symbol-info (nth 1 data)) | ||
| 681 | (misc-info (nth 2 data)) | ||
| 682 | (string-info (nth 3 data)) | ||
| 683 | (string-bytes-info (nth 4 data)) | ||
| 684 | ;; (nth 5 data) is not used | ||
| 685 | (vector-slots-info (nth 6 data)) | ||
| 686 | (float-info (nth 7 data)) | ||
| 687 | (interval-info (nth 8 data)) | ||
| 688 | (buffer-info (nth 9 data)) | ||
| 689 | (names '("conses" "symbols" "miscs" "strings" | ||
| 690 | "vectors" "floats" "intervals" "buffers")) | ||
| 691 | (nums (list (* (nth 1 cons-info) (nth 2 cons-info)) | ||
| 692 | (* (nth 1 symbol-info) (nth 2 symbol-info)) | ||
| 693 | (* (nth 1 misc-info) (nth 2 misc-info)) | ||
| 694 | (+ (* (nth 1 string-info) (nth 2 string-info)) | ||
| 695 | (nth 2 string-bytes-info)) | ||
| 696 | (* (nth 1 vector-slots-info) (nth 2 vector-slots-info)) | ||
| 697 | (* (nth 1 float-info) (nth 2 float-info)) | ||
| 698 | (* (nth 1 interval-info) (nth 2 interval-info)) | ||
| 699 | (* (nth 1 buffer-info) (nth 2 buffer-info))))) | ||
| 700 | ;; Let's create the chart! | 679 | ;; Let's create the chart! |
| 701 | (chart-bar-quickie 'vertical "Emacs Runtime Storage Usage" | 680 | (chart-bar-quickie 'vertical "Emacs Runtime Storage Usage" |
| 702 | names "Storage Items" | 681 | (mapcar (lambda (x) (symbol-name (car x))) data) |
| 703 | nums "Objects"))) | 682 | "Storage Items" |
| 683 | (mapcar (lambda (x) (* (nth 1 x) (nth 2 x))) | ||
| 684 | data) | ||
| 685 | "Bytes"))) | ||
| 704 | 686 | ||
| 705 | (defun chart-emacs-lists () | 687 | (defun chart-emacs-lists () |
| 706 | "Chart out the size of various important lists." | 688 | "Chart out the size of various important lists." |