Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: v6: still no multiple undo?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77462] Re: v6: still no multiple undo?
  • From: David Reiss <dbreiss at gmail.com>
  • Date: Sat, 9 Jun 2007 05:36:07 -0400 (EDT)
  • References: <f4b8pl$3s9$1@smc.vnet.net>

OK, I answered the question (at least in principle) for myself.

If one defines a function called, say, EvaluateCellsWithTracking[]
(not a coincidence that that is similar to the name of the function in
http://scientificarts.com/worklife), then if one sets the options for
a notebook nb as:

SetOptions[nb,
 NotebookEventActions :> {{"MenuCommand", "EvaluateCells"} :>
EvaluateCellsWithTracking[]}]

this will do the trick.  Of course it depends on what
EvaluateCellsWithTracking[] is defined to do, but you could create
your own bit of code within a Module and place it whre
EvaluateWithTracking[]  appears in the above bit of code.

There is a bit of trickyness here (which had be restart mathematica
several times when I got into an infinite loop, but it is doable.

One thing though, when I tried something at the level of the FrontEnd
like

SetOptions[$FrontEnd,
 FrontEndEventActions :> {{"MenuCommand", "EvaluateCells"} :>
EvaluateCellsWithTracking[]}]

I encountered a nasty bug or two, so I would not recommend this as a
global FrontEnd approach just yet, but rather use the notebook-level
approach in the first snippet of code.  As always I will track it down
in a simple example and report it to  bugs at wolfram.com.

An example of what you might use for EvaluateCellsWithTracking is
(this is a rarified version of what is in A WorkLife FrameWork--for
this tow rk you will need to create a file on disk to store the
evaluatons and specify the parameter
$CurrentEvaluationTrackingNotebookFile as its file path):

ClearAll[EvaluateCellsWithTracking];

EvaluateCellsWithTracking[nb_NotebookObject] :=

  Module[{nbr, currentEvaluationTrackingNotebook},

   SelectionMove[nb, All, Cell];

   nbr = NotebookRead[nb];

   currentEvaluationTrackingNotebook =
    NotebookOpen[$CurrentEvaluationTrackingNotebookFile,
     Visible -> False];

   SelectionMove[currentEvaluationTrackingNotebook, After, Notebook,
    AutoScroll -> False];

   NotebookWrite[currentEvaluationTrackingNotebook, nbr];

   NotebookSave[currentEvaluationTrackingNotebook];

   NotebookClose[currentEvaluationTrackingNotebook];

   FrontEndExecute[FrontEnd`FrontEndToken[nb, "Evaluate"]];

   nb

   ];

EvaluateCellsWithTracking[] :=
 EvaluateCellsWithTracking[EvaluationNotebook[]]


--David

http://scientificarts.com/worklife
Now Mathematica 6 compatible




On Jun 8, 5:50 am, "Barthelet, Luc" <l... at ea.com> wrote:
> While I strongly support that multipleundois a feature we need to see
> soon, it will take some real work to get there.
>
> The editor, and the kernels are linked in an efficient exchange of messages
> and information about what needs to be displayed where and when.
>
> While implementing multipleundo-redo in a stand alone editor usually
> requires only to implement a tokenizedundo-redo, in the v6 font end, it
> will require a more complex model. It is a bit like if you were trying to
> implement multipleundoon a wiki site like wikipedia where they are
> multiple contributors.
>
> We probably do not want the kernel to "undo", just the front end. So one
> solution would be to make the kernel and the user to appear as a single
> contributor, and toundoboth effects on the front end. So oneundomight
> remove an output created by the kernel.
>
> Even that is challenging, because Dynamics now create a lot of updates and
> you will not want to roll those back.
>
> Anyway, the front end team is obviously smart enough to find a solution for
> all those things, but it is not going to be easy.
>
> A cheap thing that I would like to see, is a text buffer of all my input and
> all the code I deleted saved as a log on disk. It might be ugly, but it
> would be VERY USEFUL.
>
> Cheers,
>
> Luc
>
> On 6/7/07 3:34 AM, "David Bailey" <dave at Remove_Thisdbailey.co.uk> wrote:
>
> > David wrote:
> >> Will Robertson wrote:
> >>> Hello,
>
> >>> I am baffled that technical software is released in 2007 with only a
> >>> singleundolevel. Am I missing something here? Is it because I'm
> >>> using a student license? How hard can anundostack really be in the
> >>> notebook interface?
>
> >>> I've been irritated a few times in v5.2 from clumsy keypresses losing
> >>> me work that I would expect to be two "undo"s away. Alas not. Still.
>
> >>> Will Robertson
>
> >> Good point! I've wondered the same thing for a long time. This is the
> >> only app I run that doesn't happen multiple levels ofundo. I think it's
> >> time WRI spent some time on this issue.
>
> > How much time could it possibly take! Once you have a 1-levelundo
> > working, all you need to do is spill the relevant data into a structure
> > - possibly on disk - and retrieve it as needed!
>
> > David Bailey
> >http://www.dbaileyconsultancy.co.uk




  • Prev by Date: Re: Can anybody help me solving such a system of nonlinear equations?
  • Next by Date: Re: Pattern Matching Mathematica 6 versus 5.2?
  • Previous by thread: Re: v6: still no multiple undo?
  • Next by thread: comments