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#62250: 29.0.60; Allow context menu from text properties to not override everything Date: Sat, 18 Mar 2023 10:31:36 +0200 Message-ID: <833562cvfb.fsf@gnu.org> References: <87ttyixzt2.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1751"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62250@debbugs.gnu.org, juri@linkov.net To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 18 09:32:12 2023 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 1pdRz2-0000Er-RG for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Mar 2023 09:32:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pdRyu-0006kF-Mt; Sat, 18 Mar 2023 04:32:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdRys-0006jz-5I for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 04:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pdRyr-0005r9-TZ for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 04:32:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pdRyr-0004x6-Os for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 04:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Mar 2023 08:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62250 X-GNU-PR-Package: emacs Original-Received: via spool by 62250-submit@debbugs.gnu.org id=B62250.167912830218979 (code B ref 62250); Sat, 18 Mar 2023 08:32:01 +0000 Original-Received: (at 62250) by debbugs.gnu.org; 18 Mar 2023 08:31:42 +0000 Original-Received: from localhost ([127.0.0.1]:46155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdRyX-0004w1-Tp for submit@debbugs.gnu.org; Sat, 18 Mar 2023 04:31:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdRyW-0004vd-9r for 62250@debbugs.gnu.org; Sat, 18 Mar 2023 04:31:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdRyQ-0005nF-GP; Sat, 18 Mar 2023 04:31:34 -0400 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=DXTgpLlHK4QBEOmu3BX4Zq+Hhw1AY45oKiDUnVrV+8E=; b=dyQNDxrlKBqN JCU0jaHfnbdK9Gc5Ag5hcX+dsX7Nnlnci2KATEc/bCIGrD3gBMQG1EUF7KNRJfT+i0wbgZ8zWPBZ/ K18YPw39k1ue4G6gUmrrrInssGoQ6fCcHSwJmkdxUzKTdTX1PuIuSOdpelk4J0HroA0dFcc1iel7M DPiQF2ChS3Ye1moZHseRnF01C25PVn6ox90cC8etI7NmV1WOXyIYruqj5ejmqODIHHsErGG/cyZu8 8hlfq5fnj3iqh5RunMmkEzFsOG55Vl/HjJIcByJY9Tr49v3jwcBZ+P8xQIhg50+Kt0qVey8lWG6lb HkyaFUrg/5/VFYxPLS/YLw==; Original-Received: from [87.69.77.57] (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 1pdRyP-0003vU-TQ; Sat, 18 Mar 2023 04:31:34 -0400 In-Reply-To: <87ttyixzt2.fsf@gmail.com> (message from Augusto Stoffel on Sat, 18 Mar 2023 08:51:21 +0100) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:258142 Archived-At: > Cc: Juri Linkov > From: Augusto Stoffel > Date: Sat, 18 Mar 2023 08:51:21 +0100 > > It would be nice if the context menu defined by a text property had the > option of adding to instead of overriding the menu specified by > `context-menu-functions'. > > I think this can be done in a backwards-compatible way as follows: > > --8<---------------cut here---------------start------------->8--- > (defun context-menu-map (&optional click) > "Return menu map constructed for context near mouse CLICK. > The menu is populated by calling functions from > `context-menu-functions'. Each function receives the menu and the mouse > click event and returns the same menu after adding own menu items to the > composite menu. Alternatively, it can return a completely new menu. In > this case, no further functions from `context-menu-functions' are > called. > > When there is a text property `context-menu-function' at CLICK, it is > handled as if it were the first entry of `context-menu-functions'. > > At the end, it's possible to modify the final menu by specifying the > function `context-menu-filter-function'." > --8<---------------cut here---------------end--------------->8--- What if a Lisp program _does_ want to override the menu specified by context-menu-functions? or what if it wants the menu specified by the text property to be the _last_ entry, not the first?