From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#21551: Fix Mac OS X key bindings bug Date: Wed, 30 Dec 2015 09:50:23 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1143a94cfd1a34052819a01b X-Trace: ger.gmane.org 1451465482 20105 80.91.229.3 (30 Dec 2015 08:51:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Dec 2015 08:51:22 +0000 (UTC) To: Kai Yu Zhang , 21551@debbugs.gnu.org, Philipp Stephani , Mikhail Gusarov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 30 09:51:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aECTP-0004p3-Vl for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Dec 2015 09:51:12 +0100 Original-Received: from localhost ([::1]:51561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aECTP-0002w0-6b for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Dec 2015 03:51:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aECTL-0002vt-6Z for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2015 03:51:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aECTG-0003wV-6I for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2015 03:51:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aECTG-0003wJ-1m for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2015 03:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aECTF-0000hc-Nw for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2015 03:51:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Dec 2015 08:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21551 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 21551-submit@debbugs.gnu.org id=B21551.14514654322662 (code B ref 21551); Wed, 30 Dec 2015 08:51:01 +0000 Original-Received: (at 21551) by debbugs.gnu.org; 30 Dec 2015 08:50:32 +0000 Original-Received: from localhost ([127.0.0.1]:49327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aECSm-0000gs-7l for submit@debbugs.gnu.org; Wed, 30 Dec 2015 03:50:32 -0500 Original-Received: from mail-vk0-f48.google.com ([209.85.213.48]:32833) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aECSj-0000ge-Gf for 21551@debbugs.gnu.org; Wed, 30 Dec 2015 03:50:30 -0500 Original-Received: by mail-vk0-f48.google.com with SMTP id a188so203035509vkc.0 for <21551@debbugs.gnu.org>; Wed, 30 Dec 2015 00:50:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=xaoqgzBGuw2fGdMLvk4m4D4ebzg8PlNGJ3amyWfItYA=; b=A5jloy3eEgYHrG4adc4kfIpTwWuI3D9bmHqnQscyXXJdnDxLALKjJ0J9vjKSe6D57N UBIw3sRT+ZbWu5oLGZ/Sd2kSwSmHIDeyKNqHWCgmZMk3TKAlULKe015hc1gybGi1LSxI Q6foDMSRcBf9mfhYeJndoiBQsKep9qaUceVNXsUOWfpnRGwGyn8AJi+2RSCr1Ob4mZgt tPHsha+E2BgzvrEM4+VY9vQ9v0mT2WlP4kHvZ0mPFnRVFlJ8P9W2rRSltWIvHxJfY6Qj ft/5HPAIxh0lzJTU/hmkoObtGSinavDJqV77JxXIWnxie757lhayVNbNlhepgmUJcaQY VL5Q== X-Received: by 10.31.146.66 with SMTP id u63mr36596017vkd.31.1451465423786; Wed, 30 Dec 2015 00:50:23 -0800 (PST) Original-Received: by 10.31.214.131 with HTTP; Wed, 30 Dec 2015 00:50:23 -0800 (PST) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111012 Archived-At: --001a1143a94cfd1a34052819a01b Content-Type: text/plain; charset=UTF-8 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 --001a1143a94cfd1a34052819a01b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

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

The original code looks= like:

=C2=A0 =C2=A0 =C2=A0 if (is_left_key)<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 emacs_event->modifiers |=3D parse_solitary_modifier
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (ns_command_modifier);

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* if super (default), t= ake input manager's word so things like
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dvorak / qwerty layout work */
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (EQ (ns_command_modifier, Qsuper)
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 && !fnKeysym
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 && [[theE= vent characters] length] !=3D 0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* = XXX: the code we get will be unshifted, so if we have
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0a shift modifier, must = convert ourselves */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 if (!(flags & NSShiftKeyMask))
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 code =3D [[theEvent characters] characte= rAtIndex: 0];

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

First question: What is the code i= n the `if (EQ(...))' supposed to do? In other words, what will stop wor= king 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= 9; 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 th= e code, I will remove it.

Third question: Does any= body 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.

=C2=A0 =C2=A0 -- Anders Li= ndgren

--001a1143a94cfd1a34052819a01b--