Open joshbax189 opened 1 week ago
This is actually a weird emacs thing:
> emacs --batch --eval "(message \"hi\")" 1>/dev/null
hi
> emacs --batch --eval "(message \"hi\")" 2>/dev/null
# nothing
From the man page
--batch Edit in batch mode. The editor will send messages to stderr. You must use -l and -f options to specify files to execute and functions to call.
Same for the --script
flag, it seems.
So is eask
a wrapper for emacs --script
or is it "npm for emacs"? :smiley:
Hmmm… the same issue should have been solved a long while ago. See #124.
So is eask a wrapper for emacs --script or is it "npm for emacs"? 😃
Eask is the wrapper for emacs —script
. Eask is not trying to hide any bugs from Emacs; therefore, the nodejs layer should forward all stdin, stdout, and stderr.
Ah sorry, I didn't search hard enough, now I found https://github.com/emacs-eask/cli/issues/123
Now I see that some commands do output to stdout,
just not the ones I chose to test with!
My main problem was eask analyze
only outputs to stderror
or nothing. This was confusing, as IMO the warnings are the expected output. I'll change the issue to specifically that.
PS: a side-effect of the above observation about emacs' --script
option is that eask messages can't be separated from program messages when running eask eval
, e.g.
> eask eval '(message "hello")'
Warning (package): Package lacks a terminating comment
Warning (emacs): Unmatched dependency 'emacs'; add (emacs "VERSION") to package-file or consider removing it
Updating environment variables... done ✓
Exporting environment variables... done ✓
hello
But then, if I want to hide the diagnostic messages:
> eask eval '(message "hello")' 2>/dev/null
# no output
All of the message output of eask eval
is gone too.
My main problem was eask analyze only outputs to stderror or nothing. This was confusing, as IMO the warnings are the expected output. I'll change the issue to specifically that.
Yeah, the analyze command only output to the stderr stream. See
We can change to standard output instead. :)
All of the message output of eask eval is gone too.
Hmm... the eval
command did forward all standard streams. 🤔
Thanks for checking!
Hmm... the eval command did forward all standard streams
Sorry this was a little off-topic from the main issue. My point was that both emacs and eask write to standard error, so when using the eask eval
command there's no easy way to separate eask output from emacs output. E.g. if I want eask eval
to exactly match emacs --script
how would I do it?
I wonder if the --verbose
option should hide eask messages, e.g. eask eval [form] -v 0
forbids Eask from printing any (own) messages.
Sorry, this was a little off-topic regarding the main issue.
No worries! I might have misunderstood your question! 😅
My point was that both emacs and eask write to standard error, so when using the
eask eval
command there's no easy way to separate eask output from emacs output. E.g. if I wanteask eval
to exactly matchemacs --script
how would I do it?
Do you mean the Node.js layer and Emacs outputs? Right now, there is no way to separate these outputs. We will have to change the command behavior. 🤔
I wonder if the --verbose option should hide eask messages, e.g. eask eval [form] -v 0 forbids Eask from printing any (own) messages.
Eask is hybrid (Node.js + Elisp), so it has to print something, or else it would have no outputs. 🤔
This means
eask analyze
does not play nicely in shell scripts.Specifically, I want to do
Some commands will separate output and error per #123
vs