emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/emacs-gc-stats 459616df26 2/9: Make recorded data custo


From: ELPA Syncer
Subject: [elpa] externals/emacs-gc-stats 459616df26 2/9: Make recorded data customizeable
Date: Tue, 20 Jun 2023 09:58:23 -0400 (EDT)

branch: externals/emacs-gc-stats
commit 459616df26bd36e46f8565cf5afa11c02f131d3e
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    Make recorded data customizeable
    
    * emacs-gc-stats.el (emacs-gc-stats-inhibit-command-name-logging):
    (emacs-gc-stats-setting-vars):
    (emacs-gc-stats-command-vars): New custom variables (renamed from
    internal variables).
    (emacs-gc-stats--collect-init):
    (emacs-gc-stats--collect-gc):
    (emacs-gc-stats--collect-end):
    (emacs-gc-stats--collect-init-end): Use the new variables.
---
 emacs-gc-stats.el | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/emacs-gc-stats.el b/emacs-gc-stats.el
index 82dd83b873..fdd382aa11 100644
--- a/emacs-gc-stats.el
+++ b/emacs-gc-stats.el
@@ -61,7 +61,7 @@ This setting, when non-nil, will override the existing values 
of
          (const :tag "Do not change existing GC settings" nil)
           (const :tag "Force emacs defaults" emacs-defaults)))
 
-(defvar emacs-gc-stats--setting-vars
+(defcustom emacs-gc-stats-setting-vars
   '(gc-cons-threshold
     gc-cons-percentage
     memory-limit
@@ -71,9 +71,11 @@ This setting, when non-nil, will override the existing 
values of
     prelude-tips
     (memory-info)
     (memory-use-counts))
-  "List of variable/function symbols to collect.")
+  "List of variable/function symbols to collect after loading init.el."
+  :type '(list sexp)
+  :package-version '(emacs-gc-stats . 1.3))
 
-(defvar emacs-gc-stats--command-vars
+(defcustom emacs-gc-stats-command-vars
   '(gc-cons-threshold
     gc-cons-percentage
     gcmh-mode
@@ -84,9 +86,11 @@ This setting, when non-nil, will override the existing 
values of
     (memory-info)
     (memory-use-counts)
     emacs-gc-stats--idle-tic)
-  "List of variable/function symbols to collect for each GC or command.")
+  "List of variable/function symbols to collect for each GC or command."
+  :type '(list sexp)
+  :package-version '(emacs-gc-stats . 1.3))
 
-(defvar emacs-gc-stats--summary-vars
+(defcustom emacs-gc-stats-summary-vars
   '(gc-cons-threshold
     gc-cons-percentage
     gc-elapsed
@@ -97,7 +101,9 @@ This setting, when non-nil, will override the existing 
values of
     (memory-use-counts)
     emacs-gc-stats-idle-delay
     emacs-gc-stats--idle-tic)
-  "List of variables to collect at session end.")
+  "List of variables to collect at session end."
+  :type '(list sexp)
+  :package-version '(emacs-gc-stats . 1.3))
 
 (defun emacs-gc-stats--collect (&rest symbols)
   "Collect SYMBOLS values.
@@ -127,7 +133,7 @@ Otherwise, collect symbol."
    (apply #'emacs-gc-stats--collect
           "Initial stats"
           (current-time-string)
-          emacs-gc-stats--setting-vars)
+          emacs-gc-stats-setting-vars)
    emacs-gc-stats--data))
 
 (defun emacs-gc-stats--collect-gc ()
@@ -135,7 +141,7 @@ Otherwise, collect symbol."
   (push
    (apply #'emacs-gc-stats--collect
           (current-time-string)
-          emacs-gc-stats--command-vars)
+          emacs-gc-stats-command-vars)
    emacs-gc-stats--data))
 
 (defun emacs-gc-stats--collect-init-end ()
@@ -144,7 +150,7 @@ Otherwise, collect symbol."
    (apply #'emacs-gc-stats--collect
           "Init.el stats"
           (current-time-string)
-          emacs-gc-stats--summary-vars)
+          emacs-gc-stats-summary-vars)
    emacs-gc-stats--data))
 
 (defun emacs-gc-stats--collect-end ()
@@ -153,7 +159,7 @@ Otherwise, collect symbol."
    (apply #'emacs-gc-stats--collect
           "Session end stats"
           (current-time-string)
-          emacs-gc-stats--summary-vars)
+          emacs-gc-stats-summary-vars)
    emacs-gc-stats--data))
 
 (defun emacs-gc-stats-save-session ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]