fix: tool bugs found in review audit
repl: env var was dead code (hardcoded 2s), empty frame gave misleading error check-tangle: show full SBCL output on compile failure, not filtered verify-repl: blacklist now configurable via VERIFY_REPL_EXCLUDE env var; regex tightened to ';; +REPL-VERIFIED:' from ';;.REPL.VERIFIED:' (ambiguous) org-eval: 1-based indexing to match repl-block; errors on out-of-range; errors on <1
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# Evaluate an org src block using Emacs batch mode
|
||||
# Usage: org-eval <org-file> [block-index]
|
||||
# If block-index is not provided, evaluates all blocks
|
||||
# block-index is 1-based (first block = 1).
|
||||
# If omitted, evaluates ALL blocks.
|
||||
|
||||
set -e
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: org-eval <org-file> [block-index]"
|
||||
echo " Evaluates src blocks in the org file"
|
||||
echo " If block-index is omitted, evaluates ALL blocks"
|
||||
echo " block-index is 1-based (first block = 1)"
|
||||
echo " If omitted, evaluates ALL blocks"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -23,15 +25,23 @@ fi
|
||||
echo "Evaluating: $ORG_FILE"
|
||||
|
||||
if [ -n "$BLOCK_INDEX" ]; then
|
||||
# 1-based indexing: subtract 1 for Emacs' dotimes (0-based)
|
||||
if [ "$BLOCK_INDEX" -lt 1 ]; then
|
||||
echo "Error: block-index must be 1 or greater" >&2
|
||||
exit 1
|
||||
fi
|
||||
SKIP=$((BLOCK_INDEX - 1))
|
||||
# Evaluate specific block
|
||||
emacs --batch \
|
||||
--load org \
|
||||
--eval "(setq org-confirm-babel-evaluate nil)" \
|
||||
--eval "(with-current-buffer (find-file-noselect \"$ORG_FILE\") \
|
||||
(goto-char (point-min)) \
|
||||
(dotimes (_ $BLOCK_INDEX) \
|
||||
(dotimes (_ $SKIP) \
|
||||
(org-babel-next-src-block)) \
|
||||
(org-babel-execute-src-block))"
|
||||
(if (org-in-src-block-p t) \
|
||||
(org-babel-execute-src-block) \
|
||||
(error \"Block $BLOCK_INDEX not found\")))"
|
||||
else
|
||||
# Evaluate all blocks
|
||||
emacs --batch \
|
||||
|
||||
Reference in New Issue
Block a user