[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/keycast 464bae181f 05/31: Show counter if a command is inv
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/keycast 464bae181f 05/31: Show counter if a command is invoked more than once in a row |
Date: |
Sun, 9 Jan 2022 05:58:37 -0500 (EST) |
branch: elpa/keycast
commit 464bae181f4e6a13f654262f9771463b1bd4cc98
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Show counter if a command is invoked more than once in a row
Closes #5.
Closes #6.
---
keycast.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/keycast.el b/keycast.el
index 789d4662b5..a6417a0086 100644
--- a/keycast.el
+++ b/keycast.el
@@ -1,6 +1,6 @@
;;; keycast.el --- Show current command and its key in the mode line -*-
lexical-binding: t -*-
-;; Copyright (C) 2018 Jonas Bernoulli
+;; Copyright (C) 2018-2019 Jonas Bernoulli
;; Author: Jonas Bernoulli <jonas@bernoul.li>
;; Homepage: https://github.com/tarsius/keycast
@@ -147,9 +147,13 @@ instead."
(defvar keycast--this-command nil)
(defvar keycast--this-command-keys nil)
+(defvar keycast--command-repetitions 0)
(defun keycast-mode-line-update ()
"Update mode line with current `this-command' and `this-command-keys'."
+ (if (eq last-command this-command)
+ (cl-incf keycast--command-repetitions)
+ (setq keycast--command-repetitions 0))
;; Remember these values because the mode line update won't actually
;; happen until we return to the command loop and by that time these
;; values have been reset to nil.
@@ -219,8 +223,9 @@ instead."
(concat (make-string (ceiling pad 2) ?\s) key
(make-string (floor pad 2) ?\s)))
'face 'keycast-key)
- (format " %s" (propertize (symbol-name cmd)
- 'face 'keycast-command))))))))
+ (propertize (format " %s" cmd) 'face 'keycast-command)
+ (and (> keycast--command-repetitions 0)
+ (format " x%s" (1+ keycast--command-repetitions)))))))))
(put 'mode-line-keycast 'risky-local-variable t)
(make-variable-buffer-local 'mode-line-keycast)
- [nongnu] branch elpa/keycast created (now a5257bca3d), ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast b7ef571043 11/31: Fix typo, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast 8970a30273 12/31: Revert "Add .github/FUNDING.yml", ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast c64742ee21 01/31: Initial import, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast 16d9961d15 16/31: Add format-spec requirement, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast 464bae181f 05/31: Show counter if a command is invoked more than once in a row,
ELPA Syncer <=
- [nongnu] elpa/keycast 7c45ff05c1 06/31: Fix typo in doc-string, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast cf475dcb5a 18/31: keycast--format: New function, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast 7bbebe6442 08/31: Add .github/FUNDING.yml, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast 44f53d7cc6 10/31: Limit updating of mode-line, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast b02892ec77 24/31: Show only type for non-symbol bindings, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast 3beccc4789 26/31: Load compile-time dependencies for older Emacsen, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast a5257bca3d 31/31: Release version 1.1.2, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast d54a8ebc08 27/31: Restore updating while in minibuffer, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast 0d28c26b07 02/31: Fix typo, ELPA Syncer, 2022/01/09
- [nongnu] elpa/keycast 46370b8a72 03/31: Change screenshot url, ELPA Syncer, 2022/01/09