emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/eglot-inactive-regions 9dba1b222d 14/66: Check for valid r


From: ELPA Syncer
Subject: [nongnu] elpa/eglot-inactive-regions 9dba1b222d 14/66: Check for valid ranges when setting parameters
Date: Fri, 6 Dec 2024 06:59:51 -0500 (EST)

branch: elpa/eglot-inactive-regions
commit 9dba1b222d50279ba3234548b3866e732304ac3c
Author: Filippo Argiolas <filippo.argiolas@gmail.com>
Commit: Filippo Argiolas <filippo.argiolas@gmail.com>

    Check for valid ranges when setting parameters
---
 clangd-inactive-regions.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/clangd-inactive-regions.el b/clangd-inactive-regions.el
index dfcc8f8e82..090e959ffc 100644
--- a/clangd-inactive-regions.el
+++ b/clangd-inactive-regions.el
@@ -89,7 +89,9 @@ Allowed methods:
 (defun clangd-inactive-regions-set-opacity (opacity)
   "Interactively set a new opacity value for inactive regions when
 `darken-foreground' method is enabled."
-  (interactive "nNew inactive region foreground color opacity: ")
+  (interactive "nNew inactive region foreground color opacity [0-1.0]: ")
+  (unless (and (>= opacity 0.0) (< opacity 1.0))
+    (error "Opacity should be between 0.0 and 1.0"))
   (setq clangd-inactive-regions-opacity opacity)
   (when (clangd-inactive-regions-mode)
     (clangd-inactive-regions-refresh)))
@@ -97,7 +99,9 @@ Allowed methods:
 (defun clangd-inactive-regions-set-shading (shading)
   "Interactively set a new shading value for inactive regions when
 `shade-background' method is enabled."
-  (interactive "nNew inactive region background color shading: ")
+  (interactive "nNew inactive region background color shading [0-1.0]: ")
+  (unless (and (>= shading 0.0) (< shading 1.0))
+    (error "Shading factor should be between 0.0 and 1.0"))
   (setq clangd-inactive-regions-shading shading)
   (when (clangd-inactive-regions-mode)
     (clangd-inactive-regions-refresh)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]