From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: remedial elisp: treating result of plist-get as a string Date: Mon, 15 Jun 2015 14:55:36 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013d1ea6d6d1080518930049 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4ZXp-0004Im-2R for emacs-orgmode@gnu.org; Mon, 15 Jun 2015 14:55:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4ZXn-0006Po-0x for emacs-orgmode@gnu.org; Mon, 15 Jun 2015 14:55:40 -0400 Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:34294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4ZXm-0006OY-Ey for emacs-orgmode@gnu.org; Mon, 15 Jun 2015 14:55:38 -0400 Received: by labbc20 with SMTP id bc20so27811641lab.1 for ; Mon, 15 Jun 2015 11:55:36 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode --089e013d1ea6d6d1080518930049 Content-Type: text/plain; charset=UTF-8 Hi, I'm looking at some old code Erik Hetzner wrote for me in January. I have an html string stored in a plist cell, and a function that converts an html string to org-mode syntax. I want to do something like this: (org-zotxt-htmlstring2org (plist-get item :citation-html)) But for whatever reason this doesn't produce a string. It might help to give a little context -- this is a very dirty hack intended to get zotero-beased bibliographies to display in ODT documents. I have no doubt there are better methods for this, but I am currently trying this: ;; zotxt (org-add-link-type "zotero" (lambda (rest) (zotxt-select-key (substring rest 15))) (lambda (path desc format) (if (string-match "^@\\(.*\\)$" desc) (cond ((eq format 'latex) (format "\\cite{%s}" (match-string 1 desc))) ((eq format 'md) desc) ((eq format 'html) (deferred:$ (zotxt-get-item-bibliography-deferred `(:key , (substring path 15))) (deferred:nextc it (lambda (item) (plist-get item :citation-html))) (deferred:sync! it))) ((eq format 'odt) (deferred:$ (zotxt-get-item-bibliography-deferred `(:key , (substring path 15))) (deferred:nextc it (lambda (item) (org-zotxt-htmlstring2org (plist-get item :citation-html)) )) (deferred:sync! it))) (t nil) nil)))) ----------- The html export is working perfectly well, but I am trying to get /something/ to display in odt export, and failing. (I realize that a further step will be required, namely, sending the org-mode string generated by org-zotxt-htmlstring2org through the odt export filter -- I don't have the faintest idea how to do that but am assuming it's possible). Hints appreciated, as always. Matt --089e013d1ea6d6d1080518930049 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdj48ZGl2PjxkaXY+PGRpdj5IaSw8YnI+PGJyPjwvZGl2PkkmIzM5 O20gbG9va2luZyBhdCBzb21lIG9sZCBjb2RlIEVyaWsgSGV0em5lciB3cm90ZSBmb3IgbWUgaW4g SmFudWFyeS7CoCA8YnI+PGJyPjwvZGl2PkkgaGF2ZSBhbiBodG1sIHN0cmluZyBzdG9yZWQgaW4g YSBwbGlzdCBjZWxsLCBhbmQgYSBmdW5jdGlvbiB0aGF0IGNvbnZlcnRzIGFuIGh0bWwgc3RyaW5n IHRvIG9yZy1tb2RlIHN5bnRheC7CoCBJIHdhbnQgdG8gZG8gc29tZXRoaW5nIGxpa2UgdGhpczo8 YnI+PGJyPjwvZGl2PsKgKG9yZy16b3R4dC1odG1sc3RyaW5nMm9yZyAocGxpc3QtZ2V0IGl0ZW0g OmNpdGF0aW9uLWh0bWwpKTxicj48YnI+PGJyPjwvZGl2PjxkaXY+QnV0IGZvciB3aGF0ZXZlciBy ZWFzb24gdGhpcyBkb2VzbiYjMzk7dCBwcm9kdWNlIGEgc3RyaW5nLsKgIEl0IG1pZ2h0IGhlbHAg dG8gZ2l2ZSBhIGxpdHRsZSBjb250ZXh0I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