aboutsummaryrefslogtreecommitdiff
path: root/modules/system-lib.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system-lib.el')
-rw-r--r--modules/system-lib.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/system-lib.el b/modules/system-lib.el
index 333c15ee..9e25be5b 100644
--- a/modules/system-lib.el
+++ b/modules/system-lib.el
@@ -130,5 +130,16 @@ Callers that must have a secret layer their own error on top."
(secret (plist-get (car (apply #'auth-source-search spec)) :secret)))
(if (functionp secret) (funcall secret) secret)))
+;; ---------------------------- Strong Confirmation ----------------------------
+
+(defun cj/confirm-strong (prompt)
+ "Ask PROMPT, requiring a full typed \"yes\" or \"no\" answer.
+For irreversible actions -- file destruction, overwrites, power-off. The
+global default makes `yes-or-no-p' a single keystroke (`use-short-answers'
+is t); this binds it to nil for the one call so the prompt demands the
+long-form answer, keeping a stray RET or space from confirming."
+ (let ((use-short-answers nil))
+ (yes-or-no-p prompt)))
+
(provide 'system-lib)
;;; system-lib.el ends here