From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Kierin Bell Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark? Date: Sun, 15 Dec 2024 13:23:23 -0500 Message-ID: <874j34st44.fsf@fernseed.me> References: <87msgzh1dh.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37831"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?Q?Tor-bj=C3=B6rn?= Claesson , emacs-devel@gnu.org, emacs-orgmode@gnu.org, Philip Kaludercic , Omar =?utf-8?Q?Antol=C3=ADn?= Camarena , Jonas Bernoulli , Juri Linkov , karthikchikmagalur@gmail.com, Visuwesh , charles.choi@yummymelon.com, Justin Burkett To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 15 19:24:44 2024 Return-path: Envelope-to: ged-emacs-devel@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 1tMtIJ-0009bM-NZ for ged-emacs-devel@m.gmane-mx.org; Sun, 15 Dec 2024 19:24:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMtHQ-0000dI-Vn; Sun, 15 Dec 2024 13:23:49 -0500 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 1tMtHO-0000ci-Fm; Sun, 15 Dec 2024 13:23:46 -0500 Original-Received: from mout-p-103.mailbox.org ([2001:67c:2050:0:465::103]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1tMtHJ-0003y7-Mt; Sun, 15 Dec 2024 13:23:46 -0500 Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4YBBKH3lpCz9sVN; Sun, 15 Dec 2024 19:23:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fernseed.me; s=MBO0001; t=1734287011; h=from:from: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; bh=gVry9zsG+uf/ewHpBJMp8ZJRmIzxh8jLUwKyq6leFZ0=; b=DxxyMaMs/J7ozv+FCEodFItogPhKKQgj1kikeGw3i4+IrPIJPeHi6nFceHXNiJb2YIevbE OK/K2vzvIv1dSv2Z/VEu+DwO4/3J2uTDvGJBz7BeXkDmAQtcPT2VuxpbOMmwInvgt6La9D 20C8jp45qJXNfoR0gu6DiPk5MNNKMlUpYi+XwRH0NOUq/a6pT7VvwPfxkozAKmsJPWgb/O eDhygrZmzd0ptJBCeMaH0sjcyjQ4Dq+C9xxLhGrsoYO6uf4OTY39WZ6soopUXYHbt29dYA G4gqtYM5s3brrEMV/7RoYL3pslVFisE1HOHpQFF6u+ZoBpV2Bh0tnT+5zKOsbQ== In-Reply-To: <87msgzh1dh.fsf@localhost> (Ihor Radchenko's message of "Fri, 13 Dec 2024 18:41:14 +0000") X-Rspamd-Queue-Id: 4YBBKH3lpCz9sVN Received-SPF: pass client-ip=2001:67c:2050:0:465::103; envelope-from=fernseed@fernseed.me; helo=mout-p-103.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326532 gmane.emacs.orgmode:164176 Archived-At: Hi Ihor, Ihor Radchenko writes: > TL;DR: We are in the process of designing a more unified selection > interface for Org mode and want to see if there is some way to unify > context-menu-mode, transient, which-key and embark together. The idea > is to (1) avoid too many customizations; (2) allow users to decide how > to choose between multiple options - by mouse, keyboard, and using > customizable UIs. I think that the built-in Emacs thingatpt.el should not be overlooked here. Instead of implementing an entire system specific to Org, imagine a generic action-at-point interface that works on "things" from thingatpt.el. For the various targets, Org could add new "providers" to `thing-at-point-provider-alist', `forward-thing-provider-alist', and `bounds-of-thing-at-point-provider-alist'. [ Org actually does already register its own 'url' provider for links. ] Then, Org could implement a number of action selection interfaces that act on the various classes of "thing". An exemplary package would be Philip Kaludercic's great =do-at-point= package, which provides a simple action selection menu for the thing-at-point using `read-multiple-choice', which I find elegant and intuitive.[1] I have gone as far as implementing a 'heading' provider for Org and `outline-mode' (for use with =do-at-point.el=). I don't see any reason why Org couldn't define a 'citation' provider, a 'source-block' provider, etc. The only downside that I have found with adding lots of thingatpt.el providers is that it can be difficult to write providers efficient enough for `forward-thing' in particular (`forward-thing-provider-alist'). I may also be misunderstanding the proposed interface. For example, instead of a generic interface for acting on a single thing at point, maybe you are describing more of an interface for associating commands with multiple potential targets that must be located (e.g., in a subtree), which are then each associated with actions. Even if that's the case, there is a good case for implementing thingatpt.el providers for the targets, so that users could bring our own action-at-point packages/interfaces. [ I would be willing to help write some of those providers. ] And if thingatpt.el isn't generalized or fast enough, then there is a case for creating a new, more flexible /de facto/ library like this for Emacs. [1] https://codeberg.org/pkal/do-at-point Thanks, Kierin