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: 29.0.50; [PATCH v2] Prevent further cases of duplicated separators in context menus Date: Tue, 07 Dec 2021 10:19:20 +0200 Organization: LINKOV.NET Message-ID: <86h7bkhlo7.fsf@mail.linkov.net> References: <86tufn5jn9.fsf@mail.linkov.net> <86pmqa14fc.fsf@mail.linkov.net> <15eebcb1-b67a-8363-bc23-cf113913856f@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="21692"; 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 To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 07 09:34:35 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 1muVvn-0005VR-6L for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Dec 2021 09:34:35 +0100 Original-Received: from localhost ([::1]:34238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muVvm-0003MA-3p for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Dec 2021 03:34:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muVvH-0002bL-7i for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2021 03:34:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52991) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muVvH-0005UY-06 for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2021 03:34:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1muVvG-0001eT-SP for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2021 03:34: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, 07 Dec 2021 08:34: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.16388660386332 (code B ref 52293); Tue, 07 Dec 2021 08:34:02 +0000 Original-Received: (at 52293) by debbugs.gnu.org; 7 Dec 2021 08:33:58 +0000 Original-Received: from localhost ([127.0.0.1]:36303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muVvC-0001e4-5B for submit@debbugs.gnu.org; Tue, 07 Dec 2021 03:33:58 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:45225) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muVvA-0001dc-MM for 52293@debbugs.gnu.org; Tue, 07 Dec 2021 03:33:57 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id BA6061C0002; Tue, 7 Dec 2021 08:33:48 +0000 (UTC) In-Reply-To: <15eebcb1-b67a-8363-bc23-cf113913856f@gmail.com> (Jim Porter's message of "Mon, 6 Dec 2021 19:54:11 -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:221821 Archived-At: > For the top separator, maybe instead of providing a function for users to > put wherever they like in `context-menu-functions', we could just add it > directly in `context-menu-map' immediately before calling the functions in > `context-menu-functions'? Since it's supposed to be at the top, it doesn't > make a lot of sense to be able to customize where it goes. > > It does makes sense to customize where `middle-separator' goes though; what > the user considers the "middle" depends on what other menu items are > normally present. However, if the user didn't include > `context-menu-middle-separator', then > > (define-key-after menu [foo] '(menu-item ...) 'middle-separator) > > just adds `foo' to the end of the menu. That seems ok to me. Then, adding > after `top-separator' puts your item at the beginning of the menu, and > adding after `middle-separator' puts your item at the middle or the end, > depending on the user's configuration. How does that sound to you? Thanks, this makes perfect sense. I vote for pushing this to emacs-28, so the authors of packages could rely on this scheme.