From 47e0b5be0151c35be7646dc41fe536e3912dde0a Mon Sep 17 00:00:00 2001 From: gregha Date: Sun, 28 May 2023 10:40:57 -0700 Subject: [PATCH 1/8] add ability to setq, and statically define the particle color --- power-mode.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/power-mode.el b/power-mode.el index 6eeb1c0..53c834c 100644 --- a/power-mode.el +++ b/power-mode.el @@ -82,6 +82,12 @@ Set to nil to disable shake effects." :type '(choice integer (const nil)) :group 'power) +(defcustom power-mode-streak-particle-color + nil + "Streak particle color. If nil it uses the foreground text color." + :type 'color + :group 'power) + (defcustom power-mode-streak-particle-threshold 20 "Streak required before particle effects activate. @@ -268,6 +274,8 @@ Set to nil to disable particle effects." (defun power-mode--foreground-color-before-point () "Get the foreground color of the character before the point." + (if power-mode-streak-particle-color + power-mode-streak-particle-color (let ((mode hl-line-mode) (global-mode global-hl-line-mode)) (hl-line-mode -1) @@ -278,7 +286,7 @@ Set to nil to disable particle effects." (let ((color (foreground-color-at-point))) (hl-line-mode mode) (global-hl-line-mode global-mode) - color)))) + color)))))) (defun power-mode--spawn-particles-at-point () "Spawn particles at the point." From c5877680b0803be53b47d3c98e35c3cc989e02ec Mon Sep 17 00:00:00 2001 From: FXKrait Date: Mon, 9 Oct 2023 18:27:00 -0700 Subject: [PATCH 2/8] use composite type for particle color --- power-mode.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/power-mode.el b/power-mode.el index 53c834c..f9e7ce0 100644 --- a/power-mode.el +++ b/power-mode.el @@ -82,10 +82,10 @@ Set to nil to disable shake effects." :type '(choice integer (const nil)) :group 'power) -(defcustom power-mode-streak-particle-color +(defcustom power-mode-streak-custom-particle-color nil - "Streak particle color. If nil it uses the foreground text color." - :type 'color + "Streak particle color. If nil the foreground text color is used." + :type '(choice (const :tag "nil " nil) color) :group 'power) (defcustom power-mode-streak-particle-threshold @@ -274,8 +274,8 @@ Set to nil to disable particle effects." (defun power-mode--foreground-color-before-point () "Get the foreground color of the character before the point." - (if power-mode-streak-particle-color - power-mode-streak-particle-color + (if power-mode-streak-custom-particle-color + power-mode-streak-custom-particle-color (let ((mode hl-line-mode) (global-mode global-hl-line-mode)) (hl-line-mode -1) From 3792d122627eb1cf0138780743ff9eeb25e41eb4 Mon Sep 17 00:00:00 2001 From: FXKrait Date: Mon, 9 Oct 2023 18:32:01 -0700 Subject: [PATCH 3/8] remove extraneous tag --- power-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/power-mode.el b/power-mode.el index f9e7ce0..826fe64 100644 --- a/power-mode.el +++ b/power-mode.el @@ -85,7 +85,7 @@ Set to nil to disable shake effects." (defcustom power-mode-streak-custom-particle-color nil "Streak particle color. If nil the foreground text color is used." - :type '(choice (const :tag "nil " nil) color) + :type '(choice (const nil) color) :group 'power) (defcustom power-mode-streak-particle-threshold From 179c3b5b715b786dd49eb2e83b1cd4076a94aee6 Mon Sep 17 00:00:00 2001 From: FXKrait Date: Mon, 9 Oct 2023 18:37:32 -0700 Subject: [PATCH 4/8] update custom particle color variable description --- power-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/power-mode.el b/power-mode.el index 826fe64..c5a715f 100644 --- a/power-mode.el +++ b/power-mode.el @@ -84,7 +84,7 @@ Set to nil to disable shake effects." (defcustom power-mode-streak-custom-particle-color nil - "Streak particle color. If nil the foreground text color is used." + "User-defined streak particle color. If nil the foreground text color is used." :type '(choice (const nil) color) :group 'power) From 0182ef6840e71a6d99f1d2f15a059decc6ae930b Mon Sep 17 00:00:00 2001 From: FXKrait Date: Mon, 9 Oct 2023 18:42:40 -0700 Subject: [PATCH 5/8] For custom particle color, put nil option last like other variables --- power-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/power-mode.el b/power-mode.el index c5a715f..7255f16 100644 --- a/power-mode.el +++ b/power-mode.el @@ -85,7 +85,7 @@ Set to nil to disable shake effects." (defcustom power-mode-streak-custom-particle-color nil "User-defined streak particle color. If nil the foreground text color is used." - :type '(choice (const nil) color) + :type '(choice color (const nil)) :group 'power) (defcustom power-mode-streak-particle-threshold From 3d15fe8e2fd5cf9a43f8ead52fe17ee11933adcf Mon Sep 17 00:00:00 2001 From: FXKrait Date: Thu, 12 Oct 2023 00:27:05 -0700 Subject: [PATCH 6/8] rename power-mode-streak-custom-particle-color to power-mode-streak-static-particle-color --- power-mode.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/power-mode.el b/power-mode.el index 7255f16..2bd3bc0 100644 --- a/power-mode.el +++ b/power-mode.el @@ -82,7 +82,7 @@ Set to nil to disable shake effects." :type '(choice integer (const nil)) :group 'power) -(defcustom power-mode-streak-custom-particle-color +(defcustom power-mode-streak-static-particle-color nil "User-defined streak particle color. If nil the foreground text color is used." :type '(choice color (const nil)) @@ -274,8 +274,8 @@ Set to nil to disable particle effects." (defun power-mode--foreground-color-before-point () "Get the foreground color of the character before the point." - (if power-mode-streak-custom-particle-color - power-mode-streak-custom-particle-color + (if power-mode-streak-static-particle-color + power-mode-streak-static-particle-color (let ((mode hl-line-mode) (global-mode global-hl-line-mode)) (hl-line-mode -1) From d6a3eac44d2b5b203c02aecd126beea740770f41 Mon Sep 17 00:00:00 2001 From: FXKrait Date: Thu, 12 Oct 2023 00:33:52 -0700 Subject: [PATCH 7/8] Further expound the contrast between the static vs dynamic color behavior, in the variable description. --- power-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/power-mode.el b/power-mode.el index 2bd3bc0..dfee37e 100644 --- a/power-mode.el +++ b/power-mode.el @@ -84,7 +84,9 @@ Set to nil to disable shake effects." (defcustom power-mode-streak-static-particle-color nil - "User-defined streak particle color. If nil the foreground text color is used." + "User-defined static streak particle color. + +If nil, the dynamic foreground text color is used." :type '(choice color (const nil)) :group 'power) From d29868ce4dfba4a05f5143a7c09d991431c62455 Mon Sep 17 00:00:00 2001 From: FXKrait Date: Fri, 13 Oct 2023 14:48:19 -0700 Subject: [PATCH 8/8] remove extra added unnecessary parenthesis: looking at function in org-babel code block incorrectly told me to add an additional parenthesis to balance, in the .el it indicates parethesis balancing correctly. Undoing what babel told me, because it's false, breaks things. --- power-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/power-mode.el b/power-mode.el index dfee37e..07588ef 100644 --- a/power-mode.el +++ b/power-mode.el @@ -288,7 +288,7 @@ Set to nil to disable particle effects." (let ((color (foreground-color-at-point))) (hl-line-mode mode) (global-hl-line-mode global-mode) - color)))))) + color))))) (defun power-mode--spawn-particles-at-point () "Spawn particles at the point."