Paul Bryan <[email protected]> writes:

> "Ben H. W." via "General discussions about Org-mode."
> <[email protected]> writes:
>> Suggested fix
>>
>> ┌────
>> │ (and (re-search-forward
>> │       (concat " " (regexp-quote block-name) " ends here") nil t)
>> │      (setq end (line-beginning-position)))
>> └────

I just noticed one potential edge case that can occur with the proposed fix. If 
a starting delimiter is found, but no matching end delimiter is found (e.g. if 
the tangled file was modified - perhaps mistakenly - sot that the end delimiter 
is corrupted), an error is signalled:

funcall-interactively: Wrong type argument: number-or-marker-p, nil

This is just from the (< mid end) comparison in the case end is nil. This is 
easily fixed, for example by initialising end to 0. As far as I can see, this 
should never cause any issues with the behaviour of 
org-babel-tangle-jump-to-org. With that fix, instead the user will see the 
message "Not in tangled code" instead of an error being signalled.

-- *Paul* 

Reply via email to