Last active
August 29, 2015 14:07
-
-
Save PuercoPop/77607503c93dad5f7da0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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