Created
June 14, 2011 16:20
-
-
Save skeptomai/1025251 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
| (require 'json) | |
| (defun file->filename (file) | |
| (cdr (assoc 'filename (cdr file)))) | |
| (defun file->content (file) | |
| (cdr (assoc 'content (cdr file)))) | |
| (defun gist-to-buffers (gist-buffer) | |
| (interactive "bGist Buffer: ") | |
| (let* ((gist-json (with-current-buffer "gist.json" | |
| (json-read-from-string (buffer-string)))) | |
| (gist-files (cdr (assoc 'files gist-json) ) )) | |
| (dolist (gist-file gist-files) | |
| (let* ((filename (file->filename gist-file)) | |
| (content (file->content gist-file))) | |
| (with-current-buffer (get-buffer-create filename) | |
| (insert content)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment