in pursuit of the zotero integration I discussed in other threads, I am
trying to write one simple little function to extend Erik's code, and
failing. Since I'm flailing and going to bed soon: can anyone see what's
wrong with this function?
The results are generated perfectly well, but the return value of hte
function is
[cl-struct-deferred deferred:default-callback deferred:default-errorback
deferred:default-cancel nil nil nil] [2 times]
whereas I want something like:
"
Suchman, Lucy. “Subject Objects.” Feminist
Theory 12, no. 2 (August 1, 2011): 119–45.
http://resolver.scholarsportal.info/resolve/14647001/v12i0002/119_so.xml
.
"
-------
(defun org-zotxt-get-html-bib (key)
;; (with-output-to-temp-buffer "*help2*"
;; (print key))
(lexical-let ((d (deferred:new)))
(request
(format "%s/items" zotxt-url-base)
:params `(("key" . ,key)
("format" . "bibliography"))
:parser 'json-read
:success (function*
(lambda (&key data &allow-other-keys)
;; (with-output-to-temp-buffer "*debug*"
;; (print data))
(let* ((results (mapcar (lambda (e)
(cdr (assq 'html e))
)
data))
)
(with-output-to-temp-buffer "*debug*"
(print results))
(results)
(deferred:callback-post
d (if (null results) nil
;; `((:key ,key :citation ,results))
(results)
))
))
)
)
d))
-------------------
thanks again!
Matt