aboutsummaryrefslogtreecommitdiff
path: root/sx.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-12-22 11:37:35 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-12-22 11:37:35 -0200
commitd51791fb6ae69e3b426f7d598920b4349858908f (patch)
treeccfed6af7baf30d276eb81ffd7642595d68e079b /sx.el
parent5675fc89e2b06b1533cb588368c1ffa4e414d0f4 (diff)
Refactor .site to .site_par
It turns out some api objects do have a site property, except its value is not a string, it is another object. The actual string we've been referring to as .site is the .site.api_site_parameter To avoid conflicts, I've renamed all our uses of .site to .site_par, and sx-assoc-let now makes sure the object has a .site_par value, instead of a .site value (which it may or may not have now, and is the same object that the api refers to as site).
Diffstat (limited to 'sx.el')
-rw-r--r--sx.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/sx.el b/sx.el
index cda1acd..78995a8 100644
--- a/sx.el
+++ b/sx.el
@@ -303,9 +303,12 @@ DATA can also be the link itself."
DATA can be a question, answer, comment, or user (or any object
with a `link' property)."
(when data
- (unless (assq 'site data)
- (setcdr data (cons (cons 'site (sx--site data))
- (cdr data))))
+ (let-alist data
+ (unless .site_par
+ (setcdr data (cons (cons 'site_par
+ (or .site.api_site_parameter
+ (sx--site data)))
+ (cdr data)))))
data))
(defmacro sx-assoc-let (alist &rest body)