aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.org2
-rw-r--r--sx-auth.el8
-rw-r--r--sx-inbox.el17
3 files changed, 17 insertions, 10 deletions
diff --git a/README.org b/README.org
index f3f1a83..2e34ef7 100644
--- a/README.org
+++ b/README.org
@@ -63,7 +63,7 @@ include:
SX is now available on MELPA! Both the stable release and the development
version can be found there. Install it via the Package Menu or just run
#+BEGIN_SRC text
-M-x package-install RET sx RET=
+M-x package-install RET sx RET
#+END_SRC
** Authenticating
diff --git a/sx-auth.el b/sx-auth.el
index 66968a5..ac3bb17 100644
--- a/sx-auth.el
+++ b/sx-auth.el
@@ -35,7 +35,7 @@
(defconst sx-auth-root
"https://stackexchange.com/oauth/dialog")
(defconst sx-auth-redirect-uri
- "http://seanallred.com/sx.el/auth/auth.htm")
+ "https://vermiculus.github.io/sx.el/auth/auth.htm")
(defconst sx-auth-client-id
"3291")
(defvar sx-auth-access-token
@@ -112,6 +112,9 @@ following privileges are requested:
* no_expiry
do not pester you to reauthorize again
+* private_info
+ TODO explanation.
+
After authorization with StackExchange, the user is then
redirected to a website managed by SX. The access token required
to use authenticated methods is included in the hash (which is
@@ -128,8 +131,7 @@ parsed and displayed prominently on the page)."
no_expiry
private_info
write_access))
- (redirect_uri . ,(url-hexify-string
- sx-auth-redirect-uri)))
+ (redirect_uri . ,sx-auth-redirect-uri))
","))))
(browse-url url)
(read-string "Enter the access token displayed on the webpage: ")))
diff --git a/sx-inbox.el b/sx-inbox.el
index 1f0f227..593128a 100644
--- a/sx-inbox.el
+++ b/sx-inbox.el
@@ -56,6 +56,12 @@
:type 'integer
:group 'sx)
+(defface sx-inbox-item-type
+ '((t :inherit font-lock-keyword-face)) "")
+
+(defface sx-inbox-item-type-unread
+ '((t :inherit font-lock-keyword-face :weight bold)) "")
+
(defun sx-inbox-get (&optional notifications page keywords)
"Get an array of inbox items for the current user.
If NOTIFICATIONS is non-nil, query from `notifications' method,
@@ -161,23 +167,22 @@ is an alist containing the elements:
(cond (.answer_id " on Answer at:")
(.question_id " on:")
(t ":")))
- 'face 'font-lock-keyword-face)
+ 'face (if .is_unread 'sx-inbox-item-type-unread 'sx-inbox-item-type))
(list
(concat (sx-time-since .creation_date)
sx-question-list-ago-string)
'face 'sx-question-list-date)
(list
- (propertize
- " " 'display
- (concat "\n " (propertize (or .title "") 'face 'sx-question-list-date) "\n"
+ (propertize " " 'display
+ (concat " " (propertize (or .title "") 'face 'sx-question-list-date) "\n"
(when .body
(let ((col fill-column))
(with-temp-buffer
(setq fill-column col)
- (insert " " .body)
+ (insert " " .body)
(fill-region (point-min) (point-max))
(buffer-string))))
- 'face 'default)))))))
+ "\n" ) 'face (if .is_unread 'bold 'default) ))))))
;;; Entry commands