emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] remedial elisp: treating result of plist-get as a string


From: Matt Price
Subject: [O] remedial elisp: treating result of plist-get as a string
Date: Mon, 15 Jun 2015 14:55:36 -0400

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 "address@hidden(.*\\)$" 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]