Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Last active August 29, 2015 14:07
Show Gist options
  • Save PuercoPop/77607503c93dad5f7da0 to your computer and use it in GitHub Desktop.
Save PuercoPop/77607503c93dad5f7da0 to your computer and use it in GitHub Desktop.
(defun sly-copy-next-sexp (results key-name)
(kill-ring-save (point) (save-excursion (forward-sexp) (point)))
(cl-acons key-name (substring-no-properties (current-kill 0)) results))
(defun sly-extract-slyfuns ()
"Return a list of alists of the form ((slyfun-name ...) (slyfun-doc-string ...))."
(with-current-buffer "slynk.lisp"
(goto-char (point-min))
(cl-loop
with results = nil
while (search-forward "(defslyfun" nil t)
do
(setf results (sly-copy-next-sexp results 'slyfun-name))
(forward-sexp)
(forward-sexp) ;; lambda list
(forward-sexp)
(backward-sexp)
(when (string-equal "\"" (string (char-after)))
(setf results (sly-copy-next-sexp results 'slyfun-doc-string)))
collect results)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment