From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#52293: [External] : bug#52293: 29.0.50; [PATCH v3] Prevent further cases of duplicated separators in context menus Date: Tue, 14 Dec 2021 10:30:10 +0200 Organization: LINKOV.NET Message-ID: <86mtl3629t.fsf@mail.linkov.net> References: <86pmqa14fc.fsf@mail.linkov.net> <15eebcb1-b67a-8363-bc23-cf113913856f@gmail.com> <86h7bkhlo7.fsf@mail.linkov.net> <37047ada-fa33-88dd-5237-769611fec61b@gmail.com> <83wnkfw8ud.fsf@gnu.org> <86ilvysyq3.fsf@mail.linkov.net> <834k7ix4ij.fsf@gnu.org> <86pmq6taeb.fsf@mail.linkov.net> <83czm6unfs.fsf@gnu.org> <414be477-34d4-c777-f623-3e0e59c0dd08@gmail.com> <83o85mpaqb.fsf@gnu.org> <8e9b29cd-8700-1a60-1d91-b6995d8f433a@gmail.com> <86czm0eue5.fsf@mail.linkov.net> <8c440269-262a-ba78-6630-d3f90c2fcc19@gmail.com> <86fsqwmig7.fsf@mail.linkov.net> <1c1995a2-c033-51c8-4aa6-7458ad07c75c@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31036"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: "52293@debbugs.gnu.org" <52293@debbugs.gnu.org> To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 14 10:00:29 2021 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 1mx3fg-0007vE-KH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Dec 2021 10:00:28 +0100 Original-Received: from localhost ([::1]:53028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mx3fe-0007BL-Iv for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Dec 2021 04:00:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mx3fH-000792-9R for bug-gnu-emacs@gnu.org; Tue, 14 Dec 2021 04:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mx3fG-0008Pf-TM for bug-gnu-emacs@gnu.org; Tue, 14 Dec 2021 04:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mx3fG-00025h-Oi for bug-gnu-emacs@gnu.org; Tue, 14 Dec 2021 04:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Dec 2021 09:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52293 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52293-submit@debbugs.gnu.org id=B52293.16394723807960 (code B ref 52293); Tue, 14 Dec 2021 09:00:02 +0000 Original-Received: (at 52293) by debbugs.gnu.org; 14 Dec 2021 08:59:40 +0000 Original-Received: from localhost ([127.0.0.1]:57559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mx3eu-00024K-8D for submit@debbugs.gnu.org; Tue, 14 Dec 2021 03:59:40 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:32843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mx3er-000245-Iy for 52293@debbugs.gnu.org; Tue, 14 Dec 2021 03:59:38 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 5DD221C000B; Tue, 14 Dec 2021 08:59:29 +0000 (UTC) In-Reply-To: <1c1995a2-c033-51c8-4aa6-7458ad07c75c@gmail.com> (Jim Porter's message of "Mon, 13 Dec 2021 21:41:06 -0800") 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:222359 Archived-At: >> I agree that using an extend-format separator is a good idea, >> especially if we'll provide a special variable that will contain it. >> But I don't understand why opt-in. I think opt-out would be better >> since most of the time the users want to have de-duplicated menus. > > One benefit to this being opt-in would be that it would be possible to > (eventually) support the de-duplication behavior for *all* menus without us > having to worry about breaking compatibility for other menus[1]. If we > provide a constant for people to use like in your earlier example[2], it > would be still be reasonably simple to use. > > I think it would be nice to (again, eventually) support this for all menus, > since it's probably useful in some other places, and it would keep the > differences between specific menus' behaviors to a minimum. As Drew already noted, other menus have no such problem because they are static, and the authors can easily ensure that a single separator is used between submenus. But context menus are dynamically constructed, and it's easier for authors just to add a separator even for empty submenus, relying on post-processing that will de-duplicate them. So better to make this opt-out for context menus, and opt-in for other menus, although I think this feature is not needed for other menus. >> Maybe better first to try fixing the problem using the separators? >> When this doesn't help, only then we could consider alternatives. > > Ok, let's stick with deduplication then. I'll try to write a patch that > doesn't require `top-separator', since that's easy for programmers to > forget about (no other menu requires doing that to put items at the > beginning). Thanks. The current question was raised by Drew who worried that sometimes authors might want to leave two adjacent separators for an empty submenu. But you answered this question that it can be addressed by using a special form of a separator with a menu-item. So I see no more problems here.