GNU bug report logs - #62250
29.0.60; Allow context menu from text properties to not override everything

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Augusto Stoffel <arstoffel@HIDDEN>; dated Sat, 18 Mar 2023 07:52:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 62250 <at> debbugs.gnu.org:


Received: (at 62250) by debbugs.gnu.org; 18 Mar 2023 11:34:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 18 07:34:04 2023
Received: from localhost ([127.0.0.1]:46431 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pdUp1-0006Q5-RV
	for submit <at> debbugs.gnu.org; Sat, 18 Mar 2023 07:34:04 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33178)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pdUp0-0006P4-8M
 for 62250 <at> debbugs.gnu.org; Sat, 18 Mar 2023 07:34:02 -0400
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 <eliz@HIDDEN>)
 id 1pdUou-0004Ia-Vq; Sat, 18 Mar 2023 07:33:56 -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=zviD1RwgW+zAVW5WN1UTrDkQpgOD2h+qMPUKP/frHlI=; b=qE4hg6HJK+Xu
 68IntFwQtIsyDGNbtvK55JtzmhAZktdu+0jCxINw7ZHTM6klJV42mqb1yJPju7/Jgq0w8iyQKwBuD
 BbT+zANigOxtKdijU+CEHD3h4PIAQv8Z5MR9MsIFezTzu/glX7jiZ+wOzLmdhzo0nEehuYg13wcGR
 A5sI/P7HB/S3iDf26nz4Iz8mLl7Ef7Ryv+fCegZOud8sSaUgLhznWARKMfWcN//kPGBE/fFvvj/hG
 f7u9Nieu0skBkqWzvJEbvkonM8F5wGz5z2MJtHZLJ4P02XenhtTk8g0dxjFgB+2t/pKTFXSSIF3tB
 u14pgn/VXfg/k+6nJW0qlw==;
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 <eliz@HIDDEN>)
 id 1pdUou-0000EN-23; Sat, 18 Mar 2023 07:33:56 -0400
Date: Sat, 18 Mar 2023 13:33:59 +0200
Message-Id: <83mt4ab8ew.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Augusto Stoffel <arstoffel@HIDDEN>
In-Reply-To: <875yay5mcw.fsf@HIDDEN> (message from Augusto Stoffel on Sat, 
 18 Mar 2023 12:29:19 +0100)
Subject: Re: bug#62250: 29.0.60; Allow context menu from text properties to
 not override everything
References: <87ttyixzt2.fsf@HIDDEN> <833562cvfb.fsf@HIDDEN>
 <878rfu1f37.fsf@HIDDEN> <83o7oqb8ug.fsf@HIDDEN> <875yay5mcw.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62250
Cc: 62250 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Augusto Stoffel <arstoffel@HIDDEN>
> Cc: 62250 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Sat, 18 Mar 2023 12:29:19 +0100
> 
> On Sat, 18 Mar 2023 at 13:24, Eli Zaretskii wrote:
> 
> > What MENU argument?  I see only a CLICK argument.
> 
> --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.
> When there is a text property `context-menu-function' at CLICK,
> it overrides all functions from `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---

Now I'm completely confused regarding your proposal.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#62250; Package emacs. Full text available.

Message received at 62250 <at> debbugs.gnu.org:


Received: (at 62250) by debbugs.gnu.org; 18 Mar 2023 11:29:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 18 07:29:29 2023
Received: from localhost ([127.0.0.1]:46419 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pdUka-0003sl-Qf
	for submit <at> debbugs.gnu.org; Sat, 18 Mar 2023 07:29:29 -0400
Received: from mail-ed1-f52.google.com ([209.85.208.52]:36760)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arstoffel@HIDDEN>) id 1pdUkY-0003sa-Ky
 for 62250 <at> debbugs.gnu.org; Sat, 18 Mar 2023 07:29:26 -0400
Received: by mail-ed1-f52.google.com with SMTP id w9so29778531edc.3
 for <62250 <at> debbugs.gnu.org>; Sat, 18 Mar 2023 04:29:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679138960;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=fUOWszO4XXB0IS6W6++K1Dtnz/HEjk6ZYjA/U5S5RTs=;
 b=BWuTq0GAFsMaEM07WpKI0XQ13MS0O70xe4l2329mELHXRQ3pkDqIhoA9mwG3xHDbk2
 E1kKxwXn3sXN6DpVyZaB81zp4dvAb/SJ4jTespT/QYhJesE2Y0GMpuBrNI5aS7/NE4ca
 /OJi+1iRH4g+xcQE+iKFGrvfCGaRzFVgK7XyP5+BToMlJtOmy/tuLovz6DkY0uBTlWEJ
 JsDLHuFaLKnsr5nPbTYWvqhBo5TAYzcWme4Y5oIpfMz2+Cqb6+7/Ysz0i0Iv8i18auS2
 g7JLPZ5n747TiDbXwJsD+QyvdWHPsow+3QDnmMfqt1CK7t+NYUmyYnn5RsBK7sX6SdGd
 cU4Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679138960;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=fUOWszO4XXB0IS6W6++K1Dtnz/HEjk6ZYjA/U5S5RTs=;
 b=Dupu8RQb5OYLR5BB/0F58Wb1S80GFttiQTsQMJwmeU8KswktQtfvbi/qTH0EBtJhXF
 Of9iCC8PH9nDJyhuznympjSnhJEPvcGjstCAyvTmRd8dYnlGiok2VL3bjBFrHa7+JcJo
 3UoIEqvfLzFL9TzeufgG5ckmBKNNTQYjuP+Mi/PGJqqPepgxUGWfN8sL6YOg+cQkFcFC
 hRyP0AwAD/ffd+PgW5nH0V8rZNHxG6kObgQ4KdoewXnCvqxCpvml7xj3me4I7ufgzOGk
 8N+HCWqhu/933xZ7ql2Juszz5F9cJVltO0BJQI+KoeUTvHzdjGGKtKztY+FXalCqdYEp
 BI5A==
X-Gm-Message-State: AO0yUKU/IPrGGH+l4H/qXuzxOQLlcVC2ZREYhNd5Ka81TQyL3kvuGpVG
 KqKZyX4AkjmHZApDMAMbkSk=
X-Google-Smtp-Source: AK7set9W89x8lJe01H7joFHg5mu2xtt4kc3NajbkM0+D64a48shaeTocQ251kh68+xCvrekWj4JAjw==
X-Received: by 2002:a17:906:c193:b0:932:1af9:7386 with SMTP id
 g19-20020a170906c19300b009321af97386mr2431433ejz.27.1679138960663; 
 Sat, 18 Mar 2023 04:29:20 -0700 (PDT)
Received: from ars3 ([2a02:8109:8ac0:56d0::8ca4])
 by smtp.gmail.com with ESMTPSA id
 gz4-20020a170907a04400b0090e0a4e1bacsm2053761ejc.159.2023.03.18.04.29.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 18 Mar 2023 04:29:20 -0700 (PDT)
From: Augusto Stoffel <arstoffel@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#62250: 29.0.60; Allow context menu from text properties to
 not override everything
In-Reply-To: <83o7oqb8ug.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 18 Mar
 2023 13:24:39 +0200")
References: <87ttyixzt2.fsf@HIDDEN> <833562cvfb.fsf@HIDDEN>
 <878rfu1f37.fsf@HIDDEN> <83o7oqb8ug.fsf@HIDDEN>
Date: Sat, 18 Mar 2023 12:29:19 +0100
Message-ID: <875yay5mcw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 62250
Cc: 62250 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sat, 18 Mar 2023 at 13:24, Eli Zaretskii wrote:

> What MENU argument?  I see only a CLICK argument.

--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.
When there is a text property `context-menu-function' at CLICK,
it overrides all functions from `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---




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#62250; Package emacs. Full text available.

Message received at 62250 <at> debbugs.gnu.org:


Received: (at 62250) by debbugs.gnu.org; 18 Mar 2023 11:24:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 18 07:24:45 2023
Received: from localhost ([127.0.0.1]:46405 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pdUg0-0003lZ-TA
	for submit <at> debbugs.gnu.org; Sat, 18 Mar 2023 07:24:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42430)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pdUfz-0003lL-9m
 for 62250 <at> debbugs.gnu.org; Sat, 18 Mar 2023 07:24:43 -0400
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 <eliz@HIDDEN>)
 id 1pdUft-00024X-2W; Sat, 18 Mar 2023 07:24:37 -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=2j540Y42Gn5LYRXpSR7m+36t8ikifEbKF6R41Fztc48=; b=jubU6JSH1IKL
 wEv24uET1WFViG1vmzzDV8eWx1LoyAFyau+FRVgTulD1zoXlB1D961YpKETNZvvMuJvvciO7pdoO+
 0+Z4/RyPaPeQCzPlnS0oWteUKq2moQbrHOogkkKPTzjuWOZTfkz78ischyPdHIy9h1Wga3UPqvln6
 xnEcHfdrD6fRzd0ZAm+A7L19v7T2V9SoqQP1Zeu/mKH3g6+yYRgcOqsENeLN0VZsROnaKph7V9Aj8
 DPcDgyqy3FHOJnzqVsYtekUOnGswPOJbPXXw8CI8/lBNx+eqPP/TwyYenfZGyhgDAjoeGx0ZJOj8p
 nFHcwvaE8ws5iGS4lte1Ng==;
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 <eliz@HIDDEN>)
 id 1pdUfs-000440-GP; Sat, 18 Mar 2023 07:24:36 -0400
Date: Sat, 18 Mar 2023 13:24:39 +0200
Message-Id: <83o7oqb8ug.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Augusto Stoffel <arstoffel@HIDDEN>
In-Reply-To: <878rfu1f37.fsf@HIDDEN> (message from Augusto Stoffel on Sat, 
 18 Mar 2023 12:19:56 +0100)
Subject: Re: bug#62250: 29.0.60; Allow context menu from text properties to
 not override everything
References: <87ttyixzt2.fsf@HIDDEN> <833562cvfb.fsf@HIDDEN>
 <878rfu1f37.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62250
Cc: 62250 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Augusto Stoffel <arstoffel@HIDDEN>
> Cc: 62250 <at> debbugs.gnu.org,  juri@HIDDEN
> Date: Sat, 18 Mar 2023 12:19:56 +0100
> 
> On Sat, 18 Mar 2023 at 10:31, Eli Zaretskii wrote:
> 
> >> Alternatively, it can return a completely new menu.  In
> >> this case, no further functions from `context-menu-functions' are
> >> called.
> 
> > 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?
> 
> It's explained in the bit I kept: you ignore the MENU argument and
> return a totally new keymap / not `eq'.

What MENU argument?  I see only a CLICK argument.

> Adding things at the beginning or end of a menu is an option that
> easy-menu-add-item etc already offer, right?

I admit I don't see how easy-menu-add-item is related to this.

> Note that currently a member of context-menu-functions cannot override
> the menu, and a context-menu-function cannot _not_ override it.  My
> suggestions allows all possibilities.

That part I did understand, but it looked to me that your proposal
stops short of covering all the possible situations.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#62250; Package emacs. Full text available.

Message received at 62250 <at> debbugs.gnu.org:


Received: (at 62250) by debbugs.gnu.org; 18 Mar 2023 11:20:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 18 07:20:05 2023
Received: from localhost ([127.0.0.1]:46396 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pdUbU-0003eN-RX
	for submit <at> debbugs.gnu.org; Sat, 18 Mar 2023 07:20:05 -0400
Received: from mail-ed1-f41.google.com ([209.85.208.41]:46614)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arstoffel@HIDDEN>) id 1pdUbT-0003dg-Ve
 for 62250 <at> debbugs.gnu.org; Sat, 18 Mar 2023 07:20:04 -0400
Received: by mail-ed1-f41.google.com with SMTP id eg48so29533961edb.13
 for <62250 <at> debbugs.gnu.org>; Sat, 18 Mar 2023 04:20:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679138398;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=4HIBOh9PI5hvc+JfFqJigk7pyW2WGF5cKM9+13YxF4U=;
 b=iYbF0flaGtnBUps5QJA9S9+PsJhXoUbPuvIz9+BiKoGYIyXhPmZlvY5Ehb4KCtnIH9
 UuRWhpXMQWGQNqy+1nI5fehKj/QVGiFoA/1c48rvKdpV+xYsWWdx5fCyvudAYxRK5j3n
 tMTa94FG4k/E+BomOTZF+Ud4p1cve/c0vC7qlQLcQ5x1rN7UU0OblldBmAfePU4fhm2X
 5vZEtQnr8PyiAHsC3/LC2wKn2bL//bN8ZokveQ0rlnH/kHAvdOCYQtFktEkiY4oys9ej
 iJe/LTDErMUWY/lXI22m5qw6xS1v3jS7oogCXKkKTeUZCcwJ1Y7DVgM4fl01wthByFYE
 4L8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679138398;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=4HIBOh9PI5hvc+JfFqJigk7pyW2WGF5cKM9+13YxF4U=;
 b=N4ygegWRQQ2rYOxuRgBuskzWDWXP7E/+csYz+AT3udr3DDrMl6bUgBJMm+vSmpQ7Ll
 smK2jMvryQB0sBVAJKl8HkjssFwgUWupUGc6pMsK0hm4iHIFzU874xXX2fVXcCxPSh9G
 vRETclbOEzEc/0te4jfsuSAQeskYPyhIiAW3zyDxGEvqTv5qUZq9g6FwKnzruWWvx00a
 IWo3JmET5BU1MLD0pIVZBFMPGYbavqmMt6HANHbTeBs3cV3qdPOppWT1lfz6UvAEsAHN
 JRI2kF+s2+U6rtuQqCaRnbngtGeiwT4ew5x7qYMvcosVEjH5LVobq8FMpCqYOIGUmNzE
 lEbA==
X-Gm-Message-State: AO0yUKUGhbuoYffz3f4DNihHPLo8P0koiWjXb1tVZ/lqXevDyNWB2+2a
 QMRsYKCDP158hNeDaipTZ/0=
X-Google-Smtp-Source: AK7set+IkBhZ/YjUFDuuTlG/X51L36Z14ObwqgGzdB9dfOfseOFG8OCy0rCfDdxJ9XV9x0P+8Lzsew==
X-Received: by 2002:a17:906:eb9a:b0:931:42d2:a77f with SMTP id
 mh26-20020a170906eb9a00b0093142d2a77fmr2353522ejb.15.1679138397724; 
 Sat, 18 Mar 2023 04:19:57 -0700 (PDT)
Received: from ars3 ([2a02:8109:8ac0:56d0::8ca4])
 by smtp.gmail.com with ESMTPSA id
 zc14-20020a170906988e00b00927f6c799e6sm2075424ejb.132.2023.03.18.04.19.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 18 Mar 2023 04:19:57 -0700 (PDT)
From: Augusto Stoffel <arstoffel@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#62250: 29.0.60; Allow context menu from text properties to
 not override everything
In-Reply-To: <833562cvfb.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 18 Mar
 2023 10:31:36 +0200")
References: <87ttyixzt2.fsf@HIDDEN> <833562cvfb.fsf@HIDDEN>
Date: Sat, 18 Mar 2023 12:19:56 +0100
Message-ID: <878rfu1f37.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 62250
Cc: 62250 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sat, 18 Mar 2023 at 10:31, Eli Zaretskii wrote:

>> Alternatively, it can return a completely new menu.  In
>> this case, no further functions from `context-menu-functions' are
>> called.

> 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?

It's explained in the bit I kept: you ignore the MENU argument and
return a totally new keymap / not `eq'.  Adding things at the beginning
or end of a menu is an option that easy-menu-add-item etc already offer,
right?

Note that currently a member of context-menu-functions cannot override
the menu, and a context-menu-function cannot _not_ override it.  My
suggestions allows all possibilities.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#62250; Package emacs. Full text available.

Message received at 62250 <at> debbugs.gnu.org:


Received: (at 62250) by debbugs.gnu.org; 18 Mar 2023 08:31:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 18 04:31:42 2023
Received: from localhost ([127.0.0.1]:46155 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pdRyX-0004w1-Tp
	for submit <at> debbugs.gnu.org; Sat, 18 Mar 2023 04:31:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49782)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pdRyW-0004vd-9r
 for 62250 <at> debbugs.gnu.org; Sat, 18 Mar 2023 04:31:40 -0400
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 <eliz@HIDDEN>)
 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==;
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 <eliz@HIDDEN>)
 id 1pdRyP-0003vU-TQ; Sat, 18 Mar 2023 04:31:34 -0400
Date: Sat, 18 Mar 2023 10:31:36 +0200
Message-Id: <833562cvfb.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Augusto Stoffel <arstoffel@HIDDEN>
In-Reply-To: <87ttyixzt2.fsf@HIDDEN> (message from Augusto Stoffel on Sat, 
 18 Mar 2023 08:51:21 +0100)
Subject: Re: bug#62250: 29.0.60;
 Allow context menu from text properties to not override everything
References: <87ttyixzt2.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 62250
Cc: 62250 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Juri Linkov <juri@HIDDEN>
> From: Augusto Stoffel <arstoffel@HIDDEN>
> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#62250; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Mar 2023 07:51:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 18 03:51:32 2023
Received: from localhost ([127.0.0.1]:46115 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pdRLf-0003tY-UM
	for submit <at> debbugs.gnu.org; Sat, 18 Mar 2023 03:51:32 -0400
Received: from lists.gnu.org ([209.51.188.17]:53926)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arstoffel@HIDDEN>) id 1pdRLd-0003tO-5h
 for submit <at> debbugs.gnu.org; Sat, 18 Mar 2023 03:51:30 -0400
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 <arstoffel@HIDDEN>)
 id 1pdRLc-0006bJ-VC
 for bug-gnu-emacs@HIDDEN; Sat, 18 Mar 2023 03:51:28 -0400
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 <arstoffel@HIDDEN>)
 id 1pdRLb-0003jh-ES
 for bug-gnu-emacs@HIDDEN; Sat, 18 Mar 2023 03:51:28 -0400
Received: by mail-ed1-x534.google.com with SMTP id y4so28626920edo.2
 for <bug-gnu-emacs@HIDDEN>; 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)
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 <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 18 Mar 2023 00:51:22 -0700 (PDT)
From: Augusto Stoffel <arstoffel@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.60; Allow context menu from text properties to not override
 everything
X-Debbugs-Cc: Juri Linkov <juri@HIDDEN>
Date: Sat, 18 Mar 2023 08:51:21 +0100
Message-ID: <87ttyixzt2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::534;
 envelope-from=arstoffel@HIDDEN; 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-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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---




Acknowledgement sent to Augusto Stoffel <arstoffel@HIDDEN>:
New bug report received and forwarded. Copy sent to juri@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to juri@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#62250; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 18 Mar 2023 11:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.