Is there no way to simply call the code that creates the default layout in
the first place?  If possible, it would obviate the need for any undoers at
all.  Just call it as the first thing any layout script does.

That would shift to approach #1 rather than approach #2, but if the benefit
of the new API is the ability to define a static layout, perhaps the
initial layout itself should be defined in such a way (if it is not
already), and simply applied with force before tweaking via the rest of the
scripts.

Just a thought.  I have not looked into the code to see if this is feasible.
Jake

On Sat, Jul 20, 2024 at 10:00 AM Edward K. Ream <[email protected]> wrote:

>
>
> On Sat, Jul 20, 2024 at 7:51 AM Thomas Passin <[email protected]> wrote:
>
>> I think there are two potential approaches to undoers:
>>
>> 1. Impose a specific layout regardless of the current layout;
>> 2. Reverse the changes made by the current layout.
>>
>
> Good point. I was thinking of 2. If done consistently, as I envisage, undo
> would then yield the original layout.
>
> Imo, this approach is the easiest and best because it is stateless. Say an
> outline has three @button scripts that change layouts. You can hit any
> button at any time.
>
> A stack-based approach is more complicated because the stack becomes a
> hidden state. Imo, there is no advantage to such an approach.
>
> *Summary*
>
> My undoers will undo the changes made by the layout script, thereby
> yielding the original (unchanged) layout. All layout scripts will undo any
> previous layouts, then apply their own layout.
>
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/leo-editor/CAMF8tS07Vzsx9VoqPvPr45j7YuBcfb-Txuwoi9SKpvv0-Ja39A%40mail.gmail.com
> <https://groups.google.com/d/msgid/leo-editor/CAMF8tS07Vzsx9VoqPvPr45j7YuBcfb-Txuwoi9SKpvv0-Ja39A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAJ1i%2BSZVh7ZDt1k7dmZAgd0%2B9qiGx0u_MGTntuUVy3iTDpjPqg%40mail.gmail.com.

Reply via email to