From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#28215: 26.0.50; Option-Clover-H Date: Thu, 24 Aug 2017 21:24:27 +0100 Message-ID: <20170824202427.GA47224@breton.holly.idiocy.org> References: <0FA7C1C0-CA6F-402A-BF7E-62FB3A3D82CC@jovi.net> <20170824193447.GA46573@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ZPt4rx8FFjLCG7dd" Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1503606321 12051 195.159.176.226 (24 Aug 2017 20:25:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 24 Aug 2017 20:25:21 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: 28215@debbugs.gnu.org To: Devon Sean McCullough Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 24 22:25:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkygb-0002Oa-RK for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Aug 2017 22:25:06 +0200 Original-Received: from localhost ([::1]:50391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkygi-0007Dt-IC for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Aug 2017 16:25:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkygd-0007DC-9q for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 16:25:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkygY-0000OD-UC for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 16:25:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44550) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dkygY-0000O0-OJ for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 16:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dkygY-0003PY-CW for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2017 16:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Aug 2017 20:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28215 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28215-submit@debbugs.gnu.org id=B28215.150360628013079 (code B ref 28215); Thu, 24 Aug 2017 20:25:02 +0000 Original-Received: (at 28215) by debbugs.gnu.org; 24 Aug 2017 20:24:40 +0000 Original-Received: from localhost ([127.0.0.1]:53231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkygC-0003Ot-5V for submit@debbugs.gnu.org; Thu, 24 Aug 2017 16:24:40 -0400 Original-Received: from mail-wr0-f170.google.com ([209.85.128.170]:33273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkyg9-0003Of-Pp for 28215@debbugs.gnu.org; Thu, 24 Aug 2017 16:24:38 -0400 Original-Received: by mail-wr0-f170.google.com with SMTP id f8so1745162wrf.0 for <28215@debbugs.gnu.org>; Thu, 24 Aug 2017 13:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=+u8vt50TbdqU0HHkGagRwCjT5nAydtAO+dnFAQCwunU=; b=Y5G86fW73g3NwWAP4Gixzd86okk12XFLkDLmqCqY2SYou6fepMYLyYHUjYX7yp4tZH XN+m3achSmwkJM8o15lSoX2HYn4Y50Ypazyx/5qYyBf9DCIAkBYZjbmAYcHlAXMRyyKt GgoUkRVlZZ2IMBWbez2X8afFoYieSxOeEnw8jvcT9KPekvILUYcVwpEs+k2hhYknwC3G RImOvHpvCNVcIRYgjiPrzd40MNYIBZk9QZlcx5epiBP5aLgJNZL2jOPSp6VaOSUha9O2 uTWLyA8qKkJlLEJJtpdwZijt2MdQ5o9vyr9ypxTJ4OxA8HvPmcQ3cTgW8GL+Cu66b1bx 788A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=+u8vt50TbdqU0HHkGagRwCjT5nAydtAO+dnFAQCwunU=; b=NgrGKA6xyyR7Pc4D+d0I17N/l7RfIXrT47d3QLc00sXSdzXRGjopFD3qK9RxfZ9EDd NoSE245mC+/JKF/7/eakIlpdaon7/9GaWxdmzfiAcu12g6uY4ydhCcN4YeIHvhngVmw5 CmsAUTpNxxZurxOPm5KlHW3yylDan0CF5YAWL0TzS4hFZzh32xJPiJB8vaivTzOz7pI9 ImuBwU383O7sQ6BPWaacoXxqnDek5UdYdSTVMiJFv9G/5IPKQ4AmNCgcmd6tt/D5Yftk cQPfn0XoCoCMllCjH++6l3ppPGE5jyxD62iLZlYBXlB5D/yxY3r8yevluC6oReSZJt9A Qu6Q== X-Gm-Message-State: AHYfb5gUSkcTQtZlKKBVyRPIfPiqu2C7zrDaEScmPy3aflxmwf4CQ8fy rz7T7IL626JHDTZyG7nYWg== X-Received: by 10.223.174.232 with SMTP id y95mr5338054wrc.56.1503606271957; Thu, 24 Aug 2017 13:24:31 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-8112-602e-83ce-eeab.holly.idiocy.org. [2001:8b0:3f8:8129:8112:602e:83ce:eeab]) by smtp.gmail.com with ESMTPSA id 5sm2821944wrf.0.2017.08.24.13.24.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Aug 2017 13:24:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20170824193447.GA46573@breton.holly.idiocy.org> 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" Xref: news.gmane.org gmane.emacs.bugs:136169 Archived-At: --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Aug 24, 2017 at 08:34:47PM +0100, Alan Third wrote: > It looks like the problem is at nsterm.m:6122. I don’t understand what > the point of that code is. It looks like it’s trying to work around > some problem with different keyboard layouts. Attached is a patch that adds the M-s-h shortcut, and removes the code that treats the super key as special. If anyone can tell me why that code was there that would be great, but it seems to work fine without it. It’s been there since the NS port was merged into GNU Emacs, so I wonder if it’s required on some old *step implementation. -- Alan Third --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Correct-hide-others-shortcut-on-macOS-bug-28215.patch" >From 8fbe6096fcb4ca37185120bc629a55741c8e15f5 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Thu, 24 Aug 2017 21:08:16 +0100 Subject: [PATCH] Correct "hide others" shortcut on macOS (bug#28215) * src/nsterm.m (EmacsView::keyDown): Remove code that forces system keymap when pressing cmd (super) key. * lisp/term/ns-win.el: Add new shortcut for ns-do-hide-others. --- lisp/term/ns-win.el | 1 + src/nsterm.m | 36 +----------------------------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index 8848360655..776add98af 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -124,6 +124,7 @@ global-map (define-key global-map [?\s-g] 'isearch-repeat-forward) (define-key global-map [?\s-h] 'ns-do-hide-emacs) (define-key global-map [?\s-H] 'ns-do-hide-others) +(define-key global-map [?\M-\s-h] 'ns-do-hide-others) (define-key global-map [?\s-j] 'exchange-point-and-mark) (define-key global-map [?\s-k] 'kill-current-buffer) (define-key global-map [?\s-l] 'goto-line) diff --git a/src/nsterm.m b/src/nsterm.m index 22f8efd6b9..ccf7fd5238 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6106,41 +6106,7 @@ flag set (this is probably a bug in the OS). : ns_right_command_modifier); 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 & NSEventModifierFlagShift)) - code = [[theEvent characters] characterAtIndex: 0]; -#if 0 - /* this is ugly and also requires linking w/Carbon framework - (for LMGetKbdType) so for now leave this rare (?) case - undealt with.. in future look into CGEvent methods */ - else - { - long smv = GetScriptManagerVariable (smKeyScript); - Handle uchrHandle = GetResource - ('uchr', GetScriptVariable (smv, smScriptKeys)); - UInt32 dummy = 0; - UCKeyTranslate ((UCKeyboardLayout *) *uchrHandle, - [[theEvent characters] characterAtIndex: 0], - kUCKeyActionDisplay, - (flags & ~NSEventModifierFlagCommand) >> 8, - LMGetKbdType (), kUCKeyTranslateNoDeadKeysMask, - &dummy, 1, &dummy, &code); - code &= 0xFF; - } -#endif - } - } + emacs_event->modifiers |= parse_solitary_modifier (ns_command_modifier); is_right_key = (flags & NSRightControlKeyMask) == NSRightControlKeyMask; is_left_key = (flags & NSLeftControlKeyMask) == NSLeftControlKeyMask -- 2.12.0 --ZPt4rx8FFjLCG7dd--