* src/keyboard.c (parse_solitary_modifier): If the argument SYMBOL
is not a symbol, don't try to recognize it. See
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00502.html
for the details.
* test/src/keymap-tests.el (keymap-where-is-internal-test): New
test, for testing the above fix.
int
parse_solitary_modifier (Lisp_Object symbol)
{
- Lisp_Object name = SYMBOL_NAME (symbol);
+ Lisp_Object name;
+
+ if (!SYMBOLP (symbol))
+ return 0;
+
+ name = SYMBOL_NAME (symbol);
switch (SREF (name, 0))
{
(should (eq (lookup-key Buffer-menu-mode-map [32]) 'undefined)))
(define-key Buffer-menu-mode-map [32] def))))
+(ert-deftest keymap-where-is-internal-test ()
+ "Make sure we don't crash when `where-is-preferred-modifier' is not a symbol."
+ (should
+ (equal (let ((where-is-preferred-modifier "alt"))
+ (where-is-internal 'execute-extended-command global-map t))
+ [#x8000078])))
+
(provide 'keymap-tests)
;;; keymap-tests.el ends here