From 0b95071fe628d91238549b062961e724088d3b8b Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 26 Nov 2024 03:23:31 -0500 Subject: Update :4 --- src/wasp-utils.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/wasp-utils.el') diff --git a/src/wasp-utils.el b/src/wasp-utils.el index c0f4ec54..78751646 100644 --- a/src/wasp-utils.el +++ b/src/wasp-utils.el @@ -40,6 +40,10 @@ Return nil on error." (w/write-line (format "%s" line) face) (goto-char (point-max)))) +(defun w/append-file (s path) + "Append S to the file at PATH." + (f--write-bytes (encode-coding-string s 'utf-8) path t)) + (defmacro w/defstruct (name &rest body) "Define a structure with NAME (with the constructor under the w/ namespace). BODY is passed directly to `cl-defstruct'." @@ -54,7 +58,7 @@ BODY is passed directly to `cl-defstruct'." (defun w/pick-random (xs) "Pick a random element of XS." - (nth (random (length xs)) xs)) + (and xs (nth (random (length xs)) xs))) (defun w/shuffle (s) "Shuffle S." -- cgit v1.2.3