From acd71e2ebde2dac70a19646990a90a651ee0cc18 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 13 Aug 2023 12:05:01 -0700 Subject: add slime tweak to display random function doc at startup --- init-el.org | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/init-el.org b/init-el.org index e067cff..dea1143 100644 --- a/init-el.org +++ b/init-el.org @@ -1290,6 +1290,8 @@ association one shell with each [[*Perspectives Leader Key Menu][perspective aka <> +<> + <> #+end_src @@ -1437,6 +1439,35 @@ from debian contrib #+end_src +*** SLIME-TWEAKS + +#+name: slime-tweaks +#+begin_src elisp :noweb no-export + +(defun slime-random-words-of-encouragement () + "Return a string of hackerish encouragement." + (slime-eval + '(swank:documentation-symbol + (cl:loop :for name :being :each :symbol :in (cl:find-package "CL") + :collect (cl:symbol-name name) :into names + :count 1 :into size + :finally + (cl:let* ((rs (cl:make-random-state)) + (state (sb-kernel::random-state-state rs))) + (cl:dotimes (idx (cl:length state)) + (cl:setf (cl:elt state idx) + (cl:mod (cl:+ (cl:get-universal-time) + (cl:elt state idx)) + #xff))) + (cl:return (cl:elt names (cl:random size rs)))))))) + + + +#+end_src + +#+RESULTS: slime-tweaks +: slime-random-words-of-encouragement + *** Coalton -- cgit v1.2.3