Skip to content
Adding undo function to Mathematica 9
Objective-C
Find file
Latest commit 9fb5ca1 Jan 4, 2013 @jensbob New version that works with sepereated contexts, but needs some clean…
…ing and a readme update

README

----------------
README to undo.m
----------------

This package adds a poor mans version control and undo functionality to Mathematica notebooks.

For a 'notebook.nb' a version information file ('notebook.nb.undo.mx') is created and every time changes are commited a backup file ('notebook.nb[version].bak') is created. Keyboard shortcuts allow an easy way to commit versions and move in between them.

------------------
Keyboard Shortcuts
------------------

Alt+z : Undo 
Alt+x : Redo 
Alt+s : Commit
Alt+d : Show CommitInfo dialog

--------------------------------------
Usage: Evaluate the following commands
--------------------------------------

ManualCommit (Default) - Only do commits manually.

AutoCommit - Turn on automatic commits. Every time a cell is evaluated a new commit is made. (This can lead to a lot of files)

CronCommit[n] - makes a new commit every n minutes.

CommitNow - Making a commit
CommitInfo - Show a list of all Versions
CommitClean - Remove all commited files

Undo - Undo to the previous commit
Redo - Undo to the next commit
GotoCommit[n] - Go to the nth version

SetVersionLimit[n] - sets max number of saved versions to the last 5
------
NOTICE
------

Possible issue: The present notebook might not be a commited version, so no redo is possible. Especially with ManualCommits.
When doing changes after an undo (working on not the latest version), the latest changes (when running undo or redo) are not saved, only when running 'commit' these changes are saved (to a new version). Only changes to the version with the highest version number are changed upon 'undo'. Which would be the case most of the time.

Weather a commit needs to be made when running undo is checked with a system variable that can be altered by manually saving the document. Leading to possible loss of changes. For best results do not save the notebook manually and turn auto save off - just use commit to save the work.

------
TODO's
------

* do some cleaning up

----------------------------
Possible future improvements
----------------------------

* add commit clean and gotcommit button to dialog

* Change in notebook is checked using a system variable. so a manual save can lead to false conclusions. This could be fixed by a real comparison of the files. or maybe use "FileModificationTime"

* Manual commmits can still be made multiple times on the same file.

* Use Dumpsave and Get to backup and restore (at least partly) the memory state.

* Make autocommits after text was entered - not only on evaluations

-----------------------------------------------------------------



Copyright 2012 Jens Boberski

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
Something went wrong with that request. Please try again.