Commits

Aidan Kehoe committed 4d15e90

Be more careful about erroring with probable GNU-syntax keysyms, keymap.c

src/ChangeLog addition:

2012-11-06 Aidan Kehoe <kehoea@parhasard.net>

* keymap.c (define_key_check_and_coerce_keysym):
When worrying about GNU Emacs-like keysym syntax, if the symbol
name starts with c-whatever (or s-whatever, or m-whatever), check
for a function binding for that before erroring. Otherwise command
remapping and C mode interact badly, since most of the C mode
commands are regarded as GNU Emacs-style keysyms.

  • Participants
  • Parent commits be87f50

Comments (0)

Files changed (2)

File src/ChangeLog

+2012-11-06  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* keymap.c (define_key_check_and_coerce_keysym):
+	When worrying about GNU Emacs-like keysym syntax, if the symbol
+	name starts with c-whatever (or s-whatever, or m-whatever), check
+	for a function binding for that before erroring. Otherwise command
+	remapping and C mode interact badly, since most of the C mode
+	commands are regarded as GNU Emacs-style keysyms.
+
 2012-11-06  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* keymap.c (event_binding):

File src/keymap.c

 	 sanitize the Sun keyboards, and would make it trickier to
 	 conditionalize a .emacs file for multiple X servers.
 	 */
-      if (((int) qxestrlen (name) >= 2 && name[1] == '-')
+      if (((int) qxestrlen (name) >= 2 && name[1] == '-'
+	   /* Check for a function binding if the symbol looks like
+	      c-..., otherwise command remapping and C mode interact
+	      badly. */
+           && NILP (Ffunctionp (XSYMBOL_FUNCTION (*keysym))))
 #if 1
           ||
 	  /* Ok, this is a bit more dubious - prevent people from doing things