From 68f7b7046e0c8b00c492d8fcc1939c1fa58ac4ba Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 18 May 2024 05:47:38 +0300 Subject: Add gnosis-mcc-extract-options --- gnosis.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gnosis.el b/gnosis.el index 5faa660..a8badb8 100644 --- a/gnosis.el +++ b/gnosis.el @@ -847,6 +847,16 @@ See `gnosis-add-note--cloze' for more reference." :images (gnosis-select-images) :tags (gnosis-prompt-tags--split gnosis-previous-note-tags))) +(cl-defun gnosis-mcc-extract-options (str &optional (char gnosis-mcc-separator)) + "Extract options for MCC note type from STR. + +CHAR: separator for mcc, default to `gnosis-mcc-separator'" + (cl-remove-if + #'null + (mapcar (lambda (s) + (when (string-match-p (regexp-quote char) s) + (split-string s (regexp-quote char)))) + (split-string str " ")))) ;;;###autoload (defun gnosis-add-note (&optional deck type) "Create note(s) as TYPE interactively. -- cgit v1.2.3