all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Matt Huszagh <huszaghmatt@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Fix behavior of lambda default header arg vars
Date: Sun, 05 Jun 2022 20:18:18 +0800	[thread overview]
Message-ID: <87ee035mnp.fsf@localhost> (raw)
In-Reply-To: <87o87abjm5.fsf@gmail.com>

Matt Huszagh <huszaghmatt@gmail.com> writes:

> :var header arguments can be provided multiple times. This is supported
> directly at the source block and through the default header argument
> facility. However, this was not handled correctly when the var was
> evaluated from a closure in a default header argument (only the last var
> was taken). This patch fixes that. I've also added documentation
> explaining how to set multiple vars in the default header argument
> facility.

Thanks for the patch and sorry for the late reply.

> -arbitrary function symbol (e.g. 'some-func), since org uses
> -lexical binding.  To achieve the same functionality, call the
> -function within a closure (e.g. (lambda () (some-func))).
> +evaluates to a string.  Some header arguments (e.g., :var for
> +some language backends) can be provided multiple times for a
> +source block.  This functionality is also supported for default
> +header arguments by providing the header argument multiple times
> +in the alist.  For example:
> +
> +'((:var . \"foo=\\\"bar\\\"\")
> +  (:var . \"bar=\\\"foo\\\"\"))
> +
> +A closure is evaluated when the source block is being
> +evaluated (e.g. during execution or export), with point at the
> +source block.  It is not possible to use an arbitrary function
> +symbol (e.g. 'some-func), since org uses lexical binding.  To
> +achieve the same functionality, call the function within a
> +closure (e.g. (lambda () (some-func))).

The new docstring is confusing. The same paragraph is talking about
closures, then multiple header args, and gives an example without
closures.

It would help if closure part and multi-variable part were split into
separate paragraphs. Also, the example is not helpful here. Are you
saying that _only some_ backends support multiple vars? Are there
backends that do not support? Or are you talking about multiple
assignments to the same variable?

Best,
Ihor


  parent reply	other threads:[~2022-06-05 12:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 14:57 [PATCH] Fix behavior of lambda default header arg vars Matt Huszagh
     [not found] ` <87y252bfr4.fsf@gmail.com>
2021-12-03  2:43   ` Matt Huszagh
2022-06-05 12:18 ` Ihor Radchenko [this message]
2022-06-05 16:00   ` Matt Huszagh
2022-06-11  2:47     ` Ihor Radchenko
2022-06-28  3:53       ` Matt Huszagh
2022-06-29 10:02         ` Ihor Radchenko
2022-07-08 23:12           ` Matt Huszagh
2022-07-09  5:23             ` 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

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

  git send-email \
    --in-reply-to=87ee035mnp.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=huszaghmatt@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.