From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id iAz3GUUDaGf6yAAAe85BDQ:P1 (envelope-from ) for ; Sun, 22 Dec 2024 12:17:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id iAz3GUUDaGf6yAAAe85BDQ (envelope-from ) for ; Sun, 22 Dec 2024 13:17:09 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="ND/kghzM"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734869829; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=R6OEcQVvOTUPDR35W16UdJVcu/5jakmN3Vwh8uvjXGY=; b=QzNEXe+z4D1A+mwe8v/1PoJeQlndcycM0sOdwV6LTC+unQu/tt/Z775xXTJZnhtyxavkvC UaUPztBOt/Axnu9dEyGCsNE90aHIstT3Am50hlMt4PX2oGA24QNRuI+lgrqILFx9IRIVpG IU2wjjdy2ZteRq3nXapyp+Ylpre/3uccQ/vFwKqm9oV+Igf537oC88mQTXBfuTyyTbY20g CFZ1XAKSH1odLyBVYaWbS8PCgLYosJd/vXOJlvdbV+u1lPDV7/wK4xeVpjAXi+IVQoXhnf 7amEuLn0Eeoc9whtIbuCaKNco/dlD02mkUBxScTX/o0nrKleHTKQg84ZwQeyxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="ND/kghzM"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734869829; a=rsa-sha256; cv=none; b=PJQ0AWFHm4j4PKjqGpq98lo0k9oCzXuPpDDAkp0Jkv9ki3NFyjLP/mXrIZ4ouNr1RIgS9D nWO0oiJ964N+2jUyHwtNSrpLF6Z1bF4qwb35IoJJrvn2rah5Oc1Sw9IKL4RfHCdSlfVp6W O/fbsV2mfvfRZped20KM4EeYOpHNkLy+bf3+WlVTUEIfK/ifYI4/apH/6SjhhlttmPb6bD 28/lbOlcRUlLBhZbQIKRYtvn1pKBqkVpJl7SRZVVGITC07Ij6OJZUuAEh4QX6c5LhlQJRc 3mYdFeE7Git5ouH1isrV6reSDUaxKaH9qod75ai6nfBcw0iD+7DObf4Gi5P5uw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0451456B89 for ; Sun, 22 Dec 2024 13:17:09 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPKsw-0008Bz-D3; Sun, 22 Dec 2024 07:16:38 -0500 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 1tPKst-00087p-U5; Sun, 22 Dec 2024 07:16:36 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPKsr-0001Rr-U7; Sun, 22 Dec 2024 07:16:35 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5d41848901bso6357849a12.0; Sun, 22 Dec 2024 04:16:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734869792; x=1735474592; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=R6OEcQVvOTUPDR35W16UdJVcu/5jakmN3Vwh8uvjXGY=; b=ND/kghzMJQe0nGx5zHkxqedifXjWkxg75cLCo5P8+PY/+z5AFZTE1N5LAkQrroEqwk govhpRuv6Fo2VlRUZ4ins7Hi87Q67bAVYE1fdIQlLu2tLq/wm/vi4XMqZbIyX0GUBMU4 jnRyTwRjhNI/SSUSQym32OxQgGyC2KV93sqNz059WjAcwm51Y3UEwYXPVmofH15e9evI DlBQKmX9OFgDPuFVYRI4HTvUIHHdjMJfTdMAYVQ/V74PbgjsSdMUiFdy2tUOPA5j5FsT ZoKcyHeqqNnQ2S2Ljn1SFveN2Fo7+78DyT++DYGmZr1B9uXclA1g6QnVCXU6tGcFzp+Y 7QEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734869792; x=1735474592; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R6OEcQVvOTUPDR35W16UdJVcu/5jakmN3Vwh8uvjXGY=; b=fsYSksztSDk6Sef0doZTH46wtodg8+yd1jQe6uCcQBVNEGkhiZrKRuu2gtaR1fOHVX WgwtFpRRXnIqztyFTm+As1sF5L99ajigaSLDGRIzs1WoKzTn1qT8zxKFhX4RDFlMyA+2 UZ88dft7J99itpUzMZxcCjjGXCs8bH6z5PFIcxUqJUYjz+/U60/LPx7/ZvvQIP43ac3Q I+ZZlhsjzXmahurdamapM8Sld47BTh23ZFdVUiBnz/cIrvm0/ywci9fJSjZXEB0OD+/V g18mDyAkEWfk1R8/C81YfkPMMc0F4fh2PUh2m2nYVX9TWLIoBNZS//8Os/5VAAtrZvRa hISQ== X-Forwarded-Encrypted: i=1; AJvYcCW33yTjxJIh2xh+qqgtwknyRpuOvzL13lLak7uHjqgexsjnkKEBBh+oYXZC/IIv5pTo068JiVgF1MeG9n/VGw==@gnu.org, AJvYcCWnZYcCCjejKt1JORkboyhvjdFd0D/gR7SXAa+5J6Hc2pY4dWjNlAJwSboQ1wZtlSLMfUJ/4WsRLZAlBQ==@gnu.org X-Gm-Message-State: AOJu0YxVhuDGa7ZTKT3N7ilVH+8B5A3zJNcDN526GSH5J3/qG8oKCrwz FiBnUn03onZCJWuSFmPPA2J40h94QTJWuaiDxTWosTphPsXL9WIUdnBWknTdzrc3fEV4nlenCot lIBhqaP0H+P7jkpIT9dh2VTRGXr8= X-Gm-Gg: ASbGncsrMwIcM9kstk3BeRl7rk0lrUkwJpbS8nZyn3Ria0e5nuKOgCDEAX/GPsCqm2U 5CglNtuMW07pgSlCidiBRf/P+RWGIjDkAvt636Dc= X-Google-Smtp-Source: AGHT+IEXBGhShxxjilbGMC0yozhqIz/HX4zXTh23NSlc0JEN5uyK7gbwuhoeEFvIvT+jUf+MVQQO1Dmqoep1FDwPJzE= X-Received: by 2002:a05:6402:3204:b0:5d0:e9a8:4c96 with SMTP id 4fb4d7f45d1cf-5d81e7506bcmr8219398a12.9.1734869791365; Sun, 22 Dec 2024 04:16:31 -0800 (PST) MIME-Version: 1.0 References: <8734m28l9a.fsf@gmail.com> <874j4m9ep6.fsf@gmail.com> <87h68gfqj1.fsf@localhost> <87pln3f3cc.fsf@localhost> <87jzd9ojj0.fsf@localhost> <87cyj0ajm9.fsf@gmail.com> <87zfm4s50x.fsf@localhost> <87wmh8s358.fsf@localhost> <87y11nwp9z.fsf@gmail.com> <87v7wd9a2h.fsf@localhost> <878qt7fbki.fsf@gmail.com> <87o71jwdxz.fsf@localhost> <87wmg6edr0.fsf@gmail.com> <87msgzh1dh.fsf@localhost> <87frmq6ufj.fsf@mail.linkov.net> <87zfkx1fha.fsf@localhost> <8734io3xyo.fsf@mail.linkov.net> <87ttb3cxk5.fsf@localhost> In-Reply-To: <87ttb3cxk5.fsf@localhost> From: =?UTF-8?Q?Tor=2Dbj=C3=B6rn_Claesson?= Date: Sun, 22 Dec 2024 14:16:20 +0200 Message-ID: Subject: Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark? To: Ihor Radchenko Cc: Juri Linkov , emacs-devel@gnu.org, emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000a563ed0629dad93c" Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=tclaesson@gmail.com; helo=mail-ed1-x536.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, HTML_MESSAGE=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: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 0451456B89 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -3.40 X-Spam-Score: -3.40 X-TUID: vQ+Vt52SxMZa --000000000000a563ed0629dad93c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi! Thanks all for the great discussion! Just so I understand: we are talking about simple cases of offering multiple actions (possibly on objects), and not more complex things such as the export menu, with async options etc= ? > Tentatively, I am thinking about the following: > > For a given Emacs "prefix" command (e.g. org-open-at-point), we define a > set of customizations: > > 1. List of possible actions: ((name1 . action1 props) (name2 . action2 ...) ...) > PROPS is a plist defining extra properties like key-binding, display > string, maybe something else to be used in the future. > 2. Menu interface to use (transient, context-menu, embark, which-key) > 3. Layout settings for the specific interfaces. For example, transient > layout definition. Do we need 3? Could we decide on a way to specify layout properties in props? We could have e.g. a group name which would translate to a transient column= . The citation follower prototype works similarly to right click menus of mainstream desktop environments - i.e. it allows the user to optionally select an alternative action while providing a default. You "right click" by -4 prefix, and can also invert this behavior to show the menu by default, and invoking the default action if called with a -4 prefix. Den m=C3=A5n 16 dec. 2024 kl 20:06 skrev Ihor Radchenko : > > Yeah. I am not 100% sure if adding an abstraction layer is a great idea. > Another idea I was considering is similar to what you propose: have some > kind of hook like `context-menu-functions', but accepting an extra > argument - menu type (context menu, transient, which-key, etc.). Then, it > should produce appropriate menu spec. > > However, this will require Elisp to customize things. Also not ideal. > My naive take: Should we make a macro for creating this kind of simple menu? It would take a name, a docstring, parameters passed to the action, a default action name, and a default list of actions. It would then create 1. a function that invokes the menu, passing the parameters. 2. a customization group with options for: 2.1. the actions list. 2.2. the default action. 2.3. whether to show menu by default (or by -4 prefix) 2.4. the menu system to invoke (default transient)? 3. a transient menu. Does this sound reasonable? I probably miss something. I would be happy to try to make this, but am a bit swamped with the holidays, so it would have to wait a bit. Cheers, Tor-bj=C3=B6rn --000000000000a563ed0629dad93c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi!

Thanks all for the great= discussion!

Just so I understand: we are tal= king about simple cases of offering multiple actions (possibly on objects),= =C2=A0
and not more complex things such as the export menu, with = async options etc?

> Tentatively, I am thin= king about the following:
>
> For a given Emacs "prefix" command (e.g. org-open-at-point),= we define a
> set of customizations:
>
> 1. List of possible actions: ((name1 . action1 props) (name2 . action2= ...) ...)
>=C2=A0 =C2=A0 PROPS is a plist defining extra properties like key-bindi= ng, display
>=C2=A0 =C2=A0 string, maybe something else to be used in the future. > 2. Menu interface to use (transient, context-menu, embark, which-key)<= br> > 3. Layout settings for the specific interfaces. For example, transient=
>=C2=A0 =C2=A0 layout definition.

Do we need 3?= Could we decide on a way to specify layout properties in props?
= We could have e.g. a group name which would translate to a transient column= .
=C2=A0
The citation follower prototype works similarl= y to right click menus of=C2=A0
mainstream desktop environments -= i.e. it allows the user to optionally=C2=A0
select an alternativ= e action while providing a default.=C2=A0
You "right click&q= uot; by -4 prefix, and can also invert this behavior to show
the = menu by default, and invoking the default action if called with a -4 prefix= .

Den m=C3=A5n 16 dec. 2024 kl 20:06 skrev Ihor Radche= nko <yantar92@posteo.net>:=

Yeah. I am not 100% sure if adding an abstraction layer is a great idea. Another idea I was considering is similar to what you propose: have some kind of hook like `context-menu-functions', but accepting an extra
argument - menu type (context menu, transient, which-key, etc.). Then, it should produce appropriate menu spec.

However, this will require Elisp to customize things. Also not ideal.

My naive take:

= Should we make a macro for creating this kind of simple menu? It would take= a name, a docstring, parameters passed to the action, a default action nam= e, and a default list of actions.

It would then cr= eate
1. a function that invokes the menu, passing the parameters.=
2. a customization group with options for:=C2=A0
2.1. = the actions list.=C2=A0
2.2. the default action.
2.3. w= hether to show menu by default (or by -4 prefix)
2.4. the menu sy= stem to invoke (default transient)?
3. a transient menu.
=C2=A0
Does this sound reasonable? I probably miss somethin= g. I would be happy to try to make this, but am a bit swamped with the holi= days, so it would have to wait a bit.

Cheers,
Tor-bj=C3=B6rn
--000000000000a563ed0629dad93c--