From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#52293: 29.0.50; [PATCH] Prevent further cases of duplicated separators in context menus Date: Sun, 5 Dec 2021 20:50:32 -0800 Message-ID: References: <86tufn5jn9.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2989"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52293@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 06 05:51: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 1mu5y5-0000aZ-Pa for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 05:51:13 +0100 Original-Received: from localhost ([::1]:56396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mu5y4-00043f-M7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Dec 2021 23:51:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mu5xw-00041e-Ut for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 23:51:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mu5xu-0005vz-Gl for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 23:51:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mu5xu-0004vJ-B8 for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 23:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Dec 2021 04:51: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.163876624018893 (code B ref 52293); Mon, 06 Dec 2021 04:51:02 +0000 Original-Received: (at 52293) by debbugs.gnu.org; 6 Dec 2021 04:50:40 +0000 Original-Received: from localhost ([127.0.0.1]:60251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mu5xY-0004uf-J3 for submit@debbugs.gnu.org; Sun, 05 Dec 2021 23:50:40 -0500 Original-Received: from mail-pg1-f176.google.com ([209.85.215.176]:44783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mu5xW-0004uT-FD for 52293@debbugs.gnu.org; Sun, 05 Dec 2021 23:50:39 -0500 Original-Received: by mail-pg1-f176.google.com with SMTP id m15so9285709pgu.11 for <52293@debbugs.gnu.org>; Sun, 05 Dec 2021 20:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=MC9LWo7QzMOI9GWTwNeqvyPgN2yFHGxElGtkcebqWVc=; b=W7wd/Q/rBSrQ8lf/TgHX4nnNS7lAzK1KNVRzs+iLl5S0kcEAJVbMekGPEejYuWXC9C WlaLyvB4MPW4+CQqt269jfREGx8crIITxWX4cl4LUgjXzrUTuEt+3T0z215LpjkW+Lv2 6rBIcuQdPEqYFnpkzLH6IEpkyaabuCHYm24KsYTjWmGDiqq7qqdyYPwKALT19ZIwOZ8Y 2QzpqK7xDYtZj93yKNMVTXCFfmeSXIl1RO+Qs+nqhMH+PypGkKvaKQxJwfzCNl8XEoh1 jY3zhZgrFHV6KJe4ikMH9f3O2rbFfiE6NenaFEy8Sy4XBvrxvAQypYyWVOC56ZtyKa6l A5GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MC9LWo7QzMOI9GWTwNeqvyPgN2yFHGxElGtkcebqWVc=; b=JEbd1fDc8s8SK8W13rJz4X1WKt7TsSPpMlA1ggcqiNBvqontDXkgYuF4jHV7tuZ/rl +yl7foP2GFRvPWEcC86AYuAqi7g4nCcolKBErE+ucotPx2pr095opNOU3qMztokoD8ud N2SI52aqpINCywlvwt0V8zHfdThqh75R8AYAh0rC6fBRr3sIlmlPBaTYhGaBdo1BRY+f l2cr/+ZOlrWH2u3/JXCjms/7uDmA26mtcWIvpHiU75KZwA1VOgxDXXX2OSQYy+EfA540 Gy/2r/63uDx1uWPVlsfiUBrH0NX80xL+abipcmfQuADi1acnUyHOEmM/6b0Md5EfKCAd 3s9g== X-Gm-Message-State: AOAM533407bTVDVE3GXWHwbRYcLWd2GYwMvyymxWIFgJTcwYLjxUioJF Xa2REFzA87n5hq0PybzmO9l47plL6UM= X-Google-Smtp-Source: ABdhPJw8CqEIwTO7XmONaUiTvjJ/h+1UL3ageaWiB5QJUEhTaq9EadqG8FGFA1cOlTKGvwFswAm2kQ== X-Received: by 2002:a63:170b:: with SMTP id x11mr13907286pgl.71.1638766232648; Sun, 05 Dec 2021 20:50:32 -0800 (PST) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id d1sm10678339pfv.194.2021.12.05.20.50.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Dec 2021 20:50:32 -0800 (PST) In-Reply-To: <86tufn5jn9.fsf@mail.linkov.net> Content-Language: en-US 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:221713 Archived-At: On 12/5/2021 9:59 AM, Juri Linkov wrote: >> (defun help-mode-context-menu (menu click) >> "Populate MENU with Help mode commands at CLICK." >> - (define-key menu [help-mode-separator] menu-bar-separator) >> + (define-key-after menu [help-mode-separator] menu-bar-separator >> + 'top-separator) > > Now I realized that it's possible to do the same without 'top-separator': > > (define-key-after menu [help-mode-separator] menu-bar-separator > "Context Menu") > > Or when the title string is defined as a variable: > > (defvar context-menu-title "Context Menu") > > (define-key-after menu [help-mode-separator] menu-bar-separator > context-menu-title) > > But maybe 'top-separator' still could be used for clarity? > Or it increases complexity? Hmm, that might work. One downside is that I think it makes it harder for context menu functions to change the menu's title/prompt to something else. Of course, if we used `context-menu-title' as the anchor like your example above, it should still be possible to update the menu title via `context-menu-filter-function'. That would be trickier to use though, at least in the situations I have in mind. For example, I added a very limited context menu that uses the menu title in my config under Emacs 27 for org-mode links: I can right-click and it shows a context menu with the URL as the title and menu items for different ways to open the URL (in Firefox, Firefox Private Browsing, or EWW). It's nice to be able to see the URL since that can influence which item I choose. Updating this part of my config for Emacs 28 was actually what prompted me to start looking into `context-menu-mode' in more detail. It would be easier to implement this if context menu functions didn't rely on the context menu title having a particular value.