[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kind-icon 962c209 20/51: Add custom variable watcher fo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/kind-icon 962c209 20/51: Add custom variable watcher for instant updates |
Date: |
Wed, 17 Nov 2021 15:57:42 -0500 (EST) |
branch: externals/kind-icon
commit 962c2094bc81f146ef664ad7a4eb9197dbc8280a
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
Add custom variable watcher for instant updates
---
README.md | 2 +-
kind-icon.el | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 5fdb026..8d2f0db 100644
--- a/README.md
+++ b/README.md
@@ -51,7 +51,7 @@ The configuration defaults should work fine, but kind-icon
can be customized to
### Variables
-`kind-icon` has a few customization variables that allows you to configure its
appearance. Note that since the styled icons are cached, changes to the
mapping, font size, or other variables in an initialized buffer should be
followed by `M-x kind-icon-reset-cache` (or just restart Emacs).
+`kind-icon` has a few customization variables that allows you to configure its
appearance.
**Key configurations:**
diff --git a/kind-icon.el b/kind-icon.el
index 3e2f46a..7716211 100644
--- a/kind-icon.el
+++ b/kind-icon.el
@@ -54,7 +54,6 @@
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Code:
-
(defgroup kind-icon nil
"Completion prefixes from :company-kind."
:group 'convenience
@@ -284,4 +283,15 @@ icon in the prefix slot. Use it like:
(kind-icon--affixation-function kind-func
ann-func)))))
(funcall completion-function start end table pred)))
+(defun kind-icon--guard-config (_s _n _o where)
+ "Dump the variable cache when the variable changes."
+ (if where
+ (with-current-buffer where
+ (kind-icon-reset-cache))
+ (kind-icon-reset-cache)))
+
+(add-variable-watcher 'kind-icon-mapping #'kind-icon--guard-config)
+(add-variable-watcher 'kind-icon-use-icons #'kind-icon--guard-config)
+(add-variable-watcher 'kind-icon-blend-background #'kind-icon--guard-config)
+(add-variable-watcher 'kind-icon-blend-frac #'kind-icon--guard-config)
(provide 'kind-icon)
- [elpa] externals/kind-icon fcfe9ea 14/51: kind-icon-formatted: 3 char-width icon/centered 1 or 2 char text, (continued)
- [elpa] externals/kind-icon fcfe9ea 14/51: kind-icon-formatted: 3 char-width icon/centered 1 or 2 char text, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon 8d6fa99 46/51: Update README.md, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon b88e809 48/51: kind-formatter -> margin-formatters, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon f6de892 37/51: Remove add-variable-watcher in favor of custom :set, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon 94ff0ac 13/51: customize interface for mappings, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon cfa3d73 38/51: Guard against network or other icon retrieval issues (text fallback), ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon ba0f94e 17/51: Re-enable mapping customization preview button, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon 0921fe2 35/51: Separate kind-icon--cache, and return ?? when kind missing, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon 0d92763 31/51: add kinds constructor, event, reference, typeparameter, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon c69da89 18/51: Updated docs, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon 962c209 20/51: Add custom variable watcher for instant updates,
ELPA Syncer <=
- [elpa] externals/kind-icon c0d50c6 40/51: minor reformat, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon be77196 19/51: Update README.md, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon ea06e81 47/51: Update README.md, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon dce91ac 49/51: Update README.md, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon 4896e1e 32/51: Switch module & ruler icons, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon 21a2861 34/51: Require svg-lib, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon 12aa1a9 42/51: Mention how to clear cache, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon 8087c8e 44/51: Update README.md, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon ba37562 09/51: more docs, ELPA Syncer, 2021/11/17
- [elpa] externals/kind-icon f080f3d 15/51: Remove minor mode in favor of c-in-r-f wrapper function, ELPA Syncer, 2021/11/17