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#50067: Context menus Date: Thu, 18 Nov 2021 20:38:53 +0200 Organization: LINKOV.NET Message-ID: <86bl2hux4y.fsf@mail.linkov.net> References: <87pmufb3u0.fsf@mail.linkov.net> <875ytr1vkp.fsf@mail.linkov.net> <864k8mwgzr.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14387"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) To: 50067@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 18 19:40:24 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 1mnmKd-0003bV-Op for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Nov 2021 19:40:23 +0100 Original-Received: from localhost ([::1]:45298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnmKc-0001O5-OA for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Nov 2021 13:40:22 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnmKJ-0001NL-M0 for bug-gnu-emacs@gnu.org; Thu, 18 Nov 2021 13:40:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnmKJ-0000cM-0y for bug-gnu-emacs@gnu.org; Thu, 18 Nov 2021 13:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mnmKI-0002PQ-GO for bug-gnu-emacs@gnu.org; Thu, 18 Nov 2021 13:40: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: Thu, 18 Nov 2021 18:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50067 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 50067-submit@debbugs.gnu.org id=B50067.16372607819215 (code B ref 50067); Thu, 18 Nov 2021 18:40:02 +0000 Original-Received: (at 50067) by debbugs.gnu.org; 18 Nov 2021 18:39:41 +0000 Original-Received: from localhost ([127.0.0.1]:37163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnmJx-0002OW-0T for submit@debbugs.gnu.org; Thu, 18 Nov 2021 13:39:41 -0500 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:45925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnmJv-0002OH-E7 for 50067@debbugs.gnu.org; Thu, 18 Nov 2021 13:39:40 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 6345FFF807 for <50067@debbugs.gnu.org>; Thu, 18 Nov 2021 18:39:31 +0000 (UTC) In-Reply-To: <864k8mwgzr.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 08 Nov 2021 22:05:12 +0200") 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:220342 Archived-At: >> Currently the option context-menu-global of context-menu-functions >> doesn't take into account the variable menu-bar-final-items >> to properly order the menu items. This patch makes it possible >> to order the items of global-map instead of menu-bar-current-active-maps >> used in menu-bar-keymap by default: > > Actually, here is a better patch that will also allow sorting items on > context-menu-local as well. The same KEYMAP arg of menu-bar-keymap > could be used also in mouse-menu-bar-map to sort items of [C-down-mouse-3] > in the right order (they were unsorted for a long time): Only part of the patch that fixes the new feature was pushed to emacs-28. But the following part that fixes the old function could pushed to master later: > diff --git a/lisp/mouse.el b/lisp/mouse.el > index d6912892ef..5b9ae121d7 100644 > --- a/lisp/mouse.el > +++ b/lisp/mouse.el > @@ -271,10 +271,10 @@ mouse-menu-bar-map > ;; FIXME: We have a problem here: we have to use the global/local/minor > ;; so they're displayed in the expected order, but later on in the command > ;; loop, they're actually looked up in the opposite order. > - (apply 'append > - global-menu > - local-menu > - minor-mode-menus))) > + (menu-bar-keymap (apply 'append > + global-menu > + local-menu > + minor-mode-menus))))