From ecc7cb65d3d8c72dda508be6784ffb18c8061674 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 8 Sep 2022 06:59:07 +0300 Subject: [PATCH] mu4e: add mu4e--plist-get helper --- mu4e/mu4e-helpers.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mu4e/mu4e-helpers.el b/mu4e/mu4e-helpers.el index 18c973d1..1da31197 100644 --- a/mu4e/mu4e-helpers.el +++ b/mu4e/mu4e-helpers.el @@ -211,6 +211,13 @@ Does a local-exit and does not return." ;;; Reading user input +(defun mu4e--plist-get (lst prop) + "Get PROP from plist LST and raise an error if not present." + (or (plist-get lst prop) + (if (plist-member lst prop) + nil + (mu4e-error "Missing property %s in %s" prop lst)))) + (defun mu4e--read-char-choice (prompt choices) "Read and return one of CHOICES, prompting for PROMPT. Any input that is not one of CHOICES is ignored. This is mu4e's