Ihor - 

Thanks for replying. Some initial reply thoughts.

> On Oct 20, 2024, at 2:51 AM, Ihor Radchenko <yanta...@posteo.net> wrote:
> 
> 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’ll 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
> 


In trying to understand better what mouse support means, I’ve 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.


* 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 ✳︎Edit Formulas✳︎ buffer
After calling ~org-table-edit-formulas~, point is moved into a new buffer named 
✳︎Edit Formulas✳︎.

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 ✳︎Edit Formulas✳︎ buffer.

As the mouse is dragged (transition *t3*), the Org table reference is 
dynamically regenerated and inserted into the ✳︎Edit Formulas✳︎ 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 ✳︎Edit Formulas✳︎.

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 - 

Charles

Reply via email to