emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* remedial elisp: treating result of plist-get as a string
@ 2015-06-15 18:55 Matt Price
  0 siblings, 0 replies; only message in thread
From: Matt Price @ 2015-06-15 18:55 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 2378 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 3408 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-15 18:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-15 18:55 remedial elisp: treating result of plist-get as a string Matt Price

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).