From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel 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 08:51:21 +0100 Message-ID: <87ttyixzt2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16256"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Juri Linkov To: 62250@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 18 08:52: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 1pdRMJ-00046o-RY for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Mar 2023 08:52:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pdRMB-0006f7-V4; Sat, 18 Mar 2023 03:52:03 -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 1pdRMA-0006ek-S4 for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 03:52: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 1pdRMA-0003qx-E4 for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 03:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pdRM9-0003uK-Oj; Sat, 18 Mar 2023 03:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: juri@linkov.net, bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Mar 2023 07:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62250 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Juri Linkov Original-Received: via spool by submit@debbugs.gnu.org id=B.167912589214980 (code B ref -1); Sat, 18 Mar 2023 07:52:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Mar 2023 07:51:32 +0000 Original-Received: from localhost ([127.0.0.1]:46115 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdRLf-0003tY-UM for submit@debbugs.gnu.org; Sat, 18 Mar 2023 03:51:32 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdRLd-0003tO-5h for submit@debbugs.gnu.org; Sat, 18 Mar 2023 03:51:30 -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 1pdRLc-0006bJ-VC for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 03:51:28 -0400 Original-Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pdRLb-0003jh-ES for bug-gnu-emacs@gnu.org; Sat, 18 Mar 2023 03:51:28 -0400 Original-Received: by mail-ed1-x534.google.com with SMTP id y4so28626920edo.2 for ; Sat, 18 Mar 2023 00:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679125883; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=jjcTbO7/19hD9V2LFrsfdjm6u4VVRN1QeIuyDmJI5rg=; b=KZZCa+NDjjO05OvfiLMJ8wGf8aAAnU/Np+rJe6pJ0wi/Vt8FB81mUrB0sNsvYCvVaj QhX/0R/593HooRmZbQJ+1H6NnSUlP+Lokz6/EDlCIUrbP9DgeDN8po5Ss9IU9WJSMyNc qmh/p4aOKJg/NbszKsfhMA7r2JFOeV0bPsqoTySl4Y22ak5iap371grBM+pJGovT0zEf sQz6kdntvGD16h2+BuvMlAIKpW9uOEnlZFFbpL/tnPznF9ZodQil9P1+uof/fmrM2Cu/ iayMaR6moVLSYr6YSNPD6K9kdM61Z4isyhAD5FdbWWb7AcUUMriBeUGIiRyKLXo+PaMP SKeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679125883; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jjcTbO7/19hD9V2LFrsfdjm6u4VVRN1QeIuyDmJI5rg=; b=WzwngQukSIHCEXgfC+aDFQhU5hF4O9xe79vdtyMDaD8DCmSCEl/STAfdwGSUGPOMu4 nacJc/ziX+JQEvcGfQcWEZe4/+Yd93ga1x8p3RZtu1aW/h+din8/ax6YGrHWkTwSyrem 1+pTf8/hdjpqSAVUreofmh5aA4O/E8sF4j1Uo43R5O5fgCyGm2ESluklHqB2ANNRPAv/ rl9H2h/mnPwUndrDUYxKUn6F7TLvXNy+OlbQs/Bln4HI2x1CSOOMCuR1Bww1xOtxpO48 CefNu6idBtMkbsOfpjuO0iUsNaeB99fBNNVs+MCx1IBzQFqgw4svnUPFQYpei2kDo7dh mhTw== X-Gm-Message-State: AO0yUKV/lOK/B3DgByaYhe0v7tQnGBK3e8AjCNeo/xFK5dpIFgj7PGgN IXTVxc/1NMCOu30C/YrW97tupB7SfZs= X-Google-Smtp-Source: AK7set8qrDhp72jNlC/5l1fKu4E8WRTHmGrtGDLb5KPLnXyaLGP7Tefy1ktZW9hDA4ZAZjakKOpn0w== X-Received: by 2002:a17:906:fb0d:b0:8b2:d30:e722 with SMTP id lz13-20020a170906fb0d00b008b20d30e722mr2356692ejb.3.1679125883524; Sat, 18 Mar 2023 00:51:23 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::8ca4]) by smtp.gmail.com with ESMTPSA id jj4-20020a170907984400b009323f08827dsm1403606ejc.13.2023.03.18.00.51.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Mar 2023 00:51:22 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=arstoffel@gmail.com; helo=mail-ed1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:258138 Archived-At: 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---