From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#52973: Adding a few context-menu-mode commands Date: Fri, 07 Jan 2022 10:37:58 +0200 Message-ID: <83k0fc54bd.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9046"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 52973@debbugs.gnu.org, juri@linkov.net To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 07 09:44:14 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 1n5kr8-0002G9-Fb for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jan 2022 09:44:14 +0100 Original-Received: from localhost ([::1]:59226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5kr7-0006Ax-Hw for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jan 2022 03:44:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5km6-0000nr-PE for bug-gnu-emacs@gnu.org; Fri, 07 Jan 2022 03:39:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5km6-0003V6-Es for bug-gnu-emacs@gnu.org; Fri, 07 Jan 2022 03:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n5km6-0001Z6-CR for bug-gnu-emacs@gnu.org; Fri, 07 Jan 2022 03:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Jan 2022 08:39:02 +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.16415446835844 (code B ref 52973); Fri, 07 Jan 2022 08:39:02 +0000 Original-Received: (at 52973) by debbugs.gnu.org; 7 Jan 2022 08:38:03 +0000 Original-Received: from localhost ([127.0.0.1]:42978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5kl9-0001WC-Cl for submit@debbugs.gnu.org; Fri, 07 Jan 2022 03:38:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5kl6-0001VN-JQ for 52973@debbugs.gnu.org; Fri, 07 Jan 2022 03:38:01 -0500 Original-Received: from [2001:470:142:3::e] (port=39514 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5kku-0003GL-2s; Fri, 07 Jan 2022 03:37:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ytCw1LTyxsH15wLxj9HGHNZonjQrD2sgKrbprIp9kEs=; b=DVqUvSyo+oyc 6tNH5yMf7EbodhATJRnG9LyWNWtlGrT6G+J//mB27H6E0dO3hIBFUhWbVkzvMFccDO4fVv3HZMYRK TL6Ne3lH20tonbs7T/ym4LBFvSa+1QMpUgcmj0nyJ/waPs1vTDh+Kz74g1MK+NgutdBLLZg1wwMF3 LNwPNhCLPsYUOrnYZ64mPy6qBILJs6Rpb2BgBwFyMTDMaYlF6HxZp3ictvudPx7f/yKJEuvcFOaS2 7Zd3y/YKNcN7PLGekIZ9rV6Z+hi05yKe8oOoV/eIrA+Rhd6oW9TnpVoVaxHGREDZh9m2ihpQvlwbb Rm9X5SrVqTo6k7ZJSS97ww==; Original-Received: from [87.69.77.57] (port=1961 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5kkp-0006VU-9A; Fri, 07 Jan 2022 03:37:48 -0500 In-Reply-To: <87iluwkkyn.fsf@posteo.net> (message from Philip Kaludercic on Fri, 07 Jan 2022 08:29:20 +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:223774 Archived-At: > From: Philip Kaludercic > Cc: Juri Linkov , Lars Ingebrigtsen , > 52973@debbugs.gnu.org > Date: Fri, 07 Jan 2022 08:29:20 +0000 > > Eli Zaretskii writes: > > >> The patches from Philip just add new functions. > >> Whether to include them in the default value > >> of the context function is a separate discussion. > > > > How does it make sense to add functions that aren't used? > > > > Lars, what is your opinion about these issues? Am I the only one who > > thinks that context-menu-mode should automatically activate context > > menus in every mode that has support for it? > > 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?