Re: How to get a block’s contents by name

2020-11-28 Thread John Kitchin
I would do this: #+BEGIN_SRC emacs-lisp (defun org-get-named-block-contents (name) (save-excursion (goto-char (point-min)) (let ((regexp (org-babel-named-src-block-regexp-for-name name))) (or (and (looking-at regexp) (progn (goto-char (match-beginning 1)) (line-beginning

Re: How to get a block’s contents by name

2020-11-27 Thread George Mauer
Well that pains me on a software-engineer-aip-design level but that works! Thanks a lot. On Fri, Nov 27, 2020 at 8:22 PM Kyle Meyer wrote: > George Mauer writes: > > > I'm trying to figure out how I could fetch the contents of another block > by > > name from an elisp script > > > > I've seen `o

Re: How to get a block’s contents by name

2020-11-27 Thread Kyle Meyer
George Mauer writes: > I'm trying to figure out how I could fetch the contents of another block by > name from an elisp script > > I've seen `org-sbe` but I just want to get the block contents, (ideally > with noweb and vars filled in - just as it would be tangled if we were to > tangle it) > > Ho

How to get a block’s contents by name

2020-11-27 Thread George Mauer
I'm trying to figure out how I could fetch the contents of another block by name from an elisp script I've seen `org-sbe` but I just want to get the block contents, (ideally with noweb and vars filled in - just as it would be tangled if we were to tangle it) How do I do that?