emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] org-babel-header-arg-expand is rather cavalier about "appropriate context" [9.8-pre (release_9.7.10-127-g07dd3b @ /usr/local/share/emacs/site-lisp/org/)]
Date: Thu, 10 Oct 2024 14:21:40 -0400	[thread overview]
Message-ID: <b7d3b5c5-960b-4e21-87b6-b44f215aef4a@gmail.com> (raw)
In-Reply-To: <87iktzkfrt.fsf@localhost>

On 10/10/24 1:51 PM, Ihor Radchenko wrote:
> Nick Dokos <ndokos@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?

Sure - it'll take me a few days, but I should be able to get one 
togother by early next week.


Thanks!

-- 

Nick


>



  reply	other threads:[~2024-10-10 18:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-29  2:43 [BUG] org-babel-header-arg-expand is rather cavalier about "appropriate context" [9.8-pre (release_9.7.10-127-g07dd3b @ /usr/local/share/emacs/site-lisp/org/)] Nick Dokos
2024-10-10 17:51 ` Ihor Radchenko
2024-10-10 18:21   ` Nick Dokos [this message]
2024-10-16  1:55     ` [PATCH] `org-babel-header-arg-expand': more stringent check for appropriate context Nick Dokos
2024-10-18 17:43       ` Ihor Radchenko
2024-10-20 14:08         ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7d3b5c5-960b-4e21-87b6-b44f215aef4a@gmail.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).