From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.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 GLEGNUDeX2fiZQEA62LTzQ:P1 (envelope-from ) for ; Mon, 16 Dec 2024 08:01:04 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id GLEGNUDeX2fiZQEA62LTzQ (envelope-from ) for ; Mon, 16 Dec 2024 09:01:04 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; 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=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734336064; 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; bh=WhAmizqFqhkwIVA8R7Jg6ncVh5kLLXJQgQc7869XD7g=; b=BPxHbjXhTwSz4keTn36k6/5sSJ7gXGw4wI44HvI//PGYuf7a0017x5l1LPOSoOg1idVbvY baASLsDdOdEmLmmekgNw4qQUx9R4O4/907lk8sJD3+6/3DQE+aRXucH6os6/IQNq5X2uiw SDZgXVHwSU1OSfuBZUgIXsK5HTvrPJUntx3WZMar3GE2SbZGwRA0u+BhZGoH2u9fhS+Wgy 2S+fOj9oxRjmumKBRVLV8GNUjOPg24rstDizQK+/35gEhScTtfac+NjpwLDPWVyOMmeILa nmjjOIPaX9JSbiCGHxhjeSmF3v532m9NShFpZFqFnaxLEx1C1EUF88tp19cTMQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734336064; a=rsa-sha256; cv=none; b=orydqJkgvXrKEsd20RMvLfBroiI29vDUfwAI0OL/ttBRZ/1cdlBrhkY+d5gJrtaM+IgyXq Ime/l43n9tx+1MRcP70ljCnvI9UGnavJTmZUOWy6h/FUdEWUydUhaBvE3TvLHxlmhykfCA AXiDxWWqIYf+QosDZlNnqoMf9Bz6ROAhpuoXCwcK3Em1cyEh3oopKSqD00Qkf7cqsYehhZ 80M8xamZ7B7SbgEXGpNIXTlvQX0LYheu7LYzaKfUlm8B9VHwQScnU/f8N0iaW+9B5H7utB 5f25haQAd/1p2pPJpFRLNAgZgi04gcytH1yEXUms1z/jlmuOpcDi7N9MoBRECw== 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 9498D82438 for ; Mon, 16 Dec 2024 09:01:03 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN60x-0007VM-Dr; Mon, 16 Dec 2024 02:59:39 -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 1tN60o-0007Th-IK; Mon, 16 Dec 2024 02:59:31 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tN60l-0007oU-3V; Mon, 16 Dec 2024 02:59:30 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 4A53D60003; Mon, 16 Dec 2024 07:59:18 +0000 (UTC) From: Juri Linkov To: Ihor Radchenko Cc: emacs-devel@gnu.org, emacs-orgmode@gnu.org Subject: Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark? In-Reply-To: <87zfkx1fha.fsf@localhost> (Ihor Radchenko's message of "Sun, 15 Dec 2024 09:07:45 +0000") Organization: LINKOV.NET References: <8734m28l9a.fsf@gmail.com> <87y120daue.fsf@localhost> <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> Date: Mon, 16 Dec 2024 09:46:07 +0200 Message-ID: <8734io3xyo.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=217.70.183.195; envelope-from=juri@linkov.net; helo=relay3-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 9498D82438 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -2.03 X-Spam-Score: -2.03 X-TUID: cgzQ2FMwnF9L >>> 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) >> >> This looks like the best design. Any part of the org buffer could have >> text properties with a list of its available actions. Such a property >> could be similar to 'context-menu-functions' handled by 'context-menu-map'. >> But since it will be a plain generic list, it could be transformed to any >> menu interface such as transient, context-menu, etc. > > I am a bit lost. > Maybe I did not describe the use cases I had in mind well. > > What I have in mind is a menu UI for various commands: > 1. org-open-at-point (one set of actions) > 2. org-ctrl-c-ctrl-c (another set of action) > 3. some other command > 4. ... > > Then, "actions" will be various options a given command can do. > > In such scenario, the usefulness of text properties is elusive to me. > I'd rather link the menu items to a command, not to place in buffer. Indeed, in this case text properties are not needed. Then you can use something like the buffer-local variable with the same name 'context-menu-functions' (handled in 'context-menu-map'). The main point is that these functions return a menu. But instead of a menu, an org function could return a more high-level data structure like ((name1 . action1 props) (name2 . action2 ...) ...) IOW, this means adding an abstraction layer on top of the existing user interfaces such as transient and context-menu. >> To transform it to context-menu, org-mode should provide a function >> like 'context-menu-minor' that will create a corresponding menu >> that will be added as a submenu of the default context menu. >> >> Such integration with existing menus would be better than the current >> implementation of context menus in org-mouse-context-menu that completely >> replaces the context menu with its own. > > What do you mean by "default context menu"? The default context menu is the menu constructed from many different context-menu functions. Some of them add Undo/Redo entries, some add Select/Copy/Paste, some add Global submenus, etc. I meant to keep all these existing menu items, and also append the submenu items returned by Org-mode.