APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1352241238 0
# Node ID 4d15e903800b152c8f2710467d8e0693dd054570
# Parent be87f507f5100953f14b0405f0ccbd825e941fe7
Be more careful about erroring with probable GNU-syntax keysyms, keymap.c
src/ChangeLog addition:
2012-11-06 Aidan Kehoe <kehoea(a)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.
diff -r be87f507f510 -r 4d15e903800b src/ChangeLog
--- a/src/ChangeLog Tue Nov 06 22:27:15 2012 +0000
+++ b/src/ChangeLog Tue Nov 06 22:33:58 2012 +0000
@@ -1,3 +1,12 @@
+2012-11-06 Aidan Kehoe <kehoea(a)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(a)parhasard.net>
* keymap.c (event_binding):
diff -r be87f507f510 -r 4d15e903800b src/keymap.c
--- a/src/keymap.c Tue Nov 06 22:27:15 2012 +0000
+++ b/src/keymap.c Tue Nov 06 22:33:58 2012 +0000
@@ -1344,7 +1344,11 @@
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
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches