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#50552: 28.0.50; Add context-menu-occur Date: Sat, 02 Oct 2021 22:25:10 +0300 Organization: LINKOV.NET Message-ID: <87sfxjgrj5.fsf@mail.linkov.net> References: <87ilz5d9a1.fsf@posteo.net> <87o88xu13p.fsf@mail.linkov.net> <87a6khd316.fsf@posteo.net> <8735q8g9dj.fsf@mail.linkov.net> <874ka4v5ae.fsf@posteo.net> <87wnmwk8vh.fsf@posteo.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="24544"; 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: 50552@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 02 21:29:13 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 1mWkh7-0006HV-BH for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Oct 2021 21:29:13 +0200 Original-Received: from localhost ([::1]:59522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWkh5-0003bO-PL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Oct 2021 15:29:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWkfy-0001o3-NZ for bug-gnu-emacs@gnu.org; Sat, 02 Oct 2021 15:28:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWkfy-00078S-FG for bug-gnu-emacs@gnu.org; Sat, 02 Oct 2021 15:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWkfy-0000IM-7g for bug-gnu-emacs@gnu.org; Sat, 02 Oct 2021 15:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Oct 2021 19:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50552 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 50552-submit@debbugs.gnu.org id=B50552.16332028451073 (code B ref 50552); Sat, 02 Oct 2021 19:28:02 +0000 Original-Received: (at 50552) by debbugs.gnu.org; 2 Oct 2021 19:27:25 +0000 Original-Received: from localhost ([127.0.0.1]:60605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWkfM-0000HE-LW for submit@debbugs.gnu.org; Sat, 02 Oct 2021 15:27:24 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:57077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWkfK-0000Ga-JB for 50552@debbugs.gnu.org; Sat, 02 Oct 2021 15:27:23 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 74E70FF803; Sat, 2 Oct 2021 19:27:15 +0000 (UTC) In-Reply-To: <87wnmwk8vh.fsf@posteo.net> (Philip Kaludercic's message of "Fri, 01 Oct 2021 16:28:02 +0000") 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:216198 Archived-At: >>> The reasoning was the following: by default, dictionary.el is not loaded, >>> so its context menu item is not used. But when the user wants to use >>> dictionary.el and explicitly loads it, then automatically provide also >>> its context menu item. >> >> On this topic, I am not sure how good it is to do this >> automatically. One effect seems to be that context-menu-dictionary >> inserts itself at an unintended place in the menu (in my case as the >> first item, even though I'd prefer it to be further down). > > It turns out the issue here is that context-menu-dictionary uses > define-key instead of define-key-after. Here is a patch to fix it: To make the context menus in Emacs more in line with other apps the design principles were the following: 1. When a context function can detect context with 100% reliability that usually achieved by using e.g. text properties on short stretches of the buffer like links in eww and Info manuals, or file names in Dired, then corresponding menu items are placed at the top of the context menus, like link-related items are placed first in web browsers, e.g. "Open link", "Save link", etc. 2. After such items comes Undo/Redo and the region-related submenu. 3. When the context around the mouse click is not 100% bound to the action, then it's placed further down from the above items. So such items as "Look up in Manual" and "Find Definition" are placed below since they are activated on every word in the buffer, even on such words that are not valid program symbols. 4. The last items (major/minor mode menus) replicate the order of items from the menu-bar. So according to this design, you are right that context-menu-dictionary should be more below. And it should be placed to the position 3 that has the special marker named 'middle-separator'. Now fixed, thanks for the suggestion.