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#52237: 29.0.50; [PATCH] Doubled separators in context-menu-mode Date: Sat, 04 Dec 2021 21:50:20 +0200 Organization: LINKOV.NET Message-ID: <86h7bouq5f.fsf@mail.linkov.net> References: <0bbe5580-8e05-4e18-5b91-04b41b6f19bc@gmail.com> <07494cfd-0608-acb9-2839-e7ecbef4610c@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="6526"; 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: 52237@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 04 21:10:14 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 1mtbMK-0001Zb-V4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Dec 2021 21:10:12 +0100 Original-Received: from localhost ([::1]:49660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtbMJ-00010H-Qi for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Dec 2021 15:10:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbMB-0000yu-FA for bug-gnu-emacs@gnu.org; Sat, 04 Dec 2021 15:10:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43532) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbMB-000567-6f for bug-gnu-emacs@gnu.org; Sat, 04 Dec 2021 15:10:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtbMB-0004Ic-1z for bug-gnu-emacs@gnu.org; Sat, 04 Dec 2021 15:10:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Dec 2021 20:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52237 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo patch Original-Received: via spool by 52237-submit@debbugs.gnu.org id=B52237.163864859516470 (code B ref 52237); Sat, 04 Dec 2021 20:10:03 +0000 Original-Received: (at 52237) by debbugs.gnu.org; 4 Dec 2021 20:09:55 +0000 Original-Received: from localhost ([127.0.0.1]:55070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbM3-0004HZ-6u for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:09:55 -0500 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:65027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbM2-0004HJ-0i for 52237@debbugs.gnu.org; Sat, 04 Dec 2021 15:09:54 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 0C4C440002; Sat, 4 Dec 2021 20:09:46 +0000 (UTC) In-Reply-To: <07494cfd-0608-acb9-2839-e7ecbef4610c@gmail.com> (Jim Porter's message of "Thu, 2 Dec 2021 10:47: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:221497 Archived-At: > I found another odd case, but I'm not 100% sure the best way to fix it: > > emacs -Q --eval '(context-menu-mode)' > C-h o identity RET > ;; Right-click somewhere in the Help buffer > > There's a doubled separator after "Next Topic". Looking at the code, this > is because `help-mode-context-menu' inserts new items using `define-key', > which has the effect of putting the new items *before* the (hidden) menu > title. The resulting keymap ends up looking like this: > > (keymap > (Previous\ Topic ...) > (Next\ Topic ...) > (help-mode-separator "--") > #("Context Menu" 0 12 (hide t)) > (separator-undo "--") > ...) The core function that displays the menu can handle the menu title in the middle of the menu, so it wasn't a problem until the recent need to remove duplicate items. > Since there's a hidden item (the keymap title) between the > `help-mode-separator' and `separator-undo'[1], the de-duplication doesn't > handle that. Is there a standard/common way of defining a key such that it > goes immediately *after* the keymap's title? I guess we could add > `context-menu-top-separator' as an anchor (by analogy to > `context-menu-middle-separator'), but maybe there's a simpler way... I see no simpler way, so perhaps we need to add `context-menu-top-separator'. > [1] As an aside, is there a standard naming convention to use here? Should > "separator" go at the beginning of the name or the end? `context-menu-middle-separator' is a function, so it requires the `context-menu-' prefix. It adds the menu item [middle-separator]. Since "middle" is an adjective, the word order can't be "separator-middle". But "buffers-separator" doesn't look nicer than `separator-buffers'. If you could propose a more consistent naming convention, maybe it's not too late to rename these symbols on the release branch, because after the release it will be impossible to rename them.