diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-22 11:37:35 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-22 11:37:35 -0200 |
commit | d51791fb6ae69e3b426f7d598920b4349858908f (patch) | |
tree | ccfed6af7baf30d276eb81ffd7642595d68e079b /sx.el | |
parent | 5675fc89e2b06b1533cb588368c1ffa4e414d0f4 (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.el | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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) |