* Get rid of the concept of `modspec': `getarg' now has `require' for
require specs and `module' for a module name (the latter is what all
previous uses of 'modspec except for ,require really needed); command
descriptions use "<require-spec>" and "<module>", documentation
adjusted as well.
* `module-name?' etc turn to `known-module' and `known-module-name',
with a saner behavior, and tests to keep it sane.
* This cleans up a lot of things. Two specific points: ,switch works
better with toplevel-defined modules (see the corresponding change in
the test suite), and also fixes PR 12148.
* Ensure that ,sh commands return void.
* Add tests for ,r with non-atomic require spec, and for use of $F in
,sh commands.
* Improved the test suite, including uses of `module+' so each file can
be run by itself to perform a subset of the tests.
* a single function to set up all environment parameters.
* improve `getarg's treatment of default thunk
* Add an error display handler that doesn't show the context and instead
add a ,bt command to show it.
For the record, a way to do this permanently is to add something like
this to your ~/.racketrc:
(eval '(begin
(saved-values-char #\~)
(defcommand eli "stuff" "eli says" ["Make eli say stuff"]
(printf "Eli says: ~a\n" (getarg 'line)))
(defcommand er #f "alias for errortrace" ["Runs errortrace"]
(run-command 'errortrace)))
(module->namespace 'xrepl/xrepl))
But this is too stupid even for a section that has "Hacking" in its title.
There should definitely be an organized way to do this. This will
require several things:
* A decent API for doing these things for user code. (So the above
`eval' turns to a `require' for your file which uses this API.) This
goes beyond just documenting what's in there -- there are issues to
resolve like some argument reading protocol (separating the
declaration of argument types from the command implementation code),
so a new command can call another with arguments that it reads.
* There should also be some ,set command for customization
options (reading and changing) and code to use the preference file for
doing that. I almost started to do this, but currently there are only
three values that this could apply to (`saved-values-char', `-number',
and `wrap-column' (which might be better to dump and use
`pretty-print-columns' instead)).
* Also, it might be nice to have some command to do the same for simple
aliases. (But this might get into shady parsing issues if it's more
than just "I want `foo' to be an alias for an existing `bar' command".)