Nick Dokos <ndo...@gmail.com> writes:

> This was reported by user @Addlai on Emacs SE. See
> https://emacs.stackexchange.com/questions/82276/stop-org-cycle-from-prompting-for-header-args
>
> `org-babel-header-arg-expand' is added to the hook
> `org-cycle-tab-first-hook' so when a TAB is pressed, the function is
> called to check whether the context is approrpiate to call
> `org-babel-enter-header-arg-w-completion'.
>
> But the only thing it checks is whether the preceding character is a
> colon and whether we are in a source block (by calling
> `org-babel-where-is src-block-head'), so if one presses TAB inside a
> python source block after a colon, the context is deemed "appropriate"
> and you are asked for a header arg.

Confirmed.

> It should probably check that it's *on* the header line of the source
> block, not just that it is *inside* the header block.

Agree.
We need to compare the return value of
`org-babel-where-is-src-block-head' with point.

Would you be interested to submit a patch that fixes the issue?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>

Reply via email to