From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko 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: Tue, 17 Dec 2024 17:23:53 +0000 Message-ID: <87frmm8bpy.fsf@localhost> References: <87msgzh1dh.fsf@localhost> <874j34st44.fsf@fernseed.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11496"; 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: Kierin Bell Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 17 18:24:24 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 1tNbJ2-0002nn-1N for ged-emacs-devel@m.gmane-mx.org; Tue, 17 Dec 2024 18:24:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNbHc-0003BN-Hb; Tue, 17 Dec 2024 12:22:59 -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 1tNbHb-00037p-9u for emacs-devel@gnu.org; Tue, 17 Dec 2024 12:22:55 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNbHQ-0007Dr-UX for emacs-devel@gnu.org; Tue, 17 Dec 2024 12:22:54 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id C3262240101 for ; Tue, 17 Dec 2024 18:22:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1734456161; bh=bc8waRMRILkqBDsA31xx2uA+CWAGdQFK8IsFwx1S/Is=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=hFYJ0OI89KfD5Cd0DbWG2It8Puo+B39r3RtQPs6G361m9i8dFJhT8fUqqCZlgawFQ FgtYvzxLEoMa/w+YHju80KIa0HiOvWV0FLHcLbsBjOjIv/wotLIQycvALKvcHQbZg4 ZMDASpN7wbSjLaYFx2+LfXXvlFxUCen7/YEmnIz2pxplO3aeifQGdShYd6GkSZd68D QLQFKTA6XUc2VWWfW0DbzHgRgYQQHBVJqIow13I8ltUthIph7mQdr+loR73YalyiwI dT0+F2RkRs1R4oJbq5whVlV5/NcXE6x29YvrUiragXN18emrQ7/j/5BQ/dCpfueyDO LDcMLBoAfHHkQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YCNt74BSPz6tsb; Tue, 17 Dec 2024 18:22:39 +0100 (CET) In-Reply-To: <874j34st44.fsf@fernseed.me> Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -39 X-Spam_score: -4.0 X-Spam_bar: ---- X-Spam_report: (-4.0 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:326602 gmane.emacs.orgmode:164209 Archived-At: Kierin Bell writes: > 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. ] This is actually not what I had in mind in this thread. I was only hoping to get input about customizing menu interface in a way that menu UI can be chosen by user. As for `thing-at-point', it is not enough for Org's needs. Let me show you an example of one of the Org "action" commands. org-ctrl-c-ctrl-c does the following: 1. If performs specific actions depending on Org syntax element at point 2. It performs alternative action in Org edit buffers where org-finish-function is defined. 3. It performs different things depending on context around thing at point. For example, first paragraph inside a list will trigger a different action compared to just a paragraph. While (1) can be easily ported to thing-at-point, (2) is much harder, and (3) will involve creating artificial "things" just for the purposes of specific Org command. > 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'd like Org _not to implement interfaces_. Instead, I want to reuse the existing interfaces - transient, menus, which-key, etc. My main question is whether we can do such thing cleanly. > 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. Yup, something more like this. > 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. Better interoperability with thingatpt.el will be certainly welcome. I even coined this idea in the context of tree-sitter in the past. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at