Skip to content

Commit

Permalink
Define github-with-auth-info before it is used.
Browse files Browse the repository at this point in the history
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
oyvindio authored and defunkt committed Jul 9, 2010
1 parent fc45810 commit 6aa8b00
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions gist.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.