I think joe shouldn't print anything to its stderr by default - unless something goes wrong.
Here's a typical "screenshot":
egmont@foo:~$ joe --notite asdf qwer
Processing '/home/egmont/.joerc'...Processing '/etc/joe/ftyperc'...done
doneFile qwer not changed so no update needed
egmont@foo:~$
The two "processing... done" messages interleaving each other is ugly.
It gives info about whether or not the last file closed ("qwer" in this case) was saved or not, but no info about the other files ("asdf" in the example).
The info about "qwer" might very easily be misleading, e.g. if you saved it with ^KD and then quit with ^C it says "not changed so no update needed".
It's just noise with no actual useful information to me.
I'd prefer all these messages to vanish (by default - I'm fine with having a -debug option), just as it's done in vim, emacs, mcedit, nano and so on:
egmont@foo:~$ emacs -nw asdf qwer
egmont@foo:~$
stderr also gets messages related to parse errors in the rc files or the like. I think the point is to go inbetween the "Processing..." messages. The editor will still load because it will revert to the builtin files. On the other hand, if you have an error in a syntax file (and you start joe with a file that uses that syntax on the command line), those messages end up in the startup log buffer... this is the only place that is used, afaik.
So perhaps the opening messages should go into the startup log if there's an error. The ones at the end, I agree, can be done away with. (But I'll miss them a little).
How's this look (against latest Mercurial)? Maybe that startup log window is obnoxious, and could be replaced with a notification telling the user where to look.
I like it, although it might indeed be obnoxious or overkill. I'd also like if it just printed stuff to stderr and halted there. I really have no preference how errors are presented :) , I'd just like to make the default non-error behavior silent.
If you stick with the current design, an additional sentence along the lines of "this window won't appear if you fix this issues" could be nice.
Note: there's still a newline printed to stderr somewhere. It's probably to scroll up the contents in -notite mode when you quit, rather than overwriting the bottom line, but it causes an extra empty line in --notite mode. Maybe it could go to stdout instead, or made conditional for the -notite mode only. Not a big deal though.
No, I intentionally added the newline, but you're right it ought to be -notite only.
The "Processing" messages are useful when JOE needs to fall back from one configuration file to another -- in particular when they are interspersed with error messages. I'll also admit to having an ulterior motive: in Windows there is no stderr (there could be, but it's more difficult to do with a GUI and would likely still go unnoticed)... so having a way to display this stuff inside the editor is useful.
Don't know if you noticed, but if startup completely fails then the contents of the log will get dumped to stderr before exit.
That said, I'm not sure I like it yet. Perhaps part of my refactoring is OK -- at least it would enable the user to turn off the messages (with a little additional work), and it solves the discrepancy between errors in rc and errors in syntaxes (which currently only show on load). It could also surface load errors for other syntaxes later on (via Alt-X showlog).
OK, no rush, I'm happy waiting until you figure out something that you really like :)
Just FYI: I don't have Windows, hardly know anything about it, and would prefer to keep it this way.
I applied this patch to mercurial, but made some modifications:
There is now a flag to suppress the shutdown messages "noexmsg". The default is to print them.. we can argue about whether we should have them and modify the joerc file later.
I suppressed the extra linefeed mentioned above unless notite mode is enabled.
I improved the recent change to save the screen in the terminal scrollback buffer: it now emits extra linefeeds only if notite mode is enabled. Also there is a new flag "nolinefeeds" to suppress them even when in notite mode.
Fixed in [ed4e7c]
Related
Commit: [ed4e7c]