emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thibaut Meyer via "General discussions about Org-mode." <emacs-orgmode@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Inconsistent org-babel tangle behaviour
Date: Sat, 28 Dec 2024 14:48:07 +0100	[thread overview]
Message-ID: <87frm7kjfs.fsf@thibaut.dev> (raw)
In-Reply-To: <87ikrb99n1.fsf@localhost> (Ihor Radchenko's message of "Sun, 22 Dec 2024 12:37:06 +0000")


> Here, a language is actually specified. The language is ":tangle" (there
> is nothing stopping anyone from creating a language name starting from
> colon).

I see. I just assumed that header arguments and switches were
"recognized" and not considered as the language if placed positionally
first.

> Src block without language could indeed be tangled in your case.

That would be indeed nice...

> However, if the :tangle value is set to something like "yes", there is
> no way or can deduce the tangle file name.

.. but I guess that this prevents us from supporting this use case.

> Usually, you can simply use "conf" or "text" language name as a
> placeholder.

It's true that once you know the behaviour, it's not that big of a deal to
do so.

>> The documentation states:
>> [Working with source code > Structure of Code Blocks]
>> "When ‘<language>’ identifier is omitted, the block also cannot have
>> ‘<switches>’ and ‘<header arguments>’."
>>
>> but, to my knowledge, there is no mention regarding the fact that the
>> headers assigned through the "header-args" property should not be
>> applied if a block has no language identifier.
>
> That part of the manual can be improved. Maybe something like below.
>
>   When =<language>= identifier is omitted, the block also should not
>   have =<switches>= and =<header arguments>=.  Otherwise, the first
>   switch/argument will be treated as =<language>=.
>
> Let me know if it clarifies things.

It does clarify things. In addition, I think that a small mention of
that "quirk" in the "Extracting Source Code" part of the manual would
also be in order. I'll send a patch shortly.

Thibaut


  reply	other threads:[~2024-12-28 14:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12  7:45 [BUG] Inconsistent org-babel tangle behaviour Thibaut Meyer via General discussions about Org-mode.
2024-12-22 12:37 ` Ihor Radchenko
2024-12-28 13:48   ` Thibaut Meyer via General discussions about Org-mode. [this message]
2024-12-29  8:42     ` Ihor Radchenko

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=87frm7kjfs.fsf@thibaut.dev \
    --to=emacs-orgmode@gnu.org \
    --cc=thibaut@thibaut.dev \
    --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).