diff options
| author | Ihor Radchenko <yantar92@posteo.net> | 2023-06-20 15:17:19 +0300 |
|---|---|---|
| committer | Ihor Radchenko <yantar92@posteo.net> | 2023-06-20 15:17:19 +0300 |
| commit | 9687e1d80ae1f2aa6ef72d10e46c4db93cababfb (patch) | |
| tree | 99380030c19823dfb52ad65b87c4f2c02f9b4e9b | |
| parent | 56157c6ff88e778794bb04a41f8964ce605a855a (diff) | |
New customization: emacs-gc-stats-inhibit-command-name-logging
* emacs-gc-stats.el (emacs-gc-stats-inhibit-command-name-logging): New
custom variable.
(emacs-gc-stats--collect): Avoid logging command names when the new
variable is set.
| -rw-r--r-- | emacs-gc-stats.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/emacs-gc-stats.el b/emacs-gc-stats.el index 7ff9f12..bae1862 100644 --- a/emacs-gc-stats.el +++ b/emacs-gc-stats.el @@ -61,6 +61,11 @@ 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))) +(defcustom emacs-gc-stats-inhibit-command-name-logging nil + "When non-nil, do not collect command names (`this-command')." + :type 'boolean + :package-version '(emacs-gc-stats . 1.3)) + (defcustom emacs-gc-stats-setting-vars '(gc-cons-threshold gc-cons-percentage @@ -116,7 +121,10 @@ Otherwise, collect symbol." (pcase var ((pred keywordp) (push var data)) ((and (pred symbolp) (pred boundp)) - (push (cons var (symbol-value var)) data)) + (unless (and emacs-gc-stats-inhibit-command-name-logging + (memq var '( this-command real-this-command + last-command real-last-command))) + (push (cons var (symbol-value var)) data))) ((pred functionp) (push (cons var (funcall var)) data)) ((pred listp) |
