From: Peter Graves <peter@ar...> - 2003-06-18 18:18:17
This morning's development snapshot is up (j 0.19.0.13, lisp 0.0.0.41):
http://armedbear.org/j.zip (source and documentation)
http://armedbear.org/j-jar.zip (just j.jar)
This snapshot tries to address the issues around custom keymaps and ad
hoc key mappings.
In the beginning, the way you customized key mappings involved writing
out a keymap file (using writeGlobalKeyMap or writeLocalKeyMap),
editing it to taste and then pointing to it from ~/.j/prefs.
This approach works, but it's unwieldy to have to do all that if you
just want to change one or two key mappings.
The solution to that problem was to support ad hoc key mappings, first
in init.bsh (which is deprecated as of the upcoming 0.20.0 release) and
more recently in init.lisp.
J has also always had the goal of not requiring the user to restart j
for changes in settings of any kind to take effect.
In the area of custom keymaps, if you edited one of your custom keymap
files, or if you edited ~/.j/prefs to point to a new custom keymap, I
originally thought it was important that the new mappings should take
effect automatically, as soon as you saved the file(s).
This brings up a problem, though: if you're using custom keymaps, and
also have some ad hoc mappings in init.lisp, then, when you edit a
keymap, the reloading of that keymap is likely to discard some or all
of the ad hoc mappings. This is most obviously the case if one of your
ad hoc mappings is actually undoing the effects of a mapping in the
custom keymap file (a situation which might come up if you're using
someone else's custom keymap file and want to tailor it a bit, in
init.lisp, for your own idiosyncrasies).
This is one of those problems that's probably more important in theory
than in practice: not very many people use custom keymaps, and of
those that do, not very many also have ad hoc mappings in init.lisp.
Long term, the solution is to get rid of ~/.j/prefs and custom keymaps
altogether and just use init.lisp, possibly in conjunction with an
optional configuration UI to insulate the user from some of the details.
Short term, here's what I've done in this snapshot:
1. By default, saving ~/.j/prefs (or the file containing a custom
keymap that's pointed to in ~/.j/prefs) no longer automatically
reloads the affected keymap(s) or makes any change to the key
mappings that are in effect.
2. There's a new command, reloadKeyMaps, that does what its name
suggests: all the custom keymaps (or j's internal defaults, if
there are no custom keymaps) are reloaded, and any ad hoc key
mappings are discarded.
3. If you use custom keymaps and don't care about ad hoc key
mappings, you can add this line to ~/.j/prefs:
autoReloadKeyMaps = true
and things will work just like they used to.
4. While I was at it, I added another new command, defaultKeyMaps,
that discards all custom key mappings (including ad hoc key
mappings) and restores j's internal defaults.
In addition, init.lisp is now documented (Alt X, "help init.lisp.html").
The documented command set for init.lisp is very small and corresponds
exactly to the documented command set for init.bsh (which is now
deprecated). As time goes by, the init.lisp command set will evolve and
improve; the short term goal is to support just enough commands to be
able to replace init.bsh.
I don't plan any more code changes before releasing 0.20.0.