<div dir="ltr">Hi Gary, <div><br></div><div>first idea that came to my mind is using the threading macro</div><div>(to my knowledge, this idiom has its origins in the Clojure </div><div>community, and it was then ported to Emacs Lisp; it is</div><div>defined in `dash.el`). </div><div><br></div><div>Here is how `my-html-src-block` could look like using it:</div><div><br></div><div>```</div><div>(require 'dash)<br><br></div><div>(defun larsen-my-html-src-block (src-block contents info)<br>  (let ((expanded-src-block (org-export-expand src-block contents t)))<br>    (org-html-src-block<br>     (-> (org-element-copy src-block)<br>         (org-element-put-property :language "org")<br>         (org-element-put-property :value expanded-src-block))<br>     contents info)))<br></div><div>```</div><div><br></div><div>You can notice I "lifted" the application of `org-html-src-block`, </div><div>and I removed all occurrences of the symbol `src-block-copy`:</div><div>thanks to the `->`, the value of the expression </div><div>`(org-element-copy src-block)` is used as first argument the </div><div>first time `org-element-put-property` is used, then the value </div><div>returned by it is injected as first parameter in the second (and last)</div><div>use of `org-element-put-property`.</div><div><br></div><div>I didn't test this extensively, but running it on a small org </div><div>file seems to be working fine. Let me know, I hope it helps.</div><div><br></div><div>I guess it's a matter of taste: one has to carefully inspect the </div><div>context (and know the idiom!) to figure out there is actually</div><div>no missing argument for `org-element-put-property`.</div><div><br></div><div>s.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 26, 2019 at 5:15 PM Gary Phillips <<a href="mailto:gary.phillips@rolmo.com">gary.phillips@rolmo.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi all,<div>I enjoyed yesterday’s meeting.<br><div>Thanks for letting me share my esoteric org-mode discoveries yesterday.</div><div>The attached org file contains elisp which implements the exporter.<br></div><div>Tillman was right to suspect my use of setq, at best it’s bad style so I fixed that.<br><div></div></div><div>Cheers</div><div>Gary</div><div><br></div></div></div></div>
_______________________________________________<br>
emacs-berlin mailing list<br>
<a href="mailto:emacs-berlin@emacs-berlin.org" target="_blank">emacs-berlin@emacs-berlin.org</a><br>
<a href="https://mailb.org/mailman/listinfo/emacs-berlin" rel="noreferrer" target="_blank">https://mailb.org/mailman/listinfo/emacs-berlin</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><a href="http://www.stefanorodighiero.net" target="_blank">www.stefanorodighiero.net</a></div>