Ignacio Casso <[email protected]> writes: > Ignacio Casso <[email protected]> writes: > >> Here it is, let me know what you think. > > Sorry, I just realized I had an uncommited change. The correct patch is > the following:
> From b2f9c3aebef8768e9618e81848aaae3330cf3c7d Mon Sep 17 00:00:00 2001 > From: Ignacio Casso <[email protected]> > Date: Mon, 9 Mar 2026 20:02:39 +0100 > Subject: [PATCH] fix and extend org-babel-update-intermediate variable > > * lisp/ob-ref.el (org-babel-update-intermediate): make variable custom > and add `cached` as new possible value to only update intermediate > blocks when they have the :cache yes header argument > > * lisp/ob-ref.el (org-babel-ref-resolve): Fix usage of > `org-babel-update-intermediate` so that it only affects the :results > "none" header argument (before it was also affecting other header > arguments like parameter values, which resulted in a bug) > > * lisp/ob-core.el (org-babel-execute-src-block): Use the cache header > argument and `org-babel-update-intermediate` to decide whether > :results "none" header argument should be ignored. This allows results > of cached blocks to be actually cached also when the block is > evaluated indirectly as a dependency of another block. > See https://list.orgmode.org/orgmode/[email protected] This is minor, but could you please follow https://orgmode.org/worg/org-contribute.html#commit-messages format? > - (unless (member "none" result-params) > + (unless (and (member "none" result-params) > + (not (and cache > + (eq 'cached > org-babel-update-intermediate)))) What if there is :results silent? > -(defvar org-babel-update-intermediate nil > - "Update the in-buffer results of code blocks executed to resolve > references.") > +(defcustom org-babel-update-intermediate nil > + "Update the in-buffer results of code blocks executed to resolve > references. > + > +If value is nil they will never be updated. If value is non-nil they > +will always be updated. A value of ‘cached’ means to only update them if > +the block has the cache header argument set to yes. This is needed > +for the cache feature to work properly, as it relies on source block > +results being printed in the Org buffer." > + :group 'org-babel > + :type 'boolean) Please add :package-version and :type. Also, use `cached' to quote symbol. > - (and > - (not org-babel-update-intermediate) > - params)))) > + (if (and > org-babel-update-intermediate > + (not (eq 'cached > org-babel-update-intermediate))) > + args > + params)))) What about babel calls? -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>
