aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-11-12 21:19:31 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-11-12 21:19:31 +0000
commit08eea895f1a445156c2e1c382bf167ba6d9d4515 (patch)
treee4fc73e5a4ffef0c94550c56548125ca70232925
parent67adfdc14d882d2cc208476b0fc15929161433e6 (diff)
Update code to new assoc-let
-rw-r--r--sx-filter.el2
-rw-r--r--sx-question-list.el16
-rw-r--r--sx-request.el9
-rw-r--r--sx.el2
4 files changed, 15 insertions, 14 deletions
diff --git a/sx-filter.el b/sx-filter.el
index aa815a2..acd8fc1 100644
--- a/sx-filter.el
+++ b/sx-filter.el
@@ -54,7 +54,7 @@ or string."
"filter/create"
keyword-arguments)))
(sx-assoc-let (elt response 0)
- (url-hexify-string filter)))))
+ (url-hexify-string .filter)))))
;;; Storage and Retrieval
diff --git a/sx-question-list.el b/sx-question-list.el
index caf24b1..ebd4e97 100644
--- a/sx-question-list.el
+++ b/sx-question-list.el
@@ -205,26 +205,26 @@ Used in the questions list to indicate a question was updated \"4d ago\"."
(list
data
(vector
- (list (int-to-string score)
- 'face (if upvoted 'sx-question-list-score-upvoted
+ (list (int-to-string .score)
+ 'face (if .upvoted 'sx-question-list-score-upvoted
'sx-question-list-score))
- (list (int-to-string answer_count)
- 'face (if (sx-question--accepted-answer data)
+ (list (int-to-string .answer_count)
+ 'face (if (sx-question--accepted-answer .data)
'sx-question-list-answers-accepted
'sx-question-list-answers))
(concat
(propertize
- title
- 'face (if (sx-question--read-p data)
+ .title
+ 'face (if (sx-question--read-p .data)
'sx-question-list-read-question
;; Increment `sx-question-list--unread-count' for the mode-line.
(cl-incf sx-question-list--unread-count)
'sx-question-list-unread-question))
(propertize " " 'display "\n ")
- (propertize (concat (sx-time-since last_activity_date)
+ (propertize (concat (sx-time-since .last_activity_date)
sx-question-list-ago-string)
'face 'sx-question-list-date)
- (propertize (concat " [" (mapconcat #'identity tags "] [") "]")
+ (propertize (concat " [" (mapconcat #'identity .tags "] [") "]")
'face 'sx-question-list-tags)
(propertize " " 'display "\n"))))))
diff --git a/sx-request.el b/sx-request.el
index 56362fc..f8feb22 100644
--- a/sx-request.el
+++ b/sx-request.el
@@ -107,15 +107,16 @@ number of requests left every time it finishes a call.")
(error "Response could not be read by `json-read-from-string'"))
;; If we get here, the response is a valid data structure
(sx-assoc-let response
- (when error_id
+ (when .error_id
(error "Request failed: (%s) [%i %s] %S"
- method error_id error_name error_message))
+ .method .error_id .error_name .error_message))
(when (< (setq sx-request-remaining-api-requests
- quota_remaining)
+ .quota_remaining)
sx-request-remaining-api-requests-message-threshold)
(sx-message "%d API requests reamining"
sx-request-remaining-api-requests))
- items)))))))
+ :hi
+ .items)))))))
;;; Support Functions
diff --git a/sx.el b/sx.el
index 34be85e..7ed56d3 100644
--- a/sx.el
+++ b/sx.el
@@ -81,7 +81,7 @@ symbol, the cdr is the symbol without the `.'."
(when (string-match "\\`\\." name)
;; Return the cons cell inside a list, so it can be appended
;; with other results in the clause below.
- (list (cons data (intern (replace-match "" name)))))))
+ (list (cons data (intern (replace-match "" nil nil name)))))))
((not (listp data)) nil)
(t (apply
#'append