From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#45502: [PATCH] Prettier key bindings in NS menu entries Date: Tue, 29 Dec 2020 23:49:02 +0000 Message-ID: References: <02937096-EAF5-4B74-A1C7-CCE6E64C67E3@acm.org> <99CD03DA-DF1F-4C2C-A2FA-DFD7DF3B2750@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5981"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45502@debbugs.gnu.org, Daniel =?UTF-8?Q?Mart=C3=ADn?= To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 30 00:50:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kuOkl-0001Jk-CM for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Dec 2020 00:50:11 +0100 Original-Received: from localhost ([::1]:36464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kuOkk-000675-7z for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Dec 2020 18:50:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kuOkc-00066v-QX for bug-gnu-emacs@gnu.org; Tue, 29 Dec 2020 18:50:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57181) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kuOkc-00037s-IQ for bug-gnu-emacs@gnu.org; Tue, 29 Dec 2020 18:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kuOkc-0000hI-GI for bug-gnu-emacs@gnu.org; Tue, 29 Dec 2020 18:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Dec 2020 23:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45502 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 45502-submit@debbugs.gnu.org id=B45502.16092857592624 (code B ref 45502); Tue, 29 Dec 2020 23:50:02 +0000 Original-Received: (at 45502) by debbugs.gnu.org; 29 Dec 2020 23:49:19 +0000 Original-Received: from localhost ([127.0.0.1]:40494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kuOjv-0000gG-26 for submit@debbugs.gnu.org; Tue, 29 Dec 2020 18:49:19 -0500 Original-Received: from outbound.soverin.net ([116.202.65.218]:58435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kuOjo-0000fy-O2 for 45502@debbugs.gnu.org; Tue, 29 Dec 2020 18:49:17 -0500 Original-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 57F3E6008F; Tue, 29 Dec 2020 23:49:06 +0000 (UTC) Original-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=1609285745; bh=4quLi+6U6wFf8ZVYta0Pm1frjUItPabwN3ruwMVyjvE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e/8sNt1i+Abh9wmXS8H97JBdgpb7OQ1yUk5mhnll02yOCoT908k9XCo9L8HSDh4oA 8i8GpnGo4mYH/6kPgPCry5ykr+MsaIr+ueHg3e5Ak0To5ESkeYP918ui802uNQkShT qZdQl+s9iITWV1GULoz0jjaSQSatFDFy+LfIg1Xi/WvGdaWOO3rCcobs8uTTG4yE/M 0CV/AZ12qUk0jHQ/NksAMRGASR0Bq+E76U4JKWePnt5Qp9L86DVyy1pDYgSvfEWzYg 1Fr3gOpm+6TpLTterTEUxMj/aGPCbEbY5LMI4ops7P6feazUqP3qPi/fPjpNwJvivE 0PqC/h2Ns3vdw== Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 9653F202951F51; Tue, 29 Dec 2020 23:49:02 +0000 (GMT) Mail-Followup-To: Alan Third , Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 45502@debbugs.gnu.org, Daniel =?UTF-8?Q?Mart=C3=ADn?= Content-Disposition: inline In-Reply-To: <99CD03DA-DF1F-4C2C-A2FA-DFD7DF3B2750@acm.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196987 Archived-At: On Tue, Dec 29, 2020 at 11:53:59PM +0100, Mattias Engdegård wrote: > 29 dec. 2020 kl. 22.24 skrev Alan Third : > > > I've pushed a small change. I also set the alloc'd objects to > > autorelease. We need to do that because when they're assigned to the > > NSMenuItem it will retain them, and because we alloc'd them we already > > have them retained once. > > > > At least I hope that's right. For some reason I've found the > > retain/release cycle really hard to understand, but I think I'm > > getting there now. > > Thanks! Is this the standard way of doing it? The objects that you > marked autorelease (tab and pstyle) are only used for the extent of > that method; I take it you prefer autorelease to sending them > 'release' at the end of the method? I think it's maybe visually a little neater to use autorelease, but either way works and I would probably do it the other way in different circumstances. Feel free to change it if you want. > Presumably 'atitle' should be sent autorelease (or release) as well? Yes, I missed that one. And actually, I think the alloc'd NSMenuItem on line 484 will need released too. It should probably be autoreleased because it's returned to the calling function, and the caller can then decide whether to retain it or not (it doesn't in this case). -- Alan Third