ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez via ntg-context <ntg-context@ntg.nl>
To: ConTeXt users <ntg-context@ntg.nl>
Cc: Pablo Rodriguez <oinos@gmx.es>
Subject: [NTG-context] unprotecting when defining in Lua
Date: Mon, 29 Apr 2024 17:22:37 +0200	[thread overview]
Message-ID: <3950da22-fd1e-6cd7-23e8-fca463fcd96c@gmx.es> (raw)

Dear list,

I have the following sample:

  \starttext
  \startluacode
    function document.test(str)
      context(str)
    end

    interfaces.definecommand {
      name = "testing",
      protected = false,
      macro = document.test,
    }
  \stopluacode

  \meaningfull\testing

  \def\test#1{#1}

  \meaningfull\test
  \stoptext

Which is the right way to use "interfaces.definecommand" to get a simple
command as in standard TeX?

I mean, no a non \permanent or non \protected command.

Many thanks for your help,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2024-04-29 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 15:22 Pablo Rodriguez via ntg-context [this message]
2024-04-29 16:04 ` [NTG-context] " Wolfgang Schuster
2024-04-29 16:21   ` Pablo Rodriguez via ntg-context
2024-04-29 17:32     ` Wolfgang Schuster
2024-04-29 18:21       ` Pablo Rodriguez via ntg-context

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=3950da22-fd1e-6cd7-23e8-fca463fcd96c@gmx.es \
    --to=ntg-context@ntg.nl \
    --cc=oinos@gmx.es \
    /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.
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 NNTP newsgroup(s).