emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* diagnosing SRC blocks with different output on export
@ 2020-07-27 12:35 Alexandre Duret-Lutz
  2020-09-04 16:12 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Duret-Lutz @ 2020-07-27 12:35 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Is there a way to mark certain SRC blocks such that if evaluating them
during export produces a result different from the one stored in the
file, then the export process aborts with an error?

I'm using org-mode to document an automaton library, and use org-babel
block to run some examples and have their output automatically
recomputed when the library is improved.  However, some examples
expect some specific automata to be produced, maybe because I discuss
some particularities of that example automaton in the text ; if an
update of the library causes this to change, I need to detect that
change to adjust all the text around it in the documentation, or find
a better exemple.   So I'd like org-mode to signal me that my expected
result is non-longuer what is produced by causing the export (and
therefore my build) to fail.

Can this be achieved already?

Reading https://orgmode.org/manual/Results-of-Evaluation.html it seems
like I'd like I'm asking for a new form of handling.  Something like
"compare" instead of "replace".

Best regards
-- 
Alexandre Duret-Lutz


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: diagnosing SRC blocks with different output on export
  2020-07-27 12:35 diagnosing SRC blocks with different output on export Alexandre Duret-Lutz
@ 2020-09-04 16:12 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2020-09-04 16:12 UTC (permalink / raw)
  To: Alexandre Duret-Lutz; +Cc: emacs-orgmode

Hi Alexandre,

Alexandre Duret-Lutz <adl@lrde.epita.fr> writes:

> Is there a way to mark certain SRC blocks such that if evaluating them
> during export produces a result different from the one stored in the
> file, then the export process aborts with an error?

Would it be enough to have a new hook called
`org-babel-before-insert-result-hook' that would run before inserting
ressults in `org-babel-insert-result'?

I haven't looked closely, and this requires that the former function
knows what to "replace" before replacing it, but seems feasible.

Also, I'd like to hear from others if they would use such a hook or
if this sounds too overengineered.

Thanks,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-04 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 12:35 diagnosing SRC blocks with different output on export Alexandre Duret-Lutz
2020-09-04 16:12 ` Bastien

Code repositories for project(s) associated with this 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).