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#52973: Adding a few context-menu-mode commands Date: Sat, 08 Jan 2022 20:30:06 +0200 Organization: LINKOV.NET Message-ID: <86bl0m13o1.fsf@mail.linkov.net> References: <87o84tp69h.fsf@posteo.net> <868rvwsezi.fsf@mail.linkov.net> <87czl75lyz.fsf@posteo.net> <86czl6au29.fsf@mail.linkov.net> <874k6idjod.fsf@posteo.net> <86o84pthgp.fsf@mail.linkov.net> <87pmp4lmfz.fsf@posteo.net> <86pmp41vby.fsf@mail.linkov.net> <83czl47ghd.fsf@gnu.org> <86ee5kzjo2.fsf@mail.linkov.net> <83bl0o6oei.fsf@gnu.org> <87iluwkkyn.fsf@posteo.net> <83k0fc54bd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20735"; 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: Philip Kaludercic , 52973@debbugs.gnu.org, larsi@gnus.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 08 19:37:19 2022 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 1n6Gad-0005F3-9z for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Jan 2022 19:37:19 +0100 Original-Received: from localhost ([::1]:46224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6Gab-0006Pe-R6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Jan 2022 13:37:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6GXT-0000kA-Pk for bug-gnu-emacs@gnu.org; Sat, 08 Jan 2022 13:34:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6GXR-00068G-Q0 for bug-gnu-emacs@gnu.org; Sat, 08 Jan 2022 13:34:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n6GXR-0001hP-Jk for bug-gnu-emacs@gnu.org; Sat, 08 Jan 2022 13:34:01 -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, 08 Jan 2022 18:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52973 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52973-submit@debbugs.gnu.org id=B52973.16416668156490 (code B ref 52973); Sat, 08 Jan 2022 18:34:01 +0000 Original-Received: (at 52973) by debbugs.gnu.org; 8 Jan 2022 18:33:35 +0000 Original-Received: from localhost ([127.0.0.1]:48691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6GX1-0001gb-KC for submit@debbugs.gnu.org; Sat, 08 Jan 2022 13:33:35 -0500 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:38153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n6GWx-0001gD-KU for 52973@debbugs.gnu.org; Sat, 08 Jan 2022 13:33:34 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 367AE200002; Sat, 8 Jan 2022 18:33:23 +0000 (UTC) In-Reply-To: <83k0fc54bd.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 07 Jan 2022 10:37:58 +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:223819 Archived-At: >> Unless I have missed it, do mean that all context menus should be loaded >> by default (auto loading all *-context-menu functions and adding all of >> them to the default value value of context-menu-functions), or that each >> context menu definition should be accompanied by a add-to-list on >> context-menu-functions? > > I'm not sure I understand why any of what you say should follow. I'm > probably missing something. > > My mental picture is that context menus are specific to modes. When a > buffer has certain modes turned on (one major mode and one or more > minor modes), those modes are already loaded, and so any functions > those modes define are already defined. So when the user right-clicks > some spot on display, and one or more modes have defined context-menu > items for this spot, the code which does that is already loaded, and > calling the functions to produce the menu should not need any > autoloading. > > As for add-to-list, if the implementation of context menus requires > adding stuff to some list only when the menu is about to be popped up, > then yes, the add-to-list should be done only when the user clicks. > But if adding to the list is done when a mode is loaded, then again, > since all the relevant modes are already loaded, these functions will > have been added to that list already. > > What am I missing? None of the proposed functions is specific to a mode. When the global value of context-menu-functions contains one of the proposed functions, right-clicking anywhere will autoload every package where such context functions are defined.