Permalink
Browse files

Define github-with-auth-info before it is used.

This makes the gist.el functions requiring github authentication
*work* when gist.el is autoloaded by emacs, e.g. when gist.el is
installed from ELPA.
  • Loading branch information...
1 parent fc45810 commit 6aa8b009a6b7658eccda43aad58c1d0ea20307dc @oyvindio oyvindio committed with defunkt Jul 8, 2010
Showing with 9 additions and 9 deletions.
  1. +9 −9 gist.el
View
@@ -84,6 +84,14 @@ posted.")
+(defmacro github-with-auth-info (login token &rest body)
+ "Binds the github authentication credentials to `login' and `token'.
+The credentials are retrieved at most once within the body of this macro."
+ (declare (indent 2))
+ `(let ((*github-auth-info* (github-auth-info)))
+ (destructuring-bind (,login . ,token) *github-auth-info*
+ ,@body)))
+
(defun* gist-request (url callback &optional params)
"Makes a request to `url' asynchronously, notifying `callback' when
complete. The github parameters are included in the request. Optionally
@@ -181,14 +189,6 @@ for the info then sets it to the git config."
(cons user token))))
-(defmacro github-with-auth-info (login token &rest body)
- "Binds the github authentication credentials to `login' and `token'.
-The credentials are retrieved at most once within the body of this macro."
- (declare (indent 2))
- `(let ((*github-auth-info* (github-auth-info)))
- (destructuring-bind (,login . ,token) *github-auth-info*
- ,@body)))
-
;;;###autoload
(defun gist-buffer (&optional private)
"Post the current buffer as a new paste at gist.github.com.
@@ -343,4 +343,4 @@ If the Gist already exists in a buffer, switches to it"
(switch-to-buffer-other-window gist-buffer)))))
(provide 'gist)
-;;; gist.el ends here.
+;;; gist.el ends here.

0 comments on commit 6aa8b00

Please sign in to comment.