Subject: bug#12045: 24.1.50; semantic :: Debugger entered--Lisp error: (wrong-type-argument syntax-table-p nil)

From: David Engster <[email-masked]>
Date: Fri, 12 Oct 2012 08:10:50 +0200

Stefan Monnier writes:
>> Regarding interactive commands, especially those with a pre-defined
>> keybinding, I'm not entirely sure what would be the best fix. The
>> easiest way would be if keymaps could be activated dependend on a
>> buffer-local variable, just as I can do that via the :visible attribute
>> for menu items.
>
> Minor mode keymaps work exactly this way (the minor-mode variable
> enables/disables the corresponding keymap).  But usually it's not
> necessary to disable a binding just because it's currently unusable.
> Just like most menu items use :enable rather than :visible, since that
> lets the user know that there is such a feature, even though it
> currently can't be used.

OK, so I will change the Semantic menu items to

:visible semantic-mode
:enable (semantic-active-p)

Regarding the key bindings however, I think we can agree that the
current situation needs improvement. The interactive commands usually
assume that the buffer was correctly set up for parsing and hence raise
some cryptic error if that isn't the case (see subject). So if the
keybindings should simply stay enabled in all buffers if semantic-mode
is active, I will have to add some `semantic-raise-error-if-unparsed'
function at the beginning of every interactive function.

-David