From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 6DX3DYyAFmc9YAEAe85BDQ:P1 (envelope-from ) for ; Mon, 21 Oct 2024 16:25:48 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 6DX3DYyAFmc9YAEAe85BDQ (envelope-from ) for ; Mon, 21 Oct 2024 18:25:48 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IAB3Gwgf; 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=1729527948; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=XpiismGOJdW0J9Df8TdH0RI6ztqkJgCaMCYKa4BgOJo=; b=nr/VaJJ/iPkPhb7WY6fhUvP+afDev5MEHv8Loe7534aXp5HxOfqkXQseMprr4l6rX/OLU+ UQL0uj6A6J5ybVzIgT0QKwkq5fmQ9d+Js8DNCIKG0wcWMZy5U/fSvifqvsWzUSVxLtic7q wX02ZRCpECy7GD+EyqugQV3owUxazcTUgeyTGrMLONTRX5XOhmi936iQk56wZQyqUbCvh2 Suig75oyhSU+e0FB0jsBUvbEmdDYbGfnFh1bJpkos561eYVnfHLejYdOGrLHtqkvSYeCT8 CzCF+qlvgpm5HnPcTeMD0GpcI95DH6gTpsp/ZEH9di1eeyqsnVDWIj6hxyqcjQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IAB3Gwgf; 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=1729527948; a=rsa-sha256; cv=none; b=b/V8hTzXlYrw4F1k635hFMODy7BNSJi53ihIGnVy7cVKFoosqgvJLS06CusJNNoe6GJ+SW WERpd0SiGOk/EmK86Z4qagYLqXmYd7roqiFiqMRRiOzp2SZBFPuXuuilzF+IH2lVeZsh2d m1kntuiKzCfSZAXIwae+MGNMXp2+Eq5JWPLfn9XSYTSWUxv3jhhUCbtKwpDoa1bnlm+f2n UIH6AX2XcwVKFTDOjNLMGsZXi4R0Rw8Q+v7mRpayImI2wMmap0vFqZfIf2vMK5eZ0cYPpv Kmydr3IlQ50efPOmooNsYcSza/I1qegkKLnFCBdvWIG8rp1kPF17RmhLeHhYgQ== 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 BAF648E6FB for ; Mon, 21 Oct 2024 18:25:47 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2vD9-0001Y0-Ej; Mon, 21 Oct 2024 12:24:51 -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 ) id 1t2vD0-0001XL-Kk for Emacs-orgmode@gnu.org; Mon, 21 Oct 2024 12:24:43 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t2vCy-0004N4-JW for Emacs-orgmode@gnu.org; Mon, 21 Oct 2024 12:24:42 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2e2e8c8915eso3732724a91.3 for ; Mon, 21 Oct 2024 09:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729527879; x=1730132679; darn=gnu.org; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :from:to:cc:subject:date:message-id:reply-to; bh=XpiismGOJdW0J9Df8TdH0RI6ztqkJgCaMCYKa4BgOJo=; b=IAB3GwgfHjNMMq3Lhp5XnlAj0Kzvr/V9HZ5f7w4yOKgu8MXfkgXIySbvKF94aXe7ZQ Y3znb98swmRR4ffn7fO7WXkTet0STVKA+uMvoC2ax5Wkgm9TjUP+4QX4Fzz/63LhL3qC EOd1flpMpUnhVlf0iMFRx4HtylxSsGCyeCLEOQlwxOFbKwGMoaLtHb6/vG/fKS5GRZBK 7iMDT0pcB3y3jOtgQexxrA4wtLDeSKQNcVKs7t3SqQPAu/zq6xGxCI5pa5UVo+rINxXV XFpEd/AIYtALoN59qRv2f7pg6lJAW7Yk0w9WhTGtwVLwqgYb9AQlxdxeUFifDqSKpGxW ekxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729527879; x=1730132679; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XpiismGOJdW0J9Df8TdH0RI6ztqkJgCaMCYKa4BgOJo=; b=qEwP9i1WzutSM7cs4eKRp2E3YX1iQlBR72swuhgZSguPCEhIrmDkdN0yJEPX5h1DqX ZPwl0EXxKw8pRyRlZpGDdaAsjWUikZMs/zFtxc7+2al2Db5LzQ4uuQpP/r3rz5tkMUli EZzdIY+qx5lOlFqQdDYKurFaX/zgpvv+yo5iFM+QCD8bmtSb6Lr/lIXb+0VSRViyrSLT AHsikw/OolweANQCYUFgLX9MzjCTs9kXsrHaz8x/UmAoMbRZ0hNW9T5vzmXxjZj5VJV2 484iGF71Y/A575gKH9kz9ws14go1IuxhIrnS6FDJyHPOqk/nL7U0zbuCB1YmOtJEynaZ 9KrA== X-Forwarded-Encrypted: i=1; AJvYcCWzX6fUSShLlYaK6HQ1RE45rj+KVwe5Gw16s5UhN8fiopuPi+GRu5LOJLV3ELpAifgIPL/7JtdzkQfNmyKj@gnu.org X-Gm-Message-State: AOJu0YyDXsIS3vJVbmweMLHILTrBdgiphQXnV3cW8IypUn8XVjVkzdVJ L2sb///gB8MoND25lzJpwniAEbHPR1dv0vFhLKonAgYezzBQanJ0 X-Google-Smtp-Source: AGHT+IFhj51RD0W1rG7vN0/f+oN569C/Mvb24eN+K+jNL4Fqz864u4ICpM7Ueurx6NTOxoRiwiy6mQ== X-Received: by 2002:a17:90a:a018:b0:2e2:e159:8f7b with SMTP id 98e67ed59e1d1-2e5616c6251mr14115192a91.3.1729527878485; Mon, 21 Oct 2024 09:24:38 -0700 (PDT) Received: from smtpclient.apple (c-73-170-198-193.hsd1.ca.comcast.net. [73.170.198.193]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e7f0db28csm27862635ad.184.2024.10.21.09.24.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Oct 2024 09:24:37 -0700 (PDT) From: Charles Choi Content-Type: multipart/mixed; boundary="Apple-Mail=_8F508BB2-4CAD-47A4-99C5-D65A676CBA00" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: [RFC] Insert reference to Org table cell or cell range from region selection (w/without mouse) Date: Mon, 21 Oct 2024 09:24:28 -0700 References: <95CE1447-FC08-431A-9CA1-83B4C3F77BA7@gmail.com> <87zfmzqezp.fsf@localhost> To: Ihor Radchenko , Emacs-orgmode@gnu.org In-Reply-To: <87zfmzqezp.fsf@localhost> Message-Id: X-Mailer: Apple Mail (2.3776.700.51.11.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=kickingvegas@gmail.com; helo=mail-pj1-x1032.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-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-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -1.05 X-Spam-Score: -1.05 X-Migadu-Queue-Id: BAF648E6FB X-TUID: 97PoWERxoL9D --Apple-Mail=_8F508BB2-4CAD-47A4-99C5-D65A676CBA00 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Ihor -=20 Thanks for replying. Some initial reply thoughts. > On Oct 20, 2024, at 2:51=E2=80=AFAM, Ihor Radchenko = wrote: >=20 > It would be nice if you summarized the feature request in a few > sentences in the email. The link may or may not be available for = future > readers in 10+ years from now. Understood. I=E2=80=99ll prepare a more formal RFC in a forthcoming = email. > As we briefly discussed during the meetup, I believe that we can > integrate mouse support into M-x org-table-edit-formulas: > - when in fedit buffer, clicking/dragging on the original table should > insert reference into the formula buffer >=20 In trying to understand better what mouse support means, I=E2=80=99ve = tried to formalize this with a state machine as described below. Is this = proposed behavior along the lines of what you were thinking? * Proposed Mouse Region to Org Table Reference Behavior Described below is a proposed state machine description of mapping a = region or rectangle defined by a mouse to an Org table reference. --Apple-Mail=_8F508BB2-4CAD-47A4-99C5-D65A676CBA00 Content-Disposition: inline; filename=org-table-reference-table-mouse-sm.svg Content-Type: image/svg+xml; x-unix-mode=0644; name="org-table-reference-table-mouse-sm.svg" Content-Transfer-Encoding: 7bit org table reference mouse state machine s1 s1: point in Org table (org-mode-map) s2 s2: point in *Edit Formulas* buffer (org-table-fedit-map) s1->s2 t1: org-table-edit-formulas s3 s3: dynamically calculate reference and insert into *Edit Formulas* s2->s3 t2: down-mouse-1 on table cell or C-M-down-mouse-1 on table cell s3->s3 t3: drag-mouse-1 to define region or C-M-drag-mouse-1 to define rectangle in table s4 s4: move point back to end of inserted table reference in *Edit Formulas* s3->s4 t4: up-mouse-1 or C-M-up-mouse-1 --Apple-Mail=_8F508BB2-4CAD-47A4-99C5-D65A676CBA00 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 * States *** s1: point in org table Initial state where the point in inside an Org table. Dev note: this is existing behavior. *** s2: point in =E2=9C=B3=EF=B8=8EEdit Formulas=E2=9C=B3=EF=B8=8E = buffer After calling ~org-table-edit-formulas~, point is moved into a new = buffer named =E2=9C=B3=EF=B8=8EEdit Formulas=E2=9C=B3=EF=B8=8E. Dev note: this is existing behavior. *** s3: dynamically calculate reference Upon transition *t2* (a down-mouse event) an Org table field reference = is generated and inserted into the =E2=9C=B3=EF=B8=8EEdit Formulas=E2=9C=B3= =EF=B8=8E buffer. As the mouse is dragged (transition *t3*), the Org table reference is = dynamically regenerated and inserted into the =E2=9C=B3=EF=B8=8EEdit = Formulas=E2=9C=B3=EF=B8=8E buffer. Note that the current point is in the buffer where the text region (or = rectangle) is defined. Dev note: this is new behavior. I do not know enough about Emacs event = handling to implement the above. *** s4: move point back Upon completion of a defined text region or rectangle, the point is = moved back to the end of the inserted table reference in =E2=9C=B3=EF=B8=8E= Edit Formulas=E2=9C=B3=EF=B8=8E. Dev note: this is new behavior. I do not know enough about Emacs event = handling to implement the above. ** Transitions *** t1: org-table-edit-formulas The command ~org-table-edit-formulas~ is called. *** t2: down-mouse-1 on table cell Either the ~down-mouse-1~ or ~C-M down-mouse-1~ event is made. *** t3: drag-mouse-1 to define region The mouse is dragged immediately after a *t2* event. *** t4: move point back An up mouse event immediately after a *t3* event. Thanks and best regards -=20 Charles --Apple-Mail=_8F508BB2-4CAD-47A4-99C5-D65A676CBA00--