[climacs-devel] Issues with syntax-dependent command tables.
Troels Henriksen
athas at sigkill.dk
Fri Feb 3 15:55:18 UTC 2006
As far as I have experienced, Climacs currently has some rather
serious issues with syntax-dependent command tables. Command tables
that should be specialised to specific syntaxes, such as `lisp-table'
are instead inherited by the global `global-climacs-table', which is
then used to perform command-lookup, no matter the syntax of the
active buffer (the mechanisms needed to select a specific command
table based on the active buffer is available, in the form of
`find-applicable-command-table' from gui.lisp, but the command-table
slots in the syntax objects are not used, which causes the method to
default to the `global-climacs-table').
This behavior manifests as a bug when one uses Climacs with Swine
(from CLIM-desktop) loaded. Swine works by defining some commands in
`lisp-table', one of the command tables inherited by
`global-climacs-table'. One of these commands (`com-swine-space') is
bound to the #\Space gesture, which means that every time the spacebar
is pressed in a buffer using the `global-climacs-table' command table
(which is most of them), the Swine-command will be run. This command
assumes that the syntax of the current buffer is Lisp, and will thus
signal an error when it attempts to access nonexistant slots in the
buffers syntax object. This is obviously bad, as it seems to
effectively disable the spacebar in any buffer that is not in Lisp
syntax and which does not explicitly define a new command for the
#\Space gesture.
The problem seems to mainly be one of too tight integration of command
tables to core Emacs code. gui.lisp defines several command tables one
should expect to be defined in their respective files (`lisp-table'
should be defined in lisp-syntax.lisp IMHO - of course, this raises
another issue, as some commands in misc-commands.lisp refers to
`lisp-table', but they could be moved into a more specific file).
As an experiment, I have removed `global-climacs-table's dependency on
`lisp-table' and instead made `lisp-table' depend on
`global-climacs-table' (in order to get the basic navigation and
editing commands). It seems to work properly, so I believe it should
be trivial to perform a general cleanup of Climacs' command tables and
their interdependencies. Commands such as `com-eval-defun', which is
currently defined in misc-commands.lisp, could also be moved to
lisp-syntax.lisp.
Thoughts?
--
\ Troels "Athas" Henriksen
/\ sigkill.dk/blog (Danish)
More information about the climacs-devel
mailing list