Article View: gnu.emacs.bug
Article #99621Problem in keyboard.c [18.55]
From: Steve Baur
Date: Tue, 31 Jul 1990 07:20
Date: Tue, 31 Jul 1990 07:20
51 lines
2530 bytes
2530 bytes
The following region of code in keyboard.c does a nasty thing under certain
conditions:
(From function read_key_sequence, file keyboard.c)
/* If C is not defined in either keymap
and it is an uppercase letter, try corresponding lowercase. */
if (NULL (global) && NULL (local) && UPPERCASEP (c))
{
global = !NULL (nextglobal)
? get_keyelt (access_keymap (nextglobal, DOWNCASE (c)))
: Qnil;
local = !NULL (nextlocal)
? get_keyelt (access_keymap (nextlocal, DOWNCASE (c)))
: Qnil;
/* If that has worked better that the original char,
downcase it permanently. */
if (!NULL (global) || !NULL (local))
{
keybuf[i] = c = DOWNCASE (c);
}
}
I have commented out this entire region of code to no ill effect.
Here is what is bad about it:
This has the effect of folding upper to lower case when you least expect it.
When redefining a key say ^XN (which in the default bindings is unbound),
using the (global-set-key) function interactively will rebind the ^Xn key
and not the ^XN key as expected. This all works correctly of course when
done from e-lisp.
It is plain wrong to call this kind of code out of a routine that gets called
when interactively binding keys.
I don't think there's any win anyway in folding case like this in an otherwise
case sensitive editor. Please consider removing it in the next official
release of Emacs. If people do actually use upper and lower case identically
when using prefix keymaps, then perhaps you want to use two versions of this
routine, the second being one that is only called out of global-set-key.
I am most pleased that in 2 years of (about) daily use this is the only
place where Emacs has bitten me with an actual bug.
Thank you.
--
steve@romulus.SEDD.TRW.COM baur
Technical Details
Message-ID:
<9007310720.AA03860@romulus.sedd.trw.com>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ROMULUS.SEDD.TRW.COM!baurShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,692913df174fbdd3,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-07-31 00:20:37 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ROMULUS.SEDD.TRW.COM!baur From: baur@ROMULUS.SEDD.TRW.COM (Steve Baur) Newsgroups: gnu.emacs.bug Subject: Problem in keyboard.c [18.55] Message-ID: <9007310720.AA03860@romulus.sedd.trw.com> Date: 31 Jul 90 07:20:37 GMT Sender: news@tut.cis.ohio-state.edu Reply-To: steve@romulus.sedd.trw.com (Steven L. Baur) Distribution: gnu Organization: GNUs Not Usenet Lines: 51 Posted: Tue Jul 31 08:20:37 1990