branch: elpa/hyperdrive
commit f57c9086dd5659037dde6ec9d9fdab8533527f98
Author: Joseph Turner <jos...@ushin.org>
Commit: Joseph Turner <jos...@ushin.org>

    Add: (h/safe-string) New function
---
 hyperdrive-lib.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 615884b0d6..dd3bd02b4f 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1734,6 +1734,13 @@ Potential return values are t, nil, or \\+`unknown'.  If 
ETC slot
 has no value for \\+`safep', return \\+`unknown'."
   (map-elt (h/etc hyperdrive) 'safep 'unknown))
 
+(defun h/safe-string (hyperdrive)
+  "Return propertized string describing HYPERDRIVE safety."
+  (pcase-exhaustive (h/safe-p hyperdrive)
+    ('t (propertize "safe" 'face 'success))
+    ('nil (propertize "unsafe" 'face 'error))
+    ('unknown (propertize "unknown" 'face 'warning))))
+
 (defun h//ensure-dot-slash-prefix-path (path)
   "Return PATH, ensuring it begins with the correct prefix.
 Unless PATH starts with \"/\" \"./\" or \"../\", add \"./\"."

Reply via email to