GNU bug report logs - #44973
Add a macOS global hotkey function

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: j@HIDDEN; dated Mon, 30 Nov 2020 21:27:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 44973 <at> debbugs.gnu.org:


Received: (at 44973) by debbugs.gnu.org; 30 Dec 2020 11:01:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 30 06:01:22 2020
Received: from localhost ([127.0.0.1]:41986 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kuZEH-0006Kk-Sj
	for submit <at> debbugs.gnu.org; Wed, 30 Dec 2020 06:01:22 -0500
Received: from outbound.soverin.net ([116.202.65.218]:37561)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alan@HIDDEN>) id 1kuZEF-0006DC-5i
 for 44973 <at> debbugs.gnu.org; Wed, 30 Dec 2020 06:01:20 -0500
Received: from smtp.soverin.net (unknown [10.10.3.28])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
 (No client certificate requested)
 by outbound.soverin.net (Postfix) with ESMTPS id 461056008F;
 Wed, 30 Dec 2020 11:01:12 +0000 (UTC)
Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.142]) by
 soverin.net
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin;
 t=1609326071; bh=F6tzm8I1E+JhFz0OtbEfGjbRkTeK6a/7JdfbuoB0VAE=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
 b=GVjaEkqv+fPUEpVWHKV1fH/YEt4SwioeD6PgpvpxaXtoH5DDTEydH5DXqcFP5VtgO
 c2EHuHFV+w748R742q2QtaggwoQHGKS0WPTgUrS1aUcQP2dJVTKTVx7coM+1iYrHXQ
 neCArSZYxiffN08D24ijfoHxkdhU5q6XC9QoGympl1Ue4YccYcBAzQq0MsYlycXoGI
 VS1NGICE99OEQnB8qS2z75RJj0MB4E6ScmDw01I+mdQ9YAKeVKDRg+Sm54eZPvQgNT
 R42eSMfdJDeCqJoGIdDKbp/6P0uV4cPG9/hN3QL+tTQ/wRitzRIfI3NwaDc6dBVjtd
 mU1pug3PsGW6g==
Received: by breton.holly.idiocy.org (Postfix, from userid 501)
 id 86F66202952A37; Wed, 30 Dec 2020 11:01:09 +0000 (GMT)
Date: Wed, 30 Dec 2020 11:01:09 +0000
From: Alan Third <alan@HIDDEN>
To: j@HIDDEN
Subject: Re: bug#44973: Add a macOS global hotkey function
Message-ID: <X+xd9X+ecT1pNAlp@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>, j@HIDDEN,
 Lars Ingebrigtsen <larsi@HIDDEN>, 44973 <at> debbugs.gnu.org
References: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
 <874kkw9gmq.fsf@HIDDEN>
 <CAAgndd5jbXk+s7aY=X05wOaJ87T-GAza2EXZKxkVgUc1FRrOxQ@HIDDEN>
 <87lfdrhj4e.fsf@HIDDEN>
 <CAAgndd4nkkQZ0aDeXds_QSbSuKbzuzJ0U0tof+ocsN4BaUTdcg@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAAgndd4nkkQZ0aDeXds_QSbSuKbzuzJ0U0tof+ocsN4BaUTdcg@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 44973
Cc: 44973 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Tue, Dec 29, 2020 at 08:10:00PM -0800, j@HIDDEN wrote:
> Here is the patch to bind a global hotkey in mac. As long as Emacs is set as
> "trusted" in macOS preferences, the user can bind a two-key hotkey of the
> form [modifier-key] or a single-key modifier [function key], for example
> (mac-bind-global-hotkey [f1] 'tetris). Binding a three-key
> combo is left to a future patch.

Hi, thanks for this.

I'll leave it up to Lars and Eli whether this gets to go in, but I've
got a few comments:

+;; Copyright (C) 1993-1994, 2005-2020 Free Software Foundation, Inc.

Since this is a new file I'm pretty sure we just specify 2020 for
copyright.

+const char *const lispy_to_mac_function_keys[] =
+  {
+    "up", "down", "left", "right",          /* NSUpArrowfunctionKey    0xF700 */
+    "f1", "f2", "f3", "f4", "f5",           /* NSF1FunctionKey         0xF704 */
+    "f6", "f7", "f8", "f9", "f10",

I take it's not possible to use the existing keyboard IO stuff for
this? Like convert_ns_to_X_keysym?

+mac_parse_and_add_hotkey (Lisp_Object key, Lisp_Object lispfn, int hook)
 ^^^

We don't use mac_ in the NS port, we use ns_. I realise this code is
mac specific, but I'd rather not add a new function name prefix, not
least because it's possible it will interfere with the Mac port's
code, but also we may want to extend this functionality to GNUstep in
the future (although that seems unlikely right now).

It also means it's easy to see all the lisp functions that relate to
the NS port by doing something like M-x ns-<TAB>.

If you're copying functionality from the Mac port feel free to set up
an alias, but please use ns for the function names.

+      || ((lisp_modifiers & ctrl_modifier)
+          && EQ (ns_command_modifier, Qcontrol))
+      )
      ^^^

I don't think we leave closing parens hanging like that, just stick it
on the end of the previous line, please.

       doc: /* Bind KEY combination as a global hotkey, and run HOOK upon
+invokation. This function assigns a hotkey that will run an elisp function
 ^^^^^^^^^^

invocation

+mac_bind_key (NSEventModifierFlags modifier, unsigned vkey,

You might want to call this something like ns_bind_global_hotkey so
it's clearer what it does, and a short descriptive comment wouldn't go
amiss.

+    hotkey_ids = [[NSMutableArray alloc] initWithCapacity: 1];

You're allocing this array, but not releasing it anywhere.

+  if (trusted) {
               ^^^

Opening brace should be on a new line. This function (mac_bind_key)
needs this fix in a few places.

+          if([[event.charactersIgnoringModifiers capitalizedString]
            ^^^

Missing space.

We could also do with some documentation.

One thing I'm unsure about is that we allow users to map the left and
right modifier keys separately but I think your code only allows for
matching with left key settings. Is that intentional? It would seem
unlikely that macOS would let us map global hotkeys to the left and
right keys separately, so I understand if it's not possible.
-- 
Alan Third




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44973; Package emacs. Full text available.

Message received at 44973 <at> debbugs.gnu.org:


Received: (at 44973) by debbugs.gnu.org; 30 Dec 2020 04:10:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 29 23:10:20 2020
Received: from localhost ([127.0.0.1]:40702 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kuSoW-0006vT-2d
	for submit <at> debbugs.gnu.org; Tue, 29 Dec 2020 23:10:20 -0500
Received: from mail-oi1-f177.google.com ([209.85.167.177]:34522)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jbalk@HIDDEN>) id 1kuSoS-0006vC-Ma
 for 44973 <at> debbugs.gnu.org; Tue, 29 Dec 2020 23:10:17 -0500
Received: by mail-oi1-f177.google.com with SMTP id s75so17604608oih.1
 for <44973 <at> debbugs.gnu.org>; Tue, 29 Dec 2020 20:10:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mremus.net; s=google;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=aqYaQ3e6amuqZ+9oJH3/xrJ+FOIbI4kP3gjBR6uJF70=;
 b=bnMhQk4Y0ZyKNbMkhI6hwt/PWdKjefnLqkAamH7QClw3Q+Zaw7f34V4x9tD7S1Tcw9
 vEObswHGnXbjjHtogVOvJ8a4WfbAz+PQUhl2vezRrsTYgWknxQHfgaX4XhSb+v3iM27a
 hVBKObQG0f/RIQxTDldwYv01Sl61MP4SPGP+/igm5LqgAk7Ar0cUdUFseLG4tebV+h60
 lvjVv1CEIdc6k81sxpfK/Tjnm0GJdsVGViItCSjyMI9UqlAPaQH8OEJK5XfaTszgUmlq
 bHusUqHw/p/XMoVyV1AEQuHZrM/6cl3TI78X1hMpb4IHUo7nikZstLh5H4gJWRq4EDLj
 tpaQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=aqYaQ3e6amuqZ+9oJH3/xrJ+FOIbI4kP3gjBR6uJF70=;
 b=aQi0xRrsJwrKMnYIzytBK94n2N+DCgrzpRV5TcOuMvaI0MpR6sZC4HQPOFx7lWCpsC
 zvLXOFtkc3HtjoJGwIlIjS5UlhizDmzXKs+dv1PnuZ9WdjtbLPcPw8tpZHG1Vs8tAWdT
 /4R+Fcj2La5UKTqUB7RhWaBVGQmuTIjTtCUXYsk2T4/esUPJgoPCcqzIFWvrmeyRSVeZ
 YmrVKAyU/dMR0StzaGiwRsYTL1ZVotudnm9XqJCcL2oBnOvallksjA2pJy7ue40kWwia
 q3imEm97yYVFbE/FbliZ1QD5PTJWtMwszULPmNgzhfn6PuBMx1hRdMh4WRuRlqoLsvp6
 3BfA==
X-Gm-Message-State: AOAM531WzYITeqqPv/d3t6/0lM9Uq962P+5V+++Sq5/POiEbVYU3eSMp
 Zk/ETsmPNZ+QIQdnAQj/TvYipkdAtj+M01DB0aBSMQ==
X-Google-Smtp-Source: ABdhPJxhdYeYlPtsb8wlUZnvMmhngprY5ffE6KrHeeFPOnkRDBhF96S0oVa1Ll6tRFKe7owar3bBobNU3lbzvvsNzRY=
X-Received: by 2002:a05:6808:49a:: with SMTP id
 z26mr4004457oid.137.1609301410977; 
 Tue, 29 Dec 2020 20:10:10 -0800 (PST)
MIME-Version: 1.0
References: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
 <874kkw9gmq.fsf@HIDDEN>
 <CAAgndd5jbXk+s7aY=X05wOaJ87T-GAza2EXZKxkVgUc1FRrOxQ@HIDDEN>
 <87lfdrhj4e.fsf@HIDDEN>
In-Reply-To: <87lfdrhj4e.fsf@HIDDEN>
From: j@HIDDEN
Date: Tue, 29 Dec 2020 20:10:00 -0800
Message-ID: <CAAgndd4nkkQZ0aDeXds_QSbSuKbzuzJ0U0tof+ocsN4BaUTdcg@HIDDEN>
Subject: Re: bug#44973: Add a macOS global hotkey function
To: Lars Ingebrigtsen <larsi@HIDDEN>
Content-Type: multipart/mixed; boundary="000000000000f044b905b7a6aec4"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44973
Cc: 44973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000f044b905b7a6aec4
Content-Type: multipart/alternative; boundary="000000000000f044b805b7a6aec2"

--000000000000f044b805b7a6aec2
Content-Type: text/plain; charset="UTF-8"

Hi Lars,

Here is the patch to bind a global hotkey in mac. As long as Emacs is set as
"trusted" in macOS preferences, the user can bind a two-key hotkey of the
form [modifier-key] or a single-key modifier [function key], for example
(mac-bind-global-hotkey [f1] 'tetris). Binding a three-key
combo is left to a future patch.

The code is copied from w32-register-hot-key as much as possible.

The routine intentionally does not focus the window after the hotkey is
hit; the
user must call a function like (x-focus-frame nil) to focus the frame.

I also wanted to mention that after discovering x-focus-frame, and testing
my
patch and shkd more, I realized that my patch is in fact very similar to
shkd in
functionality. The main differences are that my patch allows hotkeys to be
declared directly in emacs (which I like), and that this patch acts
directly on
an open window (e.g. making it easier to make a hotkey to yank into an
already-open buffer). On the other hand skhd would call emacsclient, which
interacts with the server, even if no frame is open, offering its own
advantages.

Anyways, I'll leave this patch for your consideration as to whether it's
the right
thing to include in emacs!

P.S. I looked into what other code in emacs might be using blocks. I believe
nsxwidget.m also has a block in nsxwidget_webkit_execute_script. I'm
guessing
it's working in our cases because we're ultimately building with the Xcode C
compiler.

Thanks

On Sun, Dec 20, 2020 at 8:35 PM Lars Ingebrigtsen <larsi@HIDDEN> wrote:

> j@HIDDEN writes:
>
> > But no matter what I do, it always crashes the program. I think my
> > first problem is not knowing how to call elisp (run_hooks, safe_call,
> > etc?) correctly, but second, I suspect if this is crashing due to a
> > threading issue.
>
> I am not at all familiar with the ns functions, but looking at the other
> .m files, it looks like you should be able to just say
>
>   call0 (intern ("some-function"));
>
> or something like that?  (Modulo threading stuff.)
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>

--000000000000f044b805b7a6aec2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div>Hi Lars,</div><div><br></div><div>He=
re is the patch to bind a global hotkey in mac. As long as Emacs is set as<=
/div><div>&quot;trusted&quot; in macOS preferences, the user can bind a two=
-key hotkey of the</div><div>form [modifier-key] or a single-key modifier [=
function key], for example</div><div>(mac-bind-global-hotkey [f1] &#39;tetr=
is). Binding a three-key</div><div>combo is left to a future patch.=C2=A0</=
div><div><br></div><div>The code is copied from w32-register-hot-key as muc=
h as possible.</div><div><br></div><div>The routine intentionally does not =
focus the window after the hotkey is hit; the</div><div>user must call a fu=
nction like (x-focus-frame nil) to focus the frame.</div><div><br></div><di=
v>I also wanted to mention that after discovering x-focus-frame, and testin=
g my</div><div>patch and shkd more, I realized that my patch is in fact ver=
y similar to shkd in</div><div>functionality. The main differences are that=
 my patch allows hotkeys to be</div><div>declared directly in emacs (which =
I like), and that this patch acts directly on</div><div>an open window (e.g=
. making it easier to make a hotkey to yank into an</div><div>already-open =
buffer). On the other hand skhd would call emacsclient, which</div><div>int=
eracts with the server, even if no frame is open, offering its own</div><di=
v>advantages.</div><div><br></div><div>Anyways, I&#39;ll leave this patch f=
or your consideration as to whether it&#39;s the right</div><div>thing to i=
nclude in emacs!</div><div><br></div><div>P.S. I looked into what other cod=
e in emacs might be using blocks. I believe</div><div>nsxwidget.m also has =
a block in nsxwidget_webkit_execute_script. I&#39;m guessing</div><div>it&#=
39;s working in our cases because we&#39;re ultimately building with the Xc=
ode C</div><div>compiler.</div><div><br></div><div>Thanks</div></div></div>=
<br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sun=
, Dec 20, 2020 at 8:35 PM Lars Ingebrigtsen &lt;<a href=3D"mailto:larsi@gnu=
s.org">larsi@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-st=
yle:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><a href=3D"m=
ailto:j@HIDDEN" target=3D"_blank">j@HIDDEN</a> writes:<br>
<br>
&gt; But no matter what I do, it always crashes the program. I think my<br>
&gt; first problem is not knowing how to call elisp (run_hooks, safe_call,<=
br>
&gt; etc?) correctly, but second, I suspect if this is crashing due to a<br=
>
&gt; threading issue.<br>
<br>
I am not at all familiar with the ns functions, but looking at the other<br=
>
.m files, it looks like you should be able to just say<br>
<br>
=C2=A0 call0 (intern (&quot;some-function&quot;));<br>
<br>
or something like that?=C2=A0 (Modulo threading stuff.)<br>
<br>
-- <br>
(domestic pets only, the antidote for overdose, milk.)<br>
=C2=A0 =C2=A0bloggy blog: <a href=3D"http://lars.ingebrigtsen.no" rel=3D"no=
referrer" target=3D"_blank">http://lars.ingebrigtsen.no</a><br>
</blockquote></div>

--000000000000f044b805b7a6aec2--

--000000000000f044b905b7a6aec4
Content-Type: application/octet-stream; name="mac_bind_global_hotkey.diff"
Content-Disposition: attachment; filename="mac_bind_global_hotkey.diff"
Content-Transfer-Encoding: base64
Content-ID: <f_kjawacx60>
X-Attachment-Id: f_kjawacx60

ZGlmZiAtLWdpdCBhL2xpc3AvbG9hZHVwLmVsIGIvbGlzcC9sb2FkdXAuZWwKaW5kZXggNTY4Yjlm
ZTQwZC4uZjliZTBmMzY0NSAxMDA2NDQKLS0tIGEvbGlzcC9sb2FkdXAuZWwKKysrIGIvbGlzcC9s
b2FkdXAuZWwKQEAgLTMzNSw2ICszMzUsNyBAQAogICAgICAgKHdoZW4gKGZlYXR1cmVwICdjaGFy
cHJvcCkKICAgICAgICAgKGxvYWQgImludGVybmF0aW9uYWwvbXVsZS11dGlsIikKICAgICAgICAg
KGxvYWQgImludGVybmF0aW9uYWwvdWNzLW5vcm1hbGl6ZSIpCisgICAgICAgIChsb2FkICJucy1m
bnMiKQogICAgICAgICAobG9hZCAidGVybS9ucy13aW4iKSkpK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ZjciLCAi
ZjgiLCAiZjkiLCAiZjEwIiwKKyAgICAiZjExIiwgImYxMiIsICJmMTMiLCAiZjE0IiwgImYxNSIs
CisgICAgImYxNiIsICJmMTciLCAiZjE4IiwgImYxOSIsICJmMjAiLAorICAgICJmMjEiLCAiZjIy
IiwgImYyMyIsICJmMjQiLCAiZjI1IiwKKyAgICAiZjI2IiwgImYyNyIsICJmMjgiLCAiZjI5Iiwg
ImYzMCIsCisgICAgImYzMSIsICJmMzIiLCAiZjMzIiwgImYzNCIsICJmMzUiLCAgICAgIC8qIE5T
RjM1RnVuY3Rpb25LZXkgICAgICAgIDB4RjcyNiAqLworICAgICJpbnNlcnQiLCAiZGVsZXRlIiwg
ImhvbWUiLCAgICAgICAgICAgICAvKiBOU0luc2VydGZ1bmN0aW9uS2V5ICAgICAweEY3MjcgKi8K
KyAgICAiYmVnaW4iLCAiZW5kIiwgInByaW9yIiwgIm5leHQiLAorICAgICJwcmludCIsICJzY3Jv
bGwiLCAicGF1c2UiLAorICAgIDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAvKiBOU1N5c1JlcUZ1bmN0aW9uS2V5ICAgICAweEY3MzEgKi8KKyAgICAiYnJlYWsiLCAicmVz
ZXQiLAorICAgIDAsCisgICAgIm1lbnUiLAorICAgIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIDAs
IDAsIDAsCisgICAgInNlbGVjdCIsICJleGVjdXRlIiwgInVuZG8iLCAicmVkbyIsCisgICAgImZp
bmQiLCAiaGVscCIsICJtb2RlLWNoYW5nZSIgICAgICAgICAgIC8qIE5TTW9kZVN3aXRjaEZ1bmN0
aW9uS2V5IDB4Rjc0NyAqLworICB9OworCisvKiBMb29rdXAgdmlydHVhbCBrZXljb2RlIGZyb20g
c3RyaW5nIHJlcHJlc2VudGluZyB0aGUgbmFtZSBvZiBhCisgICBub24tYXNjaWkga2V5c3Ryb2tl
IGludG8gdGhlIGNvcnJlc3BvbmRpbmcgdmlydHVh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worfQorCitzdGF0aWMgTGlzcF9PYmplY3QKK21hY19wYXJzZV9hbmRfYWRkX2hvdGtl
eSAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXNwZm4sIGludCBob29rKQoreworICAv
KiBDb3BpZWQgZnJvbSBGZGVmaW5lX2tleSBhbmQgc3RvcmVfaW5fa2V5bWFwLiAgKi8KKyAgcmVn
aXN0ZXIgTGlzcF9PYmplY3QgYzsKKyAgdW5zaWduZWQgdmtfY29kZSA9IDA7CisgIGludCBsaXNw
X21vZGlmaWVycyA9IDA7CisgIE5TRXZlbnRNb2RpZmllckZsYWdzIG1hY19tb2RpZmllcnMgPSAw
OworICBMaXNwX09iamVjdCByZXMgPSBRbmlsOworICBjaGFyKiB2a25hbWU7CisKKyAgQ0hFQ0tf
VkVDVE9SIChrZXkpOworCisgIGlmIChBU0laRSAoa2V5KSAhPSAxKQorICAgIHJldHVybiBRbmls
OworCisgIGMgPSBBUkVGIChrZXksIDApOworCisgIGlmIChDT05TUCAoYykgJiYgbHVjaWRfZXZl
bnRfdHlwZV9saXN0X3AgKGMpKQorICAgIGMgPSBGZXZlbnRfY29udmVydF9saXN0IChjKTsKKwor
ICBpZiAoISBGSVhOVU1QIChjKSAmJiAhIFNZTUJPTFAgKGMpKQorICAgIGVycm9yICgiS2V5IGRl
ZmluaXRpb24gaXMgaW52YWxpZCIpOworCisgIGlmICghIEZVTkNUSU9OUChsaXNwZm4pKQorICAg
IGVycm9yICgiSE9PSyBhcmd1bWVudCBpcyBub3QgYSBmdW5jdGlvbiIpOworCisgIC8qIFdvcmsg
b3V0IHRoZSBiYXNlIGtleSBhbmQgdGhlIG1vZGlmaWVycy4gICovCisgIGlmIChTWU1CT0xQIChj
KSkKKyAgICB7CisKKyAgICAgIGMgPSBwYXJzZV9tb2RpZmllcnMgKGMpOworICAgICAgbGlzcF9t
b2RpZmllcnMgPSBYRklYTlVNIChGY2FyIChGY2RyIChjKSkpOworICAgICAgYyA9IEZjYXIgKGMp
OworICAgICAgaWYgKCFTWU1CT0xQIChjKSkKKwllbWFjc19hYm9ydCAoKTsKKworICAgICAgdmtu
YW1lID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYykpOworICAgICAgaWYgKHZrbmFtZVswXSA9PSAw
KQorICAgICAgICBlcnJvcigiS2V5IGRlZmluaXRpb24gaXMgaW52YWxpZCIpOworICAgICAgZWxz
ZQorICAgICAgICB2a19jb2RlID0gbG9va3VwX3ZrX2NvZGUgKHZrbmFtZSk7CisgICAgfQorICBl
bHNlIGlmIChGSVhOVU1QIChjKSkKKyAgICB7CisgICAgICBsaXNwX21vZGlmaWVycyA9IFhGSVhO
VU0gKGMpICYgfkNIQVJBQ1RFUkJJVFM7CisgICAgICAvKiBNYW55IGFzY2lpIGNoYXJhY3RlcnMg
YXJlIHRoZWlyIG93biB2aXJ0dWFsIGtleSBjb2RlLiAgKi8KKyAgICAgIHZrX2NvZGUgPSBYRklY
TlVNIChjKSAmIENIQVJBQ1RFUkJJVFM7CisgICAgfQorCisgIGlmICh2a19jb2RlIDwgMCB8fCB2
a19jb2RlID4gMHhGNzQ3KQorICAgIHJldHVybiBRbmlsOworICBlbHNlIGlmICgodmtfY29kZSA+
PSAweEY3MDApICYmICh2a19jb2RlIDw9IDB4Rjc0NykpCisgICAgbWFjX21vZGlmaWVycyA9IG1h
Y19tb2RpZmllcnMgfCBOU0V2ZW50TW9kaWZpZXJGbGFnRnVuY3Rpb247CisKKyAgLyogQmluZCBr
ZXkgY29tYmluYXRpb25zIGJhc2VkIG9uIG1vZGlmaWVyIG1hcHBpbmdzLiAgKi8KKyAgaWYgKCgo
bGlzcF9tb2RpZmllcnMgJiBoeXBlcl9tb2RpZmllcikKKyAgICAgICAmJiBFUSAobnNfY29tbWFu
ZF9tb2RpZmllciwgUWh5cGVyKSkKKyAgICAgIHx8ICgobGlzcF9tb2RpZmllcnMgJiBzdXBlcl9t
b2RpZmllcikKKyAgICAgICAgICAmJiBFUSAobnNfY29tbWFuZF9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G90a2V5cyA9IEZjb25zIChG
Y29ucyhrZXksaG9vayksIG1hY19yZWdpc3RlcmVkX2hvdGtleXMpOworICAgICAgZWxzZQorICAg
ICAgICBYU0VUQ0FSIChpdGVtLCBGY29ucyhrZXksaG9vaykpOworICAgIH0KKworICByZXR1cm4g
a2V5OworfQorCitERUZVTiAoIm1hYy1zaG93LWJvdW5kLWhvdGtleXMiLCBGbWFjX3Nob3dfYm91
bmRfaG90a2V5cywKKyAgICAgICBTbWFjX3Nob3dfYm91bmRfaG90a2V5cywgMCwgMCwgMCwKKyAg
ICAgICBkb2M6IC8qIFJldHVybiBsaXN0IG9mIHJlZ2lzdGVyZWQgaG90LWtleSBJRHMuICAqLykK
KyAgKHZvaWQpCit7CisgIHJldHVybiBtYWNfcmVnaXN0ZXJlZF9ob3RrZXlzOworfQorCitERUZV
TiAoIm1hYy1jbGVhci1ob3RrZXlzIiwgRm1hY19jbGVhcl9ob3RrZXlzLAorICAgICAgIFNtYWNf
Y2xlYXJfaG90a2V5cywgMCwgMCwgMCwKKyAgICAgICBkb2M6IC8qIFVuYmluZCBhbGwgZ2xvYmFs
IGhvdGtleXMgKi8pCisgICh2b2lkKQoreworICBtYWNfcmVnaXN0ZXJlZF9ob3RrZXlzID0gUW5p
bDsKKworICBtYWNfY2xlYXJfaG90a2V5cygpOworCisgIHJldHVybiBRdDsKK30KKyNlbmRpZgor
CiAvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PQogCiAgICAgQ2xhc3MgaW1wbGVtZW50YXRpb25zCkBAIC0z
MTM2LDYgKzMzNDksMTEgQEAgLSAoTGlzcF9PYmplY3QpbGlzcFN0cmluZwogICBkZWZzdWJyICgm
U25zX3NldF9tb3VzZV9hYnNvbHV0ZV9waXhlbF9wb3NpdGlvbik7CiAgIGRlZnN1YnIgKCZTbnNf
bW91c2VfYWJzb2x1dGVfcGl4ZWxfcG9zaXRpb24p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VycmVkLCBhbmQgbWVtYmVy
IGBhcmcnIGNvbnRhaW5zCg==
--000000000000f044b905b7a6aec4--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44973; Package emacs. Full text available.

Message received at 44973 <at> debbugs.gnu.org:


Received: (at 44973) by debbugs.gnu.org; 22 Dec 2020 05:20:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 22 00:20:14 2020
Received: from localhost ([127.0.0.1]:48742 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kra5l-0000ER-Qx
	for submit <at> debbugs.gnu.org; Tue, 22 Dec 2020 00:20:14 -0500
Received: from eggs.gnu.org ([209.51.188.92]:45710)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1kra5k-0000E9-7t
 for 44973 <at> debbugs.gnu.org; Tue, 22 Dec 2020 00:20:12 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:52396)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <rms@HIDDEN>)
 id 1kra5e-0002sT-Ls; Tue, 22 Dec 2020 00:20:06 -0500
Received: from rms by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rms@HIDDEN>)
 id 1kra5d-00053h-Bb; Tue, 22 Dec 2020 00:20:05 -0500
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: Alan Third <alan@HIDDEN>
In-Reply-To: <X+DOpdAPnYFN6mVK@HIDDEN> (message from Alan
 Third on Mon, 21 Dec 2020 16:34:45 +0000)
Subject: Re: bug#44973: Add a macOS global hotkey function
References: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
 <874kkw9gmq.fsf@HIDDEN>
 <CAAgndd5jbXk+s7aY=X05wOaJ87T-GAza2EXZKxkVgUc1FRrOxQ@HIDDEN>
 <X+BY1DS3o5/z7RkK@HIDDEN> <83im8vrv2l.fsf@HIDDEN>
 <X+DOpdAPnYFN6mVK@HIDDEN>
Message-Id: <E1kra5d-00053h-Bb@HIDDEN>
Date: Tue, 22 Dec 2020 00:20:05 -0500
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44973
Cc: 44973 <at> debbugs.gnu.org, larsi@HIDDEN, alan@HIDDEN, eliz@HIDDEN,
 j@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > The GCC work to support blocks appears to be progressing, but slowly:

  > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78352

I am glad it is making progress.  We will get there eventually.

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44973; Package emacs. Full text available.

Message received at 44973 <at> debbugs.gnu.org:


Received: (at 44973) by debbugs.gnu.org; 21 Dec 2020 16:35:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 21 11:34:59 2020
Received: from localhost ([127.0.0.1]:48122 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1krO9D-0006S8-Lj
	for submit <at> debbugs.gnu.org; Mon, 21 Dec 2020 11:34:59 -0500
Received: from outbound.soverin.net ([116.202.65.218]:56107)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alan@HIDDEN>) id 1krO9A-0006Ro-St
 for 44973 <at> debbugs.gnu.org; Mon, 21 Dec 2020 11:34:58 -0500
Received: from smtp.soverin.net (unknown [10.10.3.28])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
 (No client certificate requested)
 by outbound.soverin.net (Postfix) with ESMTPS id 3EBFB6008F;
 Mon, 21 Dec 2020 16:34:50 +0000 (UTC)
Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.142]) by
 soverin.net
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin;
 t=1608568489; bh=2G9WqrMx0kTTTK8SBvq1834Ct7AXfKVK7d98FvjsyiA=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
 b=dqeKxD5RS/g7m5jvgyILdkRxp+td48SM9rofY01nnOkeQy2/1RGJpSHYTanC87ivm
 wErRWcTJBSJ8N5Detp0BOS3cCW/U0sjh7c0RxLY69H5A7kh4Qr4mf355P4Ov/wxlFO
 lfSWyUQ27R21vq1t17PrecsH57moRgk5vYt0vmQWzPw0+0DxSP1/EPRREc1e7q1AdD
 oKA/pFu/61hTS0n447+UOFiubd71VB695Rm9saH3HrVthIOka8vJLUvGT8XpKYilK8
 RfeJUwv3hQFqSGjqM21wW2Zq9WtKHshFZ119cn73ZeMn7wojCKzDr8urVkomGiH0tF
 qbbQQWhsynQtA==
Received: by breton.holly.idiocy.org (Postfix, from userid 501)
 id 582732029096DF; Mon, 21 Dec 2020 16:34:45 +0000 (GMT)
Date: Mon, 21 Dec 2020 16:34:45 +0000
From: Alan Third <alan@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#44973: Add a macOS global hotkey function
Message-ID: <X+DOpdAPnYFN6mVK@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 44973 <at> debbugs.gnu.org, larsi@HIDDEN,
 j@HIDDEN
References: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
 <874kkw9gmq.fsf@HIDDEN>
 <CAAgndd5jbXk+s7aY=X05wOaJ87T-GAza2EXZKxkVgUc1FRrOxQ@HIDDEN>
 <X+BY1DS3o5/z7RkK@HIDDEN> <83im8vrv2l.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83im8vrv2l.fsf@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 44973
Cc: 44973 <at> debbugs.gnu.org, larsi@HIDDEN, j@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Mon, Dec 21, 2020 at 06:18:58PM +0200, Eli Zaretskii wrote:
> > Date: Mon, 21 Dec 2020 08:12:04 +0000
> > From: Alan Third <alan@HIDDEN>
> > Cc: 44973 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
> > 
> > One potential problem with your approach is that we don't accept code
> > using Objective C blocks as it's incompatible with GCC. Unless that
> > policy has changed?
> 
> It hasn't changed, but does this code really need to use that feature?
> The last time we had a much more grave problem: the system header used
> for some code itself used ObjC blocks, and thus couldn't be compiled
> by GCC.  It looks like this case is not that problematic?

The class method used takes a block as an argument. I don't think
there are any work-arounds.

The GCC work to support blocks appears to be progressing, but slowly:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78352
-- 
Alan Third




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44973; Package emacs. Full text available.

Message received at 44973 <at> debbugs.gnu.org:


Received: (at 44973) by debbugs.gnu.org; 21 Dec 2020 16:19:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 21 11:19:22 2020
Received: from localhost ([127.0.0.1]:48102 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1krNu6-0005zn-0i
	for submit <at> debbugs.gnu.org; Mon, 21 Dec 2020 11:19:22 -0500
Received: from eggs.gnu.org ([209.51.188.92]:43324)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1krNu4-0005zZ-74
 for 44973 <at> debbugs.gnu.org; Mon, 21 Dec 2020 11:19:21 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40073)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1krNty-0005xh-8X; Mon, 21 Dec 2020 11:19:14 -0500
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3733
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1krNtx-00082J-LB; Mon, 21 Dec 2020 11:19:14 -0500
Date: Mon, 21 Dec 2020 18:18:58 +0200
Message-Id: <83im8vrv2l.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Third <alan@HIDDEN>
In-Reply-To: <X+BY1DS3o5/z7RkK@HIDDEN> (message from Alan
 Third on Mon, 21 Dec 2020 08:12:04 +0000)
Subject: Re: bug#44973: Add a macOS global hotkey function
References: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
 <874kkw9gmq.fsf@HIDDEN>
 <CAAgndd5jbXk+s7aY=X05wOaJ87T-GAza2EXZKxkVgUc1FRrOxQ@HIDDEN>
 <X+BY1DS3o5/z7RkK@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 44973
Cc: 44973 <at> debbugs.gnu.org, alan@HIDDEN, larsi@HIDDEN, j@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 21 Dec 2020 08:12:04 +0000
> From: Alan Third <alan@HIDDEN>
> Cc: 44973 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
> 
> One potential problem with your approach is that we don't accept code
> using Objective C blocks as it's incompatible with GCC. Unless that
> policy has changed?

It hasn't changed, but does this code really need to use that feature?
The last time we had a much more grave problem: the system header used
for some code itself used ObjC blocks, and thus couldn't be compiled
by GCC.  It looks like this case is not that problematic?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44973; Package emacs. Full text available.

Message received at 44973 <at> debbugs.gnu.org:


Received: (at 44973) by debbugs.gnu.org; 21 Dec 2020 08:12:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 21 03:12:19 2020
Received: from localhost ([127.0.0.1]:46136 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1krGIl-0000S8-Ax
	for submit <at> debbugs.gnu.org; Mon, 21 Dec 2020 03:12:19 -0500
Received: from outbound.soverin.net ([116.202.65.218]:37265)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alan@HIDDEN>) id 1krGIj-0000Rs-LP
 for 44973 <at> debbugs.gnu.org; Mon, 21 Dec 2020 03:12:18 -0500
Received: from smtp.soverin.net (unknown [10.10.3.28])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
 (No client certificate requested)
 by outbound.soverin.net (Postfix) with ESMTPS id 872F46008F;
 Mon, 21 Dec 2020 08:12:11 +0000 (UTC)
Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.142]) by
 soverin.net
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin;
 t=1608538330; bh=RiEhHs9/flO7jqOJQOLDGn2DC9Kio9tEjIfLEjzNRtw=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
 b=TIN5djEDS1u4YWLYmNXMZ7e6lZFec5kg8GbMxwz0ucvWL7fLC2sms/1Av8MHb54EB
 WpHPVBplDOdrMH0osrr2JumUZiDxb+uCGfYqZ5lvagg7jbYjnMcr7SjS88qstONYHb
 TlUPTxMBq5sGBE03sNBT9CBfLWIkvYFN2oLOyeEgkVvzmi1uLtoAqwqJhroduId0Ta
 rVycF9EwGM4ffFUzASbphwOqcxYoUX9QBDMkPh29DxFNNq0lu+/caG6tMYWAwOAVqx
 hnYYTmq1zlBiz01kevafZai6sQxDsCZ+flHHNUbUVlhRSyun/PR2LGdNmqte9kDlKC
 2NaKtXnt4OIVw==
Received: by breton.holly.idiocy.org (Postfix, from userid 501)
 id 430F7202908E27; Mon, 21 Dec 2020 08:12:05 +0000 (GMT)
Date: Mon, 21 Dec 2020 08:12:04 +0000
From: Alan Third <alan@HIDDEN>
To: j@HIDDEN
Subject: Re: bug#44973: Add a macOS global hotkey function
Message-ID: <X+BY1DS3o5/z7RkK@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>, j@HIDDEN,
 Lars Ingebrigtsen <larsi@HIDDEN>, 44973 <at> debbugs.gnu.org
References: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
 <874kkw9gmq.fsf@HIDDEN>
 <CAAgndd5jbXk+s7aY=X05wOaJ87T-GAza2EXZKxkVgUc1FRrOxQ@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CAAgndd5jbXk+s7aY=X05wOaJ87T-GAza2EXZKxkVgUc1FRrOxQ@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 44973
Cc: 44973 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Sun, Dec 20, 2020 at 04:40:37PM -0800, j@HIDDEN wrote:
> Hi Lars,
> 
> I'm pretty close to having a patch ready, but I'm stuck in one key spot. I
> don't know if anyone on the list could help?
> 
> After the user registers a hotkey, and when they press the hotkey, MacOS
> will run the code below. On the line "RUN_SOME_ELISP_FUNCTION", I would
> expect some elisp function to be run (e.g. 'emacs-version').
> 
> But no matter what I do, it always crashes the program. I think my first
> problem is not knowing how to call elisp (run_hooks, safe_call, etc?)
> correctly, but second, I suspect if this is crashing due to a threading
> issue.
> 
>     handler = [NSEvent
> addGlobalMonitorForEventsMatchingMask:(NSEventMaskKeyDown)
> handler:^(NSEvent *event){
>         if (event.modifierFlags & modifier)
>           if([event.charactersIgnoringModifiers characterAtIndex:0] ==
> vkey) {
>            RUN_SOME_ELISP_FUNCTION
>             [[NSApp mainWindow] makeKeyAndOrderFront:NSApp];
>           }
>         }
>       }];

I think you probably want to send an event to Emacs, that way a user
can bind it to anything they like. Look at, say, [EmacsApp openFile:]
for how do that.

One potential problem with your approach is that we don't accept code
using Objective C blocks as it's incompatible with GCC. Unless that
policy has changed?
-- 
Alan Third




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44973; Package emacs. Full text available.

Message received at 44973 <at> debbugs.gnu.org:


Received: (at 44973) by debbugs.gnu.org; 21 Dec 2020 04:35:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 20 23:35:12 2020
Received: from localhost ([127.0.0.1]:45920 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1krCue-0006ze-Iv
	for submit <at> debbugs.gnu.org; Sun, 20 Dec 2020 23:35:12 -0500
Received: from quimby.gnus.org ([95.216.78.240]:36812)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1krCub-0006zJ-Dt
 for 44973 <at> debbugs.gnu.org; Sun, 20 Dec 2020 23:35:10 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=k0Bw6OB7MHwKBlc9mfBwROvu0FGqSy/+cv2yd/S5wRA=; b=tS+Ltb9YQHW0ytnglhm99j3eV9
 UiQc/oj8kac6vD8LXMn1aXUdZPITS57vjLWOuaxbKhgykSE0fz93TVCeKb0cWpKsG3Kr/fc3hXRdL
 kPsm0TYAmK6TkL9PtQKXwbq9NxL2IKTtoop28fg7RROMlQuRlUDooltoeSiffKvkkzxs=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1krCuR-0000zy-1p; Mon, 21 Dec 2020 05:35:02 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: j@HIDDEN
Subject: Re: bug#44973: Add a macOS global hotkey function
References: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
 <874kkw9gmq.fsf@HIDDEN>
 <CAAgndd5jbXk+s7aY=X05wOaJ87T-GAza2EXZKxkVgUc1FRrOxQ@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXHxciAfIBcV1sh
 Gx3///+wXviLAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+QMFQQhCRF8vAMAAAG6SURBVDjLbZSLoYMg
 DEWDXQDiAiRZQMP+u72bIK32lbZWOOTLVaIYpdL/0TAYvxtsLa7jMc4dF9HRb8AtwUn77g9QSwJR
 xpY76LSlq876BC41gey5awLOGGTjtNHsDc5wIq6047bkrgQnxa0IEwuKGfS6gOPLiFg8iqtMpFbT
 lY9KG2Jv6E3prcz6M7ggirsU9EXKdgNDsrqYc2kLRHpHgIMOKtzkbnFEVUV7ZZY7cIWhN+fO7LW+
 QazPDhwoqarrTHcoPh42dLzGGeEC1GKWEFvpQLteE5BNL5otOGImCVCwxmHaOztrw8MVUik4mjzZ
 aYFS61TJVEbc1Y1rY+1TPqXl8peu4DOP7CmjrIMbYP0BItOfFh7oCXoCtIN0ycigk+EhZOehcZrn
 pVPPMsOijIpkl0WPFD1k4XmyW8bAYrMVXEOHVmgC/wBMdi2XK0NR6StcuSN0WaDxtU6i8fcBesXO
 yhew9URMoNZoe/bqAtix3Vsi9a0rtQ/w6WkF7Wt1CDLw+USp8gI4fAsKULXlSyN6hyJMVDWeC6I+
 Xyfj0gwBWABewFUb29UsidLmkEtHkAurfkvm8/75A2bej0bIpovfAAAAJXRFWHRkYXRlOmNyZWF0
 ZQAyMDIwLTEyLTIxVDA0OjMzOjA5KzAwOjAwQO+oVAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0x
 Mi0yMVQwNDozMzowOSswMDowMDGyEOgAAAAASUVORK5CYII=
X-Now-Playing: Steven Brown's _Music for Film & Theatre (2)_: "The Labyrinth"
Date: Mon, 21 Dec 2020 05:34:57 +0100
In-Reply-To: <CAAgndd5jbXk+s7aY=X05wOaJ87T-GAza2EXZKxkVgUc1FRrOxQ@HIDDEN>
 (j.'s message of "Sun, 20 Dec 2020 16:40:37 -0800")
Message-ID: <87lfdrhj4e.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  j@HIDDEN writes: > But no matter what I do, it always
 crashes the program. I think my > first problem is not knowing how to call
 elisp (run_hooks, safe_call, > etc?) correctly, but second, I suspect if
 this is crashin [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44973
Cc: 44973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

j@HIDDEN writes:

> But no matter what I do, it always crashes the program. I think my
> first problem is not knowing how to call elisp (run_hooks, safe_call,
> etc?) correctly, but second, I suspect if this is crashing due to a
> threading issue.

I am not at all familiar with the ns functions, but looking at the other
.m files, it looks like you should be able to just say

  call0 (intern ("some-function"));

or something like that?  (Modulo threading stuff.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44973; Package emacs. Full text available.

Message received at 44973 <at> debbugs.gnu.org:


Received: (at 44973) by debbugs.gnu.org; 21 Dec 2020 01:17:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 20 20:17:22 2020
Received: from localhost ([127.0.0.1]:45845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kr9pB-0002GG-Om
	for submit <at> debbugs.gnu.org; Sun, 20 Dec 2020 20:17:22 -0500
Received: from mail-ot1-f48.google.com ([209.85.210.48]:37193)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jbalk@HIDDEN>) id 1kr9Fu-0001Pk-3S
 for 44973 <at> debbugs.gnu.org; Sun, 20 Dec 2020 19:40:54 -0500
Received: by mail-ot1-f48.google.com with SMTP id o11so7448345ote.4
 for <44973 <at> debbugs.gnu.org>; Sun, 20 Dec 2020 16:40:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mremus.net; s=google;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=r5SBEhyOs0kGJ3E2ie4iSFTfRcSa1371ZPUrDrAiIhc=;
 b=RxR4aLl6l1Vh9iQOKrvIn6/zc000ZamJClBL9LXKg3aoW5Wyt1X0ZTQkv8jc88WBd+
 Uobn3k9Ct2ROVAl/Mo0F9KUg/oARGNInhTs0DGAwlrHf5+3NgUT69E0hn4sBltqajH9Z
 oEMbytQtpMRePkNy4Fovk0KySlyd41oRSDucOPhrmcZPzcJV0nyG2CFjlLWH7pz2FHb0
 UOE4aWGlcyu7Fq9E4mbJG4deFWnTD1qNPlAugRk3liEC1FCqbmyOZ8rrOYu5hLhuCVnO
 vZajwMeJdeJ+4CnmOvyelvEN7rrcht3Uitl9kPAwOzsYNvJLiueDgIVaL9T89VfXI8+F
 P1Tw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=r5SBEhyOs0kGJ3E2ie4iSFTfRcSa1371ZPUrDrAiIhc=;
 b=HxThWl6gkt4wUcMd9voZ9JoCyWOi2f66QhAxpz3Wky/zH/6zqlP+azvMcFEl43Capo
 izCbspyhLN7KeFpmlVElG2KbgMPlx9rNfMhxPB9uX+kcBhD81sajKORD+M5T5HXam4TF
 byFfHtrhFLM510YCjC9bsIh3oXo7zgvkSFLTbjC+kKNL2RPOrWLJy+t730hn+KtJYybH
 fc7iFgfEy+f62garoWfdFzKcQMxv079apgAiEVxooCmdLC9gy5HCviqUyHjWSqWzl2kE
 uS3Zyc7IyF40YswSnnm+cSfbSvFdxNJuFjrnZbjo4zNYgO7/5BRE1SO+w1hROloBoAWE
 PHCA==
X-Gm-Message-State: AOAM530qS5viOGWfrh27uqHpG7IMSGovrirhmpp+QA9WeQvVxG9hyffP
 qZubYX2R6u6Gfb2huRRidv3KQb/cMM9DLqrZpJj74w==
X-Google-Smtp-Source: ABdhPJxdf9qn86YYw5Y1QIh1kUDyiZjekXGinXTsFOqACksAxlNjVRobsBgJec3izgODheop95TVmyhZz34oCwzF79c=
X-Received: by 2002:a9d:4b03:: with SMTP id q3mr10270954otf.88.1608511248358; 
 Sun, 20 Dec 2020 16:40:48 -0800 (PST)
MIME-Version: 1.0
References: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
 <874kkw9gmq.fsf@HIDDEN>
In-Reply-To: <874kkw9gmq.fsf@HIDDEN>
From: j@HIDDEN
Date: Sun, 20 Dec 2020 16:40:37 -0800
Message-ID: <CAAgndd5jbXk+s7aY=X05wOaJ87T-GAza2EXZKxkVgUc1FRrOxQ@HIDDEN>
Subject: Re: bug#44973: Add a macOS global hotkey function
To: Lars Ingebrigtsen <larsi@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000936d6105b6eeb5a5"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 44973
X-Mailman-Approved-At: Sun, 20 Dec 2020 20:17:20 -0500
Cc: 44973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000936d6105b6eeb5a5
Content-Type: text/plain; charset="UTF-8"

Hi Lars,

I'm pretty close to having a patch ready, but I'm stuck in one key spot. I
don't know if anyone on the list could help?

After the user registers a hotkey, and when they press the hotkey, MacOS
will run the code below. On the line "RUN_SOME_ELISP_FUNCTION", I would
expect some elisp function to be run (e.g. 'emacs-version').

But no matter what I do, it always crashes the program. I think my first
problem is not knowing how to call elisp (run_hooks, safe_call, etc?)
correctly, but second, I suspect if this is crashing due to a threading
issue.

    handler = [NSEvent
addGlobalMonitorForEventsMatchingMask:(NSEventMaskKeyDown)
handler:^(NSEvent *event){
        if (event.modifierFlags & modifier)
          if([event.charactersIgnoringModifiers characterAtIndex:0] ==
vkey) {
           RUN_SOME_ELISP_FUNCTION
            [[NSApp mainWindow] makeKeyAndOrderFront:NSApp];
          }
        }
      }];

Is there anyone who might know how to fill in this piece?

Thanks

On Tue, Dec 8, 2020 at 12:39 PM Lars Ingebrigtsen <larsi@HIDDEN> wrote:

> j@HIDDEN writes:
>
> > MacOS makes it very difficult to assign global hotkeys to focus
> > Emacs. For example, if I'm in another program, and I want to
> > launch/focus Emacs with "Alt-SPC", it can't just be set in the system
> > preferences; I'd need to use a 3rd-party program like skhd.
> >
> > Would it be possible to add a function or hook to Emacs which registers
> one or
> > more global hotkeys (using addGlobalMonitorForEventsMatchingMask), and
> then
> > when the hotkey is pressed, run an elisp function?
>
> [...]
>
> > Even if it's rare for Emacs to implement an OS-specific feature, there
> > is some precedent on Windows. If you look at w32-register-hot-keys,
> > it's similar to, but different from my request.
>
> Sure, I think that makes sense.  Would it be possible for you to work up
> a patch that adds this functionality?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>

--000000000000936d6105b6eeb5a5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr">Hi Lars=
,<div><br></div><div>I&#39;m pretty close to having a patch ready, but I&#3=
9;m stuck in one key spot. I don&#39;t know if anyone on the list could hel=
p?</div><div><br></div><div>After the user registers a hotkey, and when the=
y press the hotkey, MacOS will run the code below. On the line &quot;RUN_SO=
ME_ELISP_FUNCTION&quot;, I would expect some elisp function to be run (e.g.=
 &#39;emacs-version&#39;).=C2=A0</div><div><span style=3D"color:rgb(0,0,0)"=
><br></span></div><div><span style=3D"color:rgb(0,0,0)">But no matter what =
I do, it always crashes the program. I think my first problem is not knowin=
g how to call elisp (run_hooks, safe_call, etc?) correctly, but second, I s=
uspect if this is crashing due to a threading issue.</span></div><div><br><=
/div><div><div style=3D"color:rgb(0,0,0)">=C2=A0 =C2=A0 handler =3D [NSEven=
t addGlobalMonitorForEventsMatchingMask:(NSEventMaskKeyDown) handler:^(NSEv=
ent *event){</div><div style=3D"color:rgb(0,0,0)">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 if (event.modifierFlags &amp; modifier)=C2=A0</div><div style=3D"color:=
rgb(0,0,0)">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if([event.charactersIgnoring=
Modifiers characterAtIndex:0] =3D=3D vkey) {</div><div style=3D"color:rgb(0=
,0,0)">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RUN_SOME_ELISP_FUNCTION<br>=
</div><div style=3D"color:rgb(0,0,0)">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 [[NSApp mainWindow] makeKeyAndOrderFront:NSApp];<br></div><div style=
=3D"color:rgb(0,0,0)">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div><div style=
=3D"color:rgb(0,0,0)">=C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div><div style=3D"colo=
r:rgb(0,0,0)">=C2=A0 =C2=A0 =C2=A0 }];</div></div><div style=3D"color:rgb(0=
,0,0)"><br></div><div style=3D"color:rgb(0,0,0)">Is there anyone who might =
know how to fill in this piece?</div><div style=3D"color:rgb(0,0,0)"><br></=
div><div>Thanks</div></div></div></div></div><br><div class=3D"gmail_quote"=
><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Dec 8, 2020 at 12:39 PM Lars=
 Ingebrigtsen &lt;<a href=3D"mailto:larsi@HIDDEN">larsi@HIDDEN</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rg=
b(204,204,204);padding-left:1ex"><a href=3D"mailto:j@HIDDEN" target=3D"=
_blank">j@HIDDEN</a> writes:<br>
<br>
&gt; MacOS makes it very difficult to assign global hotkeys to focus<br>
&gt; Emacs. For example, if I&#39;m in another program, and I want to<br>
&gt; launch/focus Emacs with &quot;Alt-SPC&quot;, it can&#39;t just be set =
in the system<br>
&gt; preferences; I&#39;d need to use a 3rd-party program like skhd.<br>
&gt;<br>
&gt; Would it be possible to add a function or hook to Emacs which register=
s one or<br>
&gt; more global hotkeys (using addGlobalMonitorForEventsMatchingMask), and=
 then<br>
&gt; when the hotkey is pressed, run an elisp function?<br>
<br>
[...]<br>
<br>
&gt; Even if it&#39;s rare for Emacs to implement an OS-specific feature, t=
here<br>
&gt; is some precedent on Windows. If you look at w32-register-hot-keys,<br=
>
&gt; it&#39;s similar to, but different from my request.<br>
<br>
Sure, I think that makes sense.=C2=A0 Would it be possible for you to work =
up<br>
a patch that adds this functionality?<br>
<br>
-- <br>
(domestic pets only, the antidote for overdose, milk.)<br>
=C2=A0 =C2=A0bloggy blog: <a href=3D"http://lars.ingebrigtsen.no" rel=3D"no=
referrer" target=3D"_blank">http://lars.ingebrigtsen.no</a><br>
</blockquote></div>

--000000000000936d6105b6eeb5a5--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44973; Package emacs. Full text available.

Message received at 44973 <at> debbugs.gnu.org:


Received: (at 44973) by debbugs.gnu.org; 8 Dec 2020 20:39:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 08 15:39:56 2020
Received: from localhost ([127.0.0.1]:59959 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kmjm8-0000Os-8J
	for submit <at> debbugs.gnu.org; Tue, 08 Dec 2020 15:39:56 -0500
Received: from quimby.gnus.org ([95.216.78.240]:56380)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kmjm6-0000Od-DK
 for 44973 <at> debbugs.gnu.org; Tue, 08 Dec 2020 15:39:55 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Y3CvQW7Zbd3LHmYqcgnutOPWM8fdeAQt31o8uGECIpA=; b=Z/ZdSb9/7UhxvTkh+OXa6uKLDF
 TUlVN3t7TSvnAfZ5r6Bk+GeI3Vb1r+eak8+dXhyAOvMX1bS3TQkj+d9QZoGHabG/qJjeF9Siu74HX
 EP66Puv/LDcTdmpMlcii10lH4ugltYzUkqvQe3gUWWSLXRizF3vHMJtyaQxzGCXG7tr4=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kmjlu-0007i2-PG; Tue, 08 Dec 2020 21:39:47 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: j@HIDDEN
Subject: Re: bug#44973: Add a macOS global hotkey function
References: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
X-Now-Playing: Oneohtrix Point Never's _Magic Oneohtrix Point Never_: "Lost
 But Never Alone"
Date: Tue, 08 Dec 2020 21:39:41 +0100
In-Reply-To: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
 (j.'s message of "Mon, 30 Nov 2020 13:01:52 -0800")
Message-ID: <874kkw9gmq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: j@HIDDEN writes: > MacOS makes it very difficult to
 assign
 global hotkeys to focus > Emacs. For example, if I'm in another program,
 and I want to > launch/focus Emacs with "Alt-SPC", it can't just be set in
 the system [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44973
Cc: 44973 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

j@HIDDEN writes:

> MacOS makes it very difficult to assign global hotkeys to focus
> Emacs. For example, if I'm in another program, and I want to
> launch/focus Emacs with "Alt-SPC", it can't just be set in the system
> preferences; I'd need to use a 3rd-party program like skhd.
>
> Would it be possible to add a function or hook to Emacs which registers one or
> more global hotkeys (using addGlobalMonitorForEventsMatchingMask), and then
> when the hotkey is pressed, run an elisp function?

[...]

> Even if it's rare for Emacs to implement an OS-specific feature, there
> is some precedent on Windows. If you look at w32-register-hot-keys,
> it's similar to, but different from my request.

Sure, I think that makes sense.  Would it be possible for you to work up
a patch that adds this functionality?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#44973; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Nov 2020 21:26:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 30 16:26:51 2020
Received: from localhost ([127.0.0.1]:56903 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kjqh8-0003TC-WC
	for submit <at> debbugs.gnu.org; Mon, 30 Nov 2020 16:26:51 -0500
Received: from lists.gnu.org ([209.51.188.17]:55196)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jbalk@HIDDEN>) id 1kjqJE-0002ro-Vv
 for submit <at> debbugs.gnu.org; Mon, 30 Nov 2020 16:02:09 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:47416)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jbalk@HIDDEN>) id 1kjqJE-00012c-OB
 for bug-gnu-emacs@HIDDEN; Mon, 30 Nov 2020 16:02:08 -0500
Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]:46837)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jbalk@HIDDEN>) id 1kjqJC-0005lr-Iw
 for bug-gnu-emacs@HIDDEN; Mon, 30 Nov 2020 16:02:08 -0500
Received: by mail-ot1-x331.google.com with SMTP id z23so9064665oti.13
 for <bug-gnu-emacs@HIDDEN>; Mon, 30 Nov 2020 13:02:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mremus.net; s=google;
 h=mime-version:from:date:message-id:subject:to;
 bh=NJ4glx7VlGPq2c3EpNNC51mRRos1MDNDSbaTCRnUZYg=;
 b=XpyGDBOGOvqJcegRdqqpEt/eFyOLMzTtGZvPwy/9Gnhgof4MMNcxIZCnmC6INis9ka
 S5mL3ETksCpTB0AufDLY5Ea5kPYkr/VwD0zG9jWbFxWeUrdFORKVD61qjJD4SUv0bc/p
 99d+MA29EQRBfPQRrmFV6SC4vhw2jTUaVKPQvrbZAGNBpjxH+BYuDg17Da3hhO8dk85/
 jHD5FQWo54u0KkIJ9J/VqOS9/J4Akwyv727r3JGt++EY/1JsLGG0/1iLDQmJys+rS/aR
 Hip8Z+VfgbG80Ur6ga/fC84v8RNKQ62T8usAjPWTSCAly47BcvGl6KriHxhC+moDeM04
 JU6A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=NJ4glx7VlGPq2c3EpNNC51mRRos1MDNDSbaTCRnUZYg=;
 b=iPsAlUFsJQSpNX59HlgbKkt8Xd1tEnnyNkzQMi8Jp45WcuCwjWnXFic/E8Ki+wzEqX
 /pWpgeqKB3DribU/cGBTs2Hqg627M8imxKgclAXhwgoVeb52RXzG+Lbuci9mTGAPPaLi
 Z1udaEiz5DLeXJzntJ6A3pZVNVf00p98iUxuGqXGllDL+eCFUchDxmhGeulZO5KbRape
 nBzI47iL6Pb62+lrhH7WG03fL3dQ6FW0GO9h3O0ySu4udwkLvMYp7hYPSfdfG3NnJXiD
 Xlrx5zLiD2xchX1ZaqzGLCL1YeaONkY7X/ZAiV+f2toBbIbOpI3Snu6GzVljt1RfHVrV
 OvSg==
X-Gm-Message-State: AOAM532peNORpMmNoMharlGc43AD6yqDjTB1bDv3c66T40u8A0OkfXzL
 yFLSKiqR1izXjM6Pawz3JkH5qHrM8IpKflSdxrWqIGZKi+bnbnDM
X-Google-Smtp-Source: ABdhPJxOuL9ra6jUJF8Q/av2EtkYMjER6XT3eqbmXi3KHIIMffTFqQYhJ8JqZnXHeqfbyaIWopGBi4FjiFcYhUbga2c=
X-Received: by 2002:a9d:346:: with SMTP id 64mr19076307otv.4.1606770123774;
 Mon, 30 Nov 2020 13:02:03 -0800 (PST)
MIME-Version: 1.0
From: j@HIDDEN
Date: Mon, 30 Nov 2020 13:01:52 -0800
Message-ID: <CAAgndd6u+=_Ux7wUmQ-ErinCUPRYLUeNo2j8Lz0jv=-_M1YLBw@HIDDEN>
Subject: Add a macOS global hotkey function
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="00000000000076afde05b559520b"
Received-SPF: pass client-ip=2607:f8b0:4864:20::331;
 envelope-from=jbalk@HIDDEN; helo=mail-ot1-x331.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 30 Nov 2020 16:26:49 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--00000000000076afde05b559520b
Content-Type: text/plain; charset="UTF-8"

MacOS makes it very difficult to assign global hotkeys to focus Emacs.
For example, if I'm in another program, and I want to launch/focus Emacs
with "Alt-SPC", it can't just be set in the system preferences; I'd need to
use a 3rd-party program like skhd.

Would it be possible to add a function or hook to Emacs which registers one
or more global hotkeys (using addGlobalMonitorForEventsMatchingMask), and
then when the hotkey is pressed, run an elisp function?

For example, by creating a "ns-register-global hotkey" function, where the
user could choose a keybinding (maybe "ALT-SPC"), and letting the user
provide a hook function (maybe "org-capture-stuff")

I intend this feature to be used for something like an Alfred replacement,
as described here: https://www.mattduck.com/emacs-fuzzy-launcher.html .

Even if it's rare for Emacs to implement an OS-specific feature, there is
some precedent on Windows. If you look at w32-register-hot-keys, it's
similar to, but different from my request.

The implementation in nsterm.m should be simple, but it requires Obj-C and
Emacs-specific development knowledge.

Thanks!

--00000000000076afde05b559520b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><br><di=
v>MacOS makes it very difficult to assign global hotkeys to focus Emacs. Fo=
r=C2=A0example, if I&#39;m in another program, and I want to launch/focus E=
macs with &quot;Alt-SPC&quot;, it can&#39;t just be set in the system prefe=
rences; I&#39;d need to use a 3rd-party program like skhd.</div><div><br></=
div><div>Would it be possible to add a function or hook to Emacs which regi=
sters one or more global hotkeys (using addGlobalMonitorForEventsMatchingMa=
sk), and then when the hotkey is pressed, run an elisp function?</div><div>=
<br></div><div>For example, by creating a &quot;ns-register-global hotkey&q=
uot; function, where the user could choose a keybinding (maybe &quot;ALT-SP=
C&quot;), and letting the user provide a hook function (maybe &quot;org-cap=
ture-stuff&quot;)</div><div><br></div><div>I intend=C2=A0this feature to be=
 used for something like an Alfred replacement, as described here: <a href=
=3D"https://www.mattduck.com/emacs-fuzzy-launcher.html">https://www.mattduc=
k.com/emacs-fuzzy-launcher.html</a> .</div><div><br></div><div>Even if it&#=
39;s rare for Emacs to implement an OS-specific feature, there is some prec=
edent on Windows. If you look at=C2=A0<span style=3D"color:rgb(0,0,0)">w32-=
register-hot-keys, it&#39;s similar to, but different from my request.=C2=
=A0</span></div><div><span style=3D"color:rgb(0,0,0)"><br></span></div><div=
>The implementation in nsterm.m should be simple, but it requires Obj-C and=
 Emacs-specific development knowledge.</div><div><br></div><div>Thanks!</di=
v></div></div></div></div>

--00000000000076afde05b559520b--




Acknowledgement sent to j@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#44973; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 30 Dec 2020 11:00:02 UTC

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