GNU bug report logs - #21551
[PATCH] Fix Mac OS X key bindings bug

Previous Next

Package: emacs;

Reported by: Kai Yu Zhang <yeannylam <at> gmail.com>

Date: Thu, 24 Sep 2015 16:46:02 UTC

Severity: normal

Tags: patch

Merged with 19977, 21330

Found in version 24.4

Done: Philipp Stephani <p.stephani2 <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Anders Lindgren <andlind <at> gmail.com>
To: Kai Yu Zhang <yeannylam <at> gmail.com>, 21551 <at> debbugs.gnu.org,  Philipp Stephani <p.stephani2 <at> gmail.com>, Mikhail Gusarov <dottedmag <at> dottedmag.net>
Subject: bug#21551: Fix Mac OS X key bindings bug
Date: Wed, 30 Dec 2015 09:50:23 +0100
[Message part 1 (text/plain, inline)]
Hi,

I'm looking into a key binding bug on OS X reported multiple times (19977,
21330, 21551). Two different patches have been submitted.

The original code looks like:

      if (is_left_key)
        {
          emacs_event->modifiers |= parse_solitary_modifier
            (ns_command_modifier);

          /* if super (default), take input manager's word so things like
             dvorak / qwerty layout work */
          if (EQ (ns_command_modifier, Qsuper)
              && !fnKeysym
              && [[theEvent characters] length] != 0)
            {
              /* XXX: the code we get will be unshifted, so if we have
                 a shift modifier, must convert ourselves */
              if (!(flags & NSShiftKeyMask))
                code = [[theEvent characters] characterAtIndex: 0];

One of the patches simply removes the `if (EQ(...))' statement. The other
modifies the code to strip away modifiers.

First question: What is the code in the `if (EQ(...))' supposed to do? In
other words, what will stop working if it is removed?

Second question: if it is needed for the LEFT command key, should the
corresponding code be added for the RIGHT?

I've tested removing the `if' and Emacs still seems to be working as
intended, both with a normal key layout and when Dvorak is used. If no one
comes up with a reason to keep the code, I will remove it.

Third question: Does anybody know of a good way to automatically test
things like this? What I'm looking for is a way to send keystrokes like
Cmd-Alt-a to Emacs, that way it could be possible to write tests ensuring
that things like this don't break in the future.

    -- Anders Lindgren
[Message part 2 (text/html, inline)]

This bug report was last modified 7 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.