Subject: Re: bug#15907: 24.3; Emacs crash due to substitute-command-keys and after-change-functions

From: Eli Zaretskii <[email-masked]>
Date: Sat, 16 Nov 2013 11:31:16 +0200

> Date: Fri, 15 Nov 2013 21:23:01 +0000 (GMT)
> From: Artur Malabarba <[email-masked]>
> 
> Emacs crashes whenever `substitute-command-keys' is invoked and one of
> the functions in `after-change-functions' contains a call similar to
> `(format "%s" 1)'.
> 
> To reproduce:
> 
> 1. Start `emacs -Q';
> 2. Evaluate the following two statements:
>        (add-hook 'after-change-functions (lambda (&rest a) (format "%s" 1)))
>        (substitute-command-keys "\\{emacs-lisp-mode-map}")
> 3. That's it. Emacs crashes.
> 
> The crash doesn't happen if you replace the number 1 with a string or
> a symbol, but it does also happen if you replace it with a list.

It no longer crashes after changes in trunk revision 115119.

> This is most annoying as it causes a crash whenever `describe-mode' is
> invoked.

Since you didn't show any real-life use cases, I'm not sure that the
result is what you wanted, please do check.