From d1f57265658c6e6c1ee12a37f69ce9725366ebc8 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sat, 25 Nov 2023 11:40:44 +0100 Subject: [PATCH] update keyfreq Signed-off-by: Andreas Gerler --- elpa/keyfreq-20160516.1416/keyfreq-pkg.el | 2 - .../keyfreq-autoloads.el | 39 +++++++++++++++++-- elpa/keyfreq-20220607.1613/keyfreq-pkg.el | 11 ++++++ .../keyfreq.el | 23 ++++++++--- 4 files changed, 64 insertions(+), 11 deletions(-) delete mode 100644 elpa/keyfreq-20160516.1416/keyfreq-pkg.el rename elpa/{keyfreq-20160516.1416 => keyfreq-20220607.1613}/keyfreq-autoloads.el (53%) create mode 100644 elpa/keyfreq-20220607.1613/keyfreq-pkg.el rename elpa/{keyfreq-20160516.1416 => keyfreq-20220607.1613}/keyfreq.el (96%) diff --git a/elpa/keyfreq-20160516.1416/keyfreq-pkg.el b/elpa/keyfreq-20160516.1416/keyfreq-pkg.el deleted file mode 100644 index c0e1a5a1..00000000 --- a/elpa/keyfreq-20160516.1416/keyfreq-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "keyfreq" "20160516.1416" "track command frequencies" '((cl-lib "0.5")) :commit "9c665c8c219d18866403897936427bb408e3d6b9" :authors '(("Ryan Yeske, Michal Nazarewicz (mina86/AT/mina86.com)")) :maintainer '("David Capello, Xah lee")) diff --git a/elpa/keyfreq-20160516.1416/keyfreq-autoloads.el b/elpa/keyfreq-20220607.1613/keyfreq-autoloads.el similarity index 53% rename from elpa/keyfreq-20160516.1416/keyfreq-autoloads.el rename to elpa/keyfreq-20220607.1613/keyfreq-autoloads.el index 6c443f5f..a36e4c08 100644 --- a/elpa/keyfreq-20160516.1416/keyfreq-autoloads.el +++ b/elpa/keyfreq-20220607.1613/keyfreq-autoloads.el @@ -1,4 +1,4 @@ -;;; keyfreq-autoloads.el --- automatically extracted autoloads +;;; keyfreq-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- ;; ;;; Code: @@ -24,6 +24,20 @@ Keyfreq mode records number of times each command was called making it possible to access usage statistics through various keyfreq-* functions. +This is a minor mode. If called interactively, toggle the +`Keyfreq mode' mode. If the prefix argument is positive, enable +the mode, and if it is zero or negative, disable the mode. + +If called from Lisp, toggle the mode if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. +Disable the mode if ARG is a negative number. + +To check whether the minor mode is enabled in the current buffer, +evaluate `(default-value \\='keyfreq-mode)'. + +The mode's hook is called both when the mode is enabled and when +it is disabled. + \(fn &optional ARG)" t nil) (defvar keyfreq-autosave-mode nil "\ @@ -41,14 +55,31 @@ Keyfreq Autosave mode automatically saves `keyfreq-table' every `keyfreq-autosave-timeout' seconds and when emacs is killed. +This is a minor mode. If called interactively, toggle the +`Keyfreq-Autosave mode' mode. If the prefix argument is +positive, enable the mode, and if it is zero or negative, disable +the mode. + +If called from Lisp, toggle the mode if ARG is `toggle'. Enable +the mode if ARG is nil, omitted, or is a positive number. +Disable the mode if ARG is a negative number. + +To check whether the minor mode is enabled in the current buffer, +evaluate `(default-value \\='keyfreq-autosave-mode)'. + +The mode's hook is called both when the mode is enabled and when +it is disabled. + \(fn &optional ARG)" t nil) (autoload 'keyfreq-save-now "keyfreq" "\ -Save keyfreq data now. +Save keyfreq data now." t nil) -\(fn)" t nil) +(register-definition-prefixes "keyfreq" '("keyfreq-")) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "keyfreq" '("keyfreq-"))) +;;;*** + +;;;### (autoloads nil nil ("keyfreq-pkg.el") (0 0 0 0)) ;;;*** diff --git a/elpa/keyfreq-20220607.1613/keyfreq-pkg.el b/elpa/keyfreq-20220607.1613/keyfreq-pkg.el new file mode 100644 index 00000000..be532f45 --- /dev/null +++ b/elpa/keyfreq-20220607.1613/keyfreq-pkg.el @@ -0,0 +1,11 @@ +(define-package "keyfreq" "20220607.1613" "track command frequencies" + '((cl-lib "0.5")) + :commit "dd88193cd7a91a92113121191573758ea2a3ceb1" :authors + '(("Ryan Yeske, Michal Nazarewicz (mina86/AT/mina86.com)")) + :maintainers + '(("David Capello, Xah lee")) + :maintainer + '("David Capello, Xah lee")) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/keyfreq-20160516.1416/keyfreq.el b/elpa/keyfreq-20220607.1613/keyfreq.el similarity index 96% rename from elpa/keyfreq-20160516.1416/keyfreq.el rename to elpa/keyfreq-20220607.1613/keyfreq.el index b5e65c26..9237d55a 100644 --- a/elpa/keyfreq-20160516.1416/keyfreq.el +++ b/elpa/keyfreq-20220607.1613/keyfreq.el @@ -11,7 +11,6 @@ ;; Created: 2006 ;; ;; Package-Requires: ((cl-lib "0.5")) -;; Package-Version: 20160516.1416 ;; ;; ;; Keyfreq is free software; you can redistribute it and/or modify it @@ -122,11 +121,16 @@ by default." :group 'keyfreq :type 'file) + (defcustom keyfreq-file-lock "~/.emacs.keyfreq.lock" "Lock file to update the `keyfreq-file'." :group 'keyfreq :type 'file) +(defcustom keyfreq-excluded-regexp '() + "List of commands in REGEXP-FORM excluded by keyfreq." + :group 'keyfreq + :type 'file) (defvar keyfreq-table (make-hash-table :test 'equal :size 128) "Hash table storing number of times each command was called in each major mode @@ -135,17 +139,26 @@ since the last time the frequencies were saved in `keyfreq-file'.") (defvar keyfreq-excluded-commands '() "List of commands excluded by keyfreq.") +(defun keyfreq-match-p (cmd) + "Return t if CMD in `keyfreq-excluded-commands' or match `keyfreq-excluded-regexp'." + ;; HACK Inspire by `consult--regexp-filter' + (let ((filter (mapconcat (lambda (x) (concat "\\(?:" x "\\)")) + keyfreq-excluded-regexp "\\|"))) + (or (memq cmd keyfreq-excluded-commands) + (when keyfreq-excluded-regexp + (string-match-p filter (symbol-name cmd)))))) + + (defun keyfreq-pre-command-hook () "Record command execution in `keyfreq-table' hash." (let ((command real-last-command) count) (when (and command (symbolp command)) (setq count (gethash (cons major-mode command) keyfreq-table)) - (unless (memq command keyfreq-excluded-commands) + (unless (keyfreq-match-p command) (puthash (cons major-mode command) (if count (1+ count) 1) keyfreq-table) )))) - (defun keyfreq-groups-major-modes (table) "Group major modes in TABLE by command. Return a hash table where each entry has COMMAND as key and @@ -404,7 +417,7 @@ is used as MAJOR-MODE-SYMBOL argument." (defun keyfreq-reset () "Reset all statistics including those in the file." (interactive) - (when (yes-or-no-p (concat "Delete keyfreq file? You will lost all your stats. ")) + (when (yes-or-no-p (concat "Delete keyfreq file? You will lose all your stats. ")) ;; clear the hash table (clrhash keyfreq-table) ;; Deal with the file @@ -525,7 +538,7 @@ The table is not reset, so the values are appended to the table." ;; Add the values in the table (while (and (listp l) l) (if (listp (car l)) - (unless (memq (cdr (caar l)) keyfreq-excluded-commands) + (unless (keyfreq-match-p (cdr (caar l))) (puthash (caar l) (+ (gethash (caar l) table 0) (cdar l)) table))) (setq l (cdr l))) ))) -- 2.47.3