Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

UNDO and Mathematica - how useless is it?

341 views
Skip to first unread message

Bob F

unread,
Mar 25, 2009, 6:41:38 AM3/25/09
to
Hello Everyone,

Does anyone else think the UNDO menu function is about as useful as
ice in Antarctica?? I had just copied/pasted a long expression from a
web site to a notebook I was working on, but the expression had some
exponents/superscripts that did not come through with the paste so
what ended up being in the notebook was something like this:

((((((((((((((((((((((((((((x2*x)2*x)2)2*x)2*x)2*x)2)2)2*x)2*x)2)2*x)2)
2*x)2*x)2)2)2*x)2)2*x)2)2)2)2)2)2)2)2)2

so to Mathematica it looked like all the 2's were just multipliers
instead of exponents. No problem, says I, just highlight this string
and use the Edit/Find&Replace dialog box to change 2 to ^2, but only
one at a time was changed with each click of the replace. OK, says I,
use the "Replace All" and surely that will only apply to the
highlighted section. WRONG!!!!!! It changed the entire notebook to
have ^2 instead of every 2 in the entire notebook. OK, says I, just
click the Edit/Undo and get back to where I was. WRONG -- notebook is
totally hosed and I loose a few hours worth of work. Yeah, Yeah, Yeah
I should have done a Save before doing the Replace All -- now I know
for next time.

So, hey Wolfram -- please fix the UNDO. Make it work like every other
program on the face of the planet, even the entire Solar System, even
the known and unknown universe!!!!!!!!!! Even one level of UNDO would
have saved me hours of working, let alone a multiple level UNDO like
you see in so many other programs.

I would be much happier Mathematica user, if Wolfram would spend time
in solving problems like this, than coming out with new versions with
hundred of functions. Please make the next release fix some of the
major outstanding issues with the current version (and for many years
as far as I can tell)!!! If you want to add new functionality that's
great, but give users a modern user interface feature like
UNDO!!!!!!!!!!!

And as long as you're about it, give the Find dialog box a way to do a
find/replace on a cell or multiple cells or any highlighted section of
a notebook. As it stands right now, you have to click the Replace
button for each and every occurrence of the string you wish to change.
Maybe a "Replace in this cell" or "Replace in the highlighted section"
button.

How can something so simple (the UNDO) be so uselessly implemented.
What is it even good for in the state that it is in??

-Bob (grrrrrrrrrrrrrrrrrrrrrrr) ;-(

Filippo Miatto

unread,
Mar 26, 2009, 6:18:41 AM3/26/09
to
Totally agree!
Another feature that i expected in 7 but it didn't show up was window
tabs, it would be great to have multiple notepads opened without
having to minimize/maximize windows all the time...
Hope to see both in 8!
Is there a way to discuss with developers about fatures/bugs?

Filippo

AES

unread,
Mar 26, 2009, 6:19:37 AM3/26/09
to
In article <gqd1p2$nrt$1...@smc.vnet.net>, Bob F <deepy...@gmail.com>
wrote:

>
> So, hey Wolfram -- please fix the UNDO. Make it work like every other
> program on the face of the planet, even the entire Solar System, even
> the known and unknown universe!!!!!!!!!! Even one level of UNDO would
> have saved me hours of working, let alone a multiple level UNDO like
> you see in so many other programs.
>

I suspect this is a near impossible task logically -- and the inability
to have a real UNDO is another (but only one) of the many reasons why
Conrad Wolfram's concept of "Mathematica: The All-In-One System"

The Wolfram Video Gallery
<http://www.wolfram.com/broadcast/videos/> ==>
<http://www.wolfram.com/broadcast/videos/?video=onesystem/onesystem>

is IMHO a *fundamentally* bad idea.

In many (most?) conventional software applications, you have a
*program*, which operates (using operations implemented under user
control) on a separate *document* of some sort.

If you do a sequence of those operations, and then decide you want to
reverse some or all them (because you made a mistake, or just changed
your mind), in almost any conventional app you can back up at least one
step using UNDO; and in many applications you can back up a
near-unlimited number of steps, all the way to when you opened the
document -- and then step back forward on the same chain if you want to.

In Mathematica, however, the notebook is typically both the program
*and* your document. Some steps you take, or operations you invoke,
edit the "program" part of the notebook; some may edit "data" parts of
the notebook (or even "results" parts); some may *execute* one or more
program parts of the document -- which may well operate on, and modify,
in multiple stages, any and all of the "program", "data", and "results"
parts of the notebook.

At this point, is there a single obvious choice as to what is meant by
UNDO? You might want, but could you get, a complete massive
"UN-EXECUTE" of the massive (but now unwanted) execution you just
invoked?

And suppose you suddenly realize this only after several you've invoked
several more operations, edits, commands, whatever?

I don't have anywhere near enough depth in logical analysis or computer
programming to know whether or not a complete multistep or even
single-step UN-EXECUTE is always possible in a system like Mathematica,
other than with some kind of brute force saving of the complete state of
the system.

Even if this is possible, having enough memory to do this for multiple
steps back seems impossible -- not to mention taking into account
various *outside* events (like computer clock time) that might
influencing the evaluation, un-evaluation, and re-evaluation.

So, I continue to suspect that having any kind of user-comprehensible,
multi-stage UNDO in Mathematica is a near impossible task, if not
logically then realistically -- and this rather minor but non-trivial
problem joins many other important more concerns (like unacceptable
complexity of the user interface and syntax, and of the user
documentation, not to mention suppression of software innovation) as
reasons why the all-in-one model of Mathematica, while it may have a
role in providing a massive all-in-one programming system for highly
trained professional programmers, who are hired to write applications
for others, is pretty likely to destroy Mathematica as a usable system
for "ordinary" non-computer-expert users, who just want to use it to
solve much smaller problems in their own field.

Sjoerd C. de Vries

unread,
Mar 26, 2009, 6:21:02 AM3/26/09
to
Been there, done that. I feel your pain.

Cheers -- Sjoerd

peter

unread,
Mar 26, 2009, 6:24:04 AM3/26/09
to
So, Bob, are you saying there's a problem with Undo then ?

Peter

2009/3/25 Bob F <deepy...@gmail.com>:

--
Peter Lindsay

David Bailey

unread,
Mar 26, 2009, 6:43:44 AM3/26/09
to
Bob F wrote:
> Hello Everyone,
>
> Does anyone else think the UNDO menu function is about as useful as
> ice in Antarctica??

I agree - WRI seem to have a blind spot about UNDO - nowadays, people
just expect a multi-level UNDO as part of working on a computer.

Notebooks are not quite like other documents, because they change
programatically as well as by user editing, but I would not have thought
it would be too hard to provide a multi-level UNDO that would at least
operate between evaluations. Alternatively, UNDO could be restricted to
cells of particular styles - ignoring output cells.

David Bailey
http://www.dbaileyconsultancy.co.uk

David Park

unread,
Mar 27, 2009, 6:33:16 AM3/27/09
to
I think that some, at least, of the important WRI developers do take notice
of what is on MathGroup. So give detail and make a good case and I think
they will consider it. They may not necessarily do it because it may be
difficult, but there are a number of changes I've seen that did appear to
come from MathGroup complaints and suggestions.


David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/

Bob F

unread,
Mar 28, 2009, 6:41:45 AM3/28/09
to
On Mar 27, 4:33 am, "David Park" <djmp...@comcast.net> wrote:
> I think that some, at least, of the important WRI developers do take noti=

ce
> of what is on MathGroup. So give detail and make a good case and I think
> they will consider it. They may not necessarily do it because it may be
> difficult, but there are a number of changes I've seen that did appear to
> come from MathGroup complaints and suggestions.
>
> David Park
> djmp...@comcast.nethttp://home.comcast.net/~djmpark/
>


I agree that the definition of what UNDO means can be problematic with
Mathematica, but if you talk about only the editing of the notebook
itself with regard to UNDO, then it becomes much easier, doesn't it?.
If we only talk about the editing changes of a notebook wouldn't the
UNDO be trivial to implement?

For any sort of calculations just put in different data and re-execute
the notebook or cell.

Part of each cell definition is a timestamp (look at the low-level
code by doing a Cell/Show Expression if you want to see). With this
information and some sort of keyboard input data structure going back
in time any number of levels would be just a question of undoing that
level of keyboard input and go back to the previous version of the
text wouldn't it, then a simple re-execution of the cell gets you back
where you were?

It seems that because the problem is difficult to provide a "perfect"
solution, the currently worthless solution is any better?

What would be bad about providing an UNDO that only worked on the
state of the text that forms the notebook or cell? That way any change
could be undone, and if needed then a simple re-execution of the cell/
notebook would get the old calculation back. Yes, I realize what about
if the calculation took 4 days to complete, you surely dont want to
undo that if the result is truly valid, but perhaps a cell could be
marked as "Don't Change with UNDO" or something like that (just like
you can mark it as visible or editable or ???) Would this give people
all the ability of a multi-level undo without the possibility of
loosing valuable calculations??

Would someone at Wolfram PLEASE comment about the state of the UNDO
debate and what is and isn't possible and what the various problems
with certain solutions are???

-BOB


David Park

unread,
Mar 29, 2009, 3:41:19 AM3/29/09
to
Yes, often the perfect is the enemy of the useful.

I would think it would be enough to just undo text editing. I wouldn't even
worry about the 4-day calculation. It is not that common, and if it is
important to save it then the user could have saved it in a file. And if an
UNDO changed the Input cell then maybe the calculation was no good anyway.


From: Bob F [mailto:deepy...@gmail.com]

It seems that because the problem is difficult to provide a "perfect"
solution, the currently worthless solution is any better?

What would be bad about providing an UNDO that only worked on the
state of the text that forms the notebook or cell? That way any change
could be undone, and if needed then a simple re-execution of the cell/
notebook would get the old calculation back. Yes, I realize what about
if the calculation took 4 days to complete, you surely dont want to
undo that if the result is truly valid, but perhaps a cell could be
marked as "Don't Change with UNDO" or something like that (just like
you can mark it as visible or editable or ???) Would this give people
all the ability of a multi-level undo without the possibility of
loosing valuable calculations??


-BOB


Jens

unread,
Mar 29, 2009, 3:46:08 AM3/29/09
to
On Mar 28, 3:41 am, Bob F <deepyog...@gmail.com> wrote:
> On Mar 27, 4:33 am, "David Park" <djmp...@comcast.net> wrote:
>
> > I think that some, at least, of the important WRI developers do take noti=
> ce
> > of what is on MathGroup. So give detail and make a good case and I think
> > they will consider it. They may not necessarily do it because it may be
> > difficult, but there are a number of changes I've seen that did appear to
> > come from MathGroup complaints and suggestions.
>
> > David Park
> > djmp...@comcast.nethttp://home.comcast.net/~djmpark/
>
> I agree that the definition of what UNDO means can be problematic with
> Mathematica, but if you talk about only the editing of the notebook
> itself with regard to UNDO, then it becomes much easier, doesn't it?.
> If we only talk about the editing changes of a notebook wouldn't the
> UNDO be trivial to implement?
>
> For any sort of calculations just put in different data and re-execute
> the notebook or cell.
>
> Part of each cell definition is a timestamp (look at the low-level
> code by doing a Cell/Show Expression if you want to see). With this
> information and some sort of keyboard input data structure going back
> in time any number of levels would be just a question of undoing that
> level of keyboard input and go back to the previous version of the
> text wouldn't it, then a simple re-execution of the cell gets you back
> where you were?
>
> It seems that because the problem is difficult to provide a "perfect"
> solution, the currently worthless solution is any better?
>
> What would be bad about providing an UNDO that only worked on the
> state of the text that forms the notebook or cell? That way any change
> could be undone, and if needed then a simple re-execution of the cell/
> notebook would get the old calculation back. Yes, I realize what about
> if the calculation took 4 days to complete, you surely dont want to
> undo that if the result is truly valid, but perhaps a cell could be
> marked as "Don't Change with UNDO" or something like that (just like
> you can mark it as visible or editable or ???) Would this give people
> all the ability of a multi-level undo without the possibility of
> loosing valuable calculations??
>
> Would someone at Wolfram PLEASE comment about the state of the UNDO
> debate and what is and isn't possible and what the various problems
> with certain solutions are???
>
> -BOB

A useful undo function is extremely helpful in bringing down the
barrier for novices, because they will feel free to experiment without
fear of breaking things.

Maybe the following would be doable in Mathematica: for each
_individual_ Input cell, keep track of a certain number of undo steps.
The undo history could be reachable through some right-click menu
bound to the individual cell bracket. Of course that's a lot of
separate undo histories to keep track of, but one could limit the
depth and provide a way to clear the history.

The reason I'm proposing undo for individual Input cells is that these
cells can then be rearranged arbitrarily, and there would be less
potential for conflict with interactive output. Of course,
NotebookWrite and other notebook manipulation features are a big
stumbling block (for undo... otherwise they're great). Maybe one would
have to restrict the cell history changes made by textual editing.

A less ambitious proposal would be to at least implement a full undo
history counting from the time a user first starts editing an input
cell. In a large cell where I want to edit several places, even this
modest undo would give me some peace of mind (OK, I've learned to live
without undo by making backup copies of cells and notebooks, but it
would be hard to deny that frustration with non-undoable typos is a
constant feature of Mathematica).

Jens

meitnik

unread,
Apr 8, 2009, 2:48:35 AM4/8/09
to
An open letter to WRI, struggling with undo.

I am a disabled user (but am creative and intelligent) and a
prospective Home Edition buyer (I have finally got the funds in place
today). I *need* an Undo that really works. I make lots of typing
errors and yes logical errors too. Besides, being creative and
learning is making big and small mistakes and rethinking ones
direction. Forgiving software was part of the tech paradigm shift in
the 80s and 90s. Did WRI miss that while mastering CA patterns? While
learning Mathematica using a trial version, I already lost time/code
and become frustrated several times dealing with undo (sometimes it
sorta works sometimes its just stupid). Why make it so hard to undo?
Does not your QA fight for a real undo? Does not marketing understand
undo is a key selling feature? Perhaps for many all the power of
Mathematica alone compensates for its limited undo.

I have owned hundreds of software apps, beta-tested just as many over
my 30 years. I have never seen software that just fails so badly at
understanding undo. Perhaps a tutorial on how to deal with undo is
wanting, does one already exist?. At least document well how undo
works now. Offer tips and tricks how to manage mistakes/errors in
one's work other than the brute force of save as and duplicating
cells. Finally, As a Mac user, undo is one of the prime directives of
OS X gui guidelines. WRI, don't you like having and using a real undo
for all your Mac apps (and later for Windows too). Yes, doing a real
undo is hard, but it is worth it and shows real respect to your users
both new and old. Come on guys, you are all smart enough!

If you are wanting to make the Home Edition market succeed, than you
need a reasonable undo working shortly in 3-5 months, not 2 years
later. I do not need to buy now Home Edition but I really want it now
but at the cost of dealing with unpleasant software? I value my time
and efforts, and yes undoing mistakes. Important features matter to
overall productivity and a sense of polish -- undo is one of them. You
want a sale, I want software that works as expected. I can wait it
out, for I waited 20 years for Mathematica to be within my reach at
age 50. A few more months or years is ok with me. I can set aside
those funds for another day. Maybe a formal petition is needed for a
proper undo??

If I have erred in my reasoning or understanding how undo currently
works, please educate me to be a better productive user of
Mathematica. I am willing to learn from my mistakes. Forgiveness in
people or software is cool.

Thank you for enduring my rant. I am off to soak my painful fingers
now...

DrMajorBob

unread,
Apr 9, 2009, 5:55:19 AM4/9/09
to
The best advice I can givi is "save early and often"... but I admit that's
not a replacement for Undo.

I've gotten used to the situation, as most of us have, but Meitnik still
has a point.

Bobby

--
DrMaj...@bigfoot.com

Murray Eisenberg

unread,
Apr 10, 2009, 4:54:23 AM4/10/09
to
Ordinary saving the notebook keeps overwriting with the new version. A
much better solution, in the absence of a more complete undo/redo
facility, would be DrMajorBob's "Bare Bones Backup" button or, for more
complete control, the backup facilities in David Riess' WorkLife FrameWork.

--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305

Paul Ellsmore

unread,
Apr 10, 2009, 4:56:01 AM4/10/09
to
As a novice myself, I waste hours because of this. What I try to do, if I
remember (!!!) is save my notebook before every edit (or after every
successful execution) to a filename with _x added to it. So, notebook.nb has
my latest clean, working code in it, and notebook_1.nb has edited code that
I'm not sure about. I might keep this numbering going even for successful
edits, if I am exploring an idea that I might want to drop at some point.

I don't know how to do it, but surely someone out there could write a little
bit of code that would do what I do manually for every execution (or you
could probably think of better events to trigger it). It wouldn't bother me
if I ended up with dozens of similar notebooks, and I would be happy to
manually reset the system at sensible intervals.

Thinking about it, this sounds a little bit like what I imagine "Version
Control" would do. I do have WorkBench, but found it to be so much more
complicated than I expected that I haven't really worked out how to use it.
Would any WorkBench experts out there recommend it for an Undo workaround?
If so, I might put some effort into learning it.

Cheers,

Paul.

dbr...@gmail.com

unread,
Apr 11, 2009, 3:55:09 AM4/11/09
to
The backup functions in A WorkLife FrameWork are certainly a help here
(also note that there is a cell level backup functton there as well).
But it is not quite the solution needed for basic editing and textual
input.

But I think that a basic Undo functionality in Mathematica is
essential. At the very least it needs to be implemented for editing.
It is probably not reasonable for it to take into account execution
since this can generally involve very large amounts of content.
(Actually there is a functionality in A WorkLife FrameWork that allows
you to track the execution history in your Mathematica session in the
order executed).


There is currently a single level immediate undo for textual input.
One basic thing that I feel really needs to be implemented is a single
Redo at this level. I have very often undone something and then have
had to retype everything that I undid because I cannot immediately
redo its input. (Note that there is a Global level option in the
option inspector that governs how large an Undo can be: MaxUndoSize.)
This has burned and frustrated me quite a few times: and I use
Mathematica as my primary means for writing as well as computing. So,
this is, I feel, a reasonable request and helps promote Mathematica's
use more broadly.

I am sure that I probably could create a function that does all of
this at the level of particular cell styles using CellEventActions.
But I think that something along these lines should be implemented at
the top level--with Global option inspector settings that govern the
number, size, and CellStyles that the undo/redo operate at.

I hope that these comments help in thinking these issues through...

--David


On Apr 10, 4:54 am, Murray Eisenberg <mur...@math.umass.edu> wrote:
> Ordinary saving the notebook keeps overwriting with the new version. A
> much better solution, in the absence of a more complete undo/redo
> facility, would be DrMajorBob's "Bare Bones Backup" button or, for more

> complete control, the backup facilities in David Riess' WorkLife FrameWor=
k.
>
>
> --
> Murray Eisenberg mur...@math.umas=


s.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower phone 413 549-1020 (H)

> University of Massachusetts 413 545-2859 (=

Albert Retey

unread,
Apr 11, 2009, 4:00:05 AM4/11/09
to
Hi,

> As a novice myself, I waste hours because of this. What I try to do, if I
> remember (!!!) is save my notebook before every edit (or after every
> successful execution) to a filename with _x added to it. So, notebook.nb has
> my latest clean, working code in it, and notebook_1.nb has edited code that
> I'm not sure about. I might keep this numbering going even for successful
> edits, if I am exploring an idea that I might want to drop at some point.
>
> I don't know how to do it, but surely someone out there could write a little
> bit of code that would do what I do manually for every execution (or you
> could probably think of better events to trigger it). It wouldn't bother me
> if I ended up with dozens of similar notebooks, and I would be happy to
> manually reset the system at sensible intervals.
>
> Thinking about it, this sounds a little bit like what I imagine "Version
> Control" would do. I do have WorkBench, but found it to be so much more
> complicated than I expected that I haven't really worked out how to use it.
> Would any WorkBench experts out there recommend it for an Undo workaround?
> If so, I might put some effort into learning it.

I think for just having backups for your notebooks the possibility to
use a full featured version control system from within the workbench is
overkill. The automatic history which eclipse offers for textfiles is
AFAIK not something that automatically works for mathematica notebooks
(does it? can it work for an external editor at all? I use SVN with
workbench which turns automatic local backups off).

The following will add a simple menubar to your notebook which will let
you save a backup with the current date/time encoded into the filename.
Just press the backup button whenever you think is appropriate to create
a "version". This could of course be further improved and adopted to
your needs, maybe a directory hierarchy would be handy to make it easy
to delete backups of certain periods that you don't need anymore. Also
some additional buttons to manage the versions directly would also be
nice and some error checking would certainly also be a good idea. There
are no guarantees that this way you will never loose work, but it should
basically do what it is supposed to...

SetOptions[EvaluationNotebook[],
DockedCells -> Append[
DeleteCases[
DockedCells /. Options[EvaluationNotebook[], DockedCells],
HoldPattern[Cell[___, CellTags -> {"BackupMenuBar"}, ___]]
],
Cell[BoxData[ToBoxes@Row[{Button["backup",
Module[{backupname, backupnb},
backupname = StringReplace[

ToFileName[
"FileName" /. NotebookInformation[ButtonNotebook[]]],

fname___ ~~ ".nb" :>
fname <> "_" <>
DateString[{"Year", "-", "Month", "-", "Day", "_",
"Hour", "-", "Minute", "-", "Second"}] <> ".nb"
];
SelectionMove[ButtonNotebook[], All, Notebook];

backupnb =
NotebookPut[
Notebook[NotebookRead[ButtonNotebook[]],
Visible -> False]];
NotebookSave[backupnb, backupname];
MessageDialog["backup saved to: " <> backupname];
NotebookClose[backupnb];
],
Method -> "Queued"
]
}]
], "DockedCell", CellTags -> {"BackupMenuBar"}]
]
]

hth,

albert

dbr...@gmail.com

unread,
Apr 12, 2009, 3:49:48 AM4/12/09
to
Yes, this is very similar to the approach within A WorkLife
FrameWork.... there is a means there to also add associated comments
associated with each backup. But it's clear that one can write a
tool that does this without the full machinery of my package...

...David

On Apr 11, 4:00 am, Albert Retey <a...@gmx-topmail.de> wrote:
> Hi,
>

> "FileName" /. NotebookInformation[ButtonNotebo=


ok[]]],
>
> fname___ ~~ ".nb" :>
> fname <> "_" <>

> DateString[{"Year", "-", "Month", "-", "Day",=
"_",
> "Hour", "-", "Minute", "-", "Second"}] <>=

David Bailey

unread,
Apr 14, 2009, 6:12:52 AM4/14/09
to
dbr...@gmail.com wrote:
> The backup functions in A WorkLife FrameWork are certainly a help here
> (also note that there is a cell level backup functton there as well).
> But it is not quite the solution needed for basic editing and textual
> input.
>
> But I think that a basic Undo functionality in Mathematica is
> essential.

People have been asking for this for years, but WRI seems to have a
complete blind spot in this matter :(

In practice, a single-level UNDO is nearly useless, because of the
uncertainty as to what constitutes a 'level' - particularly in the
context of a complicated product like Mathematica.

I would have thought UNDO is feasible for any non-output cell that does
not contain Dynamic elements - plus perhaps a few other reasonable
restrictions.

David Bailey
http://www.dbaileyconsultancy.co.uk

0 new messages