Subject: bug#283: scan-error for keyboard macro

From: "Roland Winkler" <[email-masked]>
Date: Wed, 21 May 2008 04:58:17 +0200

On Tue May 20 2008 Stefan Monnier wrote:
> The problem is a known one: the emacs-lisp-mode and its
> syntax-table does not properly recognize all the escaping going on
> in character constants. E.g. in ?\C-[, the mode thinks this opens
> a square bracket expression. If you add \ in front of the [ the
> problem will disappear.

Thanks a lot, if the backslash in front of the [ can solve this
problem, then this is even an adequate fix for an existing
collection of keyboard macros.

> So we could fix it either by improving the Elisp code (i.e. either
> improve syntax.c to be able to understand it, or add
> a font-lock-syntactic-keywords), or by changing the printer code to
> escape those chars with a \.  Can you confirm that the patch below
> fixes it?
> 
> I wasn't very awak when I wrote that patch. The patch below seems
> to actually work.

I loaded the file that contains my keyboard macros and I created it
again with the patched version of insert-kbd-macro. The only
difference between the old and new file was the \ in front of the [.
So on that level I can say that your patch has fixed my problem with
apparently no undesired side effects.

Thanks a lot,

Roland