branch: externals/oauth2
commit 1d80679ece3f66ad532f3abe0916ca60e12b23f8
Author: Xiyue Deng <manp...@gmail.com>
Commit: Sean Whitton <spwhit...@spwhitton.name>

    Reorder code to put defcustom/defvar at the beginning
    
    * packages/oauth2/oauth2.el: Put oauth2-token-file,
    oauth2--url-advice, and oauth--token-data to the beginning.
    
    Co-authored-by: Aleksandr Vityazev <avitya...@posteo.org>
---
 oauth2.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/oauth2.el b/oauth2.el
index c3aa45ed69..eccf439130 100644
--- a/oauth2.el
+++ b/oauth2.el
@@ -53,9 +53,17 @@
   :link '(url-link :tag "Savannah" 
"https://git.savannah.gnu.org/cgit/emacs/elpa.git/tree/?h=externals/oauth2";)
   :link '(url-link :tag "ELPA" "https://elpa.gnu.org/packages/oauth2.html";))
 
+(defcustom oauth2-token-file (concat user-emacs-directory "oauth2.plstore")
+  "File path where store OAuth tokens."
+  :group 'oauth2
+  :type 'file)
+
 (defvar oauth2-debug nil
   "Enable verbose logging in oauth2 to help debugging.")
 
+(defvar oauth--url-advice nil)
+(defvar oauth--token-data)
+
 (defun oauth2--do-debug (&rest msg)
   "Output debug messages when `oauth2-debug' is enabled."
   (when oauth2-debug
@@ -174,11 +182,6 @@ TOKEN should be obtained with `oauth2-request-access'."
     auth-url client-id scope state redirect-uri)
    redirect-uri))
 
-(defcustom oauth2-token-file (concat user-emacs-directory "oauth2.plstore")
-  "File path where store OAuth tokens."
-  :group 'oauth2
-  :type 'file)
-
 (defun oauth2-compute-id (auth-url token-url scope client-id)
   "Compute an unique id based on URLs.
 This allows to store the token in an unique way."
@@ -222,9 +225,6 @@ This allows to store the token in an unique way."
           (if (string-match-p "\?" url) "&" "?")
           "access_token=" (oauth2-token-access-token token)))
 
-(defvar oauth--url-advice nil)
-(defvar oauth--token-data)
-
 (defun oauth2-authz-bearer-header (token)
   "Return `Authoriztions: Bearer' header with TOKEN."
   (cons "Authorization" (format "Bearer %s" token)))

Reply via email to