aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-12-12 15:12:54 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-12-12 15:12:54 +0000
commit79c03c20d14ddfe546c9f612bd9c8b1b1cb00b2c (patch)
treef90c2716d02c47da72075ee42c134ee6b5ea2893
parent8e73f901f46cbba4cb8650481464503844ebe81e (diff)
Autoload sx-authenticate
This also removes the sx-authenticate alias and renames sx-auth-authenticate to sx-authenticate. I did this because I felt it wasn't helpful to have both. Whenever I hit `M-x sx-au <TAB>` the only completions offered were two identical, but differently named, commands. That's useless at best, confusing at worst.
-rw-r--r--sx-auth.el5
-rw-r--r--sx-method.el2
2 files changed, 3 insertions, 4 deletions
diff --git a/sx-auth.el b/sx-auth.el
index b6c0411..fca5392 100644
--- a/sx-auth.el
+++ b/sx-auth.el
@@ -80,7 +80,8 @@ will be (METHOD . t)")
Keywords are of form (OBJECT TYPES) where TYPES is (FILTER FILTER
FILTER).")
-(defun sx-auth-authenticate ()
+;;;###autoload
+(defun sx-authenticate ()
"Authenticate this application.
Authentication is required to read your personal data (such as
notifications) and to write with the API (asking and answering
@@ -126,8 +127,6 @@ parsed and displayed prominently on the page)."
(error "You must enter this code to use this client fully"))
(sx-cache-set 'auth `((access_token . ,sx-auth-access-token)))))
-(defalias 'sx-authenticate #'sx-auth-authenticate)
-
(defun sx-auth--method-p (method &optional submethod)
"Check if METHOD is one that may require authentication.
If it has `auth-required' SUBMETHODs, or no submethod, return t."
diff --git a/sx-method.el b/sx-method.el
index 5646772..4575b0f 100644
--- a/sx-method.el
+++ b/sx-method.el
@@ -91,7 +91,7 @@ Return the entire response as a complex alist."
;; 1. Need auth and warn user (interactive use)
((and method-auth (equal 'warn auth))
(user-error
- "This request requires authentication. Please run `M-x sx-auth-authenticate' and try again."))
+ "This request requires authentication. Please run `M-x sx-authenticate' and try again."))
;; 2. Need auth to populate UI, cannot provide subset
((and method-auth auth)
(setq call 'sx-request-fallback))