emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* BUG: eval macros not working anymore
@ 2021-05-24 16:42 Michael Dauer
  2021-05-25  9:14 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Dauer @ 2021-05-24 16:42 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]

at least not compatible with before.

Probably caused by commit 8abdbbee395f284f2262a89187d662eaf40080b1.

originally correct macro ("macroA" . "(eval
do-something-dynamically-at-macro-expansion)")

How should this be achieved now? (functionp "any-string") is nil

[-- Attachment #2: Type: text/html, Size: 405 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BUG: eval macros not working anymore
  2021-05-24 16:42 BUG: eval macros not working anymore Michael Dauer
@ 2021-05-25  9:14 ` Nicolas Goaziou
  2021-05-25 11:55   ` Michael Dauer
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2021-05-25  9:14 UTC (permalink / raw)
  To: Michael Dauer; +Cc: emacs-orgmode

Hello,

Michael Dauer <mick.dauer@gmail.com> writes:

> at least not compatible with before.
>
> Probably caused by commit 8abdbbee395f284f2262a89187d662eaf40080b1.
>
> originally correct macro ("macroA" . "(eval
> do-something-dynamically-at-macro-expansion)")
>
> How should this be achieved now? (functionp "any-string") is nil

I think you need to write

  ("macroA" . (lambda (&rest _) (do-something-dynamically-at-macro-expansion)))

Regards,
-- 
Nicolas Goaziou


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BUG: eval macros not working anymore
  2021-05-25  9:14 ` Nicolas Goaziou
@ 2021-05-25 11:55   ` Michael Dauer
  2021-05-25 15:51     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Dauer @ 2021-05-25 11:55 UTC (permalink / raw)
  To: Michael Dauer, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 710 bytes --]

How do you do this with a #+macro keyword with arguments?

The old implementation checked the string for a "(eval" prefix.

Nicolas Goaziou <mail@nicolasgoaziou.fr> schrieb am Di., 25. Mai 2021,
11:14:

> Hello,
>
> Michael Dauer <mick.dauer@gmail.com> writes:
>
> > at least not compatible with before.
> >
> > Probably caused by commit 8abdbbee395f284f2262a89187d662eaf40080b1.
> >
> > originally correct macro ("macroA" . "(eval
> > do-something-dynamically-at-macro-expansion)")
> >
> > How should this be achieved now? (functionp "any-string") is nil
>
> I think you need to write
>
>   ("macroA" . (lambda (&rest _)
> (do-something-dynamically-at-macro-expansion)))
>
> Regards,
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 1244 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BUG: eval macros not working anymore
  2021-05-25 11:55   ` Michael Dauer
@ 2021-05-25 15:51     ` Nicolas Goaziou
  2021-05-25 18:32       ` Michael Dauer
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2021-05-25 15:51 UTC (permalink / raw)
  To: Michael Dauer; +Cc: emacs-orgmode

Michael Dauer <mick.dauer@gmail.com> writes:

> How do you do this with a #+macro keyword with arguments?

As before, with "(eval ..."

I might be able to give you a more specific answer when your question is
more specific, i.e., with an ECM.

Regards,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BUG: eval macros not working anymore
  2021-05-25 15:51     ` Nicolas Goaziou
@ 2021-05-25 18:32       ` Michael Dauer
  2021-05-26 18:37         ` Michael Dauer
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Dauer @ 2021-05-25 18:32 UTC (permalink / raw)
  To: Michael Dauer, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 445 bytes --]

Sorry, maybe I did not test thoroughly enough. I'll do, and come back if
still necessary. thx

Nicolas Goaziou <mail@nicolasgoaziou.fr> schrieb am Di., 25. Mai 2021,
17:51:

> Michael Dauer <mick.dauer@gmail.com> writes:
>
> > How do you do this with a #+macro keyword with arguments?
>
> As before, with "(eval ..."
>
> I might be able to give you a more specific answer when your question is
> more specific, i.e., with an ECM.
>
> Regards,
>

[-- Attachment #2: Type: text/html, Size: 938 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BUG: eval macros not working anymore
  2021-05-25 18:32       ` Michael Dauer
@ 2021-05-26 18:37         ` Michael Dauer
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Dauer @ 2021-05-26 18:37 UTC (permalink / raw)
  To: Michael Dauer, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 865 bytes --]

Hi,

I can confirm that macros work a little bit differently (incompatible with
some custom code) in 9.4.6 than 9.4.5, but still fine and better.

The #+marco keyword behaviour seems unchanged. For programmatically added
macros the proposed lambda form works fine.

Please excuse my false report.

Thanks,
Michael

Am Di., 25. Mai 2021 um 20:32 Uhr schrieb Michael Dauer <
mick.dauer@gmail.com>:

> Sorry, maybe I did not test thoroughly enough. I'll do, and come back if
> still necessary. thx
>
> Nicolas Goaziou <mail@nicolasgoaziou.fr> schrieb am Di., 25. Mai 2021,
> 17:51:
>
>> Michael Dauer <mick.dauer@gmail.com> writes:
>>
>> > How do you do this with a #+macro keyword with arguments?
>>
>> As before, with "(eval ..."
>>
>> I might be able to give you a more specific answer when your question is
>> more specific, i.e., with an ECM.
>>
>> Regards,
>>
>

[-- Attachment #2: Type: text/html, Size: 1740 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-26 18:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 16:42 BUG: eval macros not working anymore Michael Dauer
2021-05-25  9:14 ` Nicolas Goaziou
2021-05-25 11:55   ` Michael Dauer
2021-05-25 15:51     ` Nicolas Goaziou
2021-05-25 18:32       ` Michael Dauer
2021-05-26 18:37         ` Michael Dauer

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).