Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pragma unknown-command = disallow and edit module don't play well together #1845

Open
1 task done
mschuwalow opened this issue Oct 7, 2024 · 1 comment
Open
1 task done

Comments

@mschuwalow
Copy link

What happened, and what did you expect to happen?

When using pragma unknown-command = disallow in a script and checking it via elvish --compileonly $script, elvish warns that everything in the edit: namespace is not defined. The natural fix for that seems to be to add a use edit to the script, but that causes the script to fail at runtime.

It would be nice to either make elvish --compileonly aware of the edit module or allow use edit.

Output of "elvish -version"

0.21.0

Code of Conduct

@xiaq
Copy link
Member

xiaq commented Oct 9, 2024

Hmm yes the edit: module is weird for historical reasons, it's not an importable module, but a special module directed put in the global namespace in interactive mode.

Allowing use edit is perhaps the best approach; it would also make it possible to start the TUI from a script, with a hypothetical API like:

use edit
edit:start-app

I'm rewriting the Elvish TUI and will take this into account.

@xiaq xiaq moved this from ❓Triage to 🎨Design in All Elvish issues Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🎨Design
Development

No branches or pull requests

2 participants