| 1 | | Undo manual |
| | 1 | === Undo === |
| | 2 | |
| | 3 | RefactorErl had an undo operation for refactorings, but with this method |
| | 4 | could you lose some modifications. Namely if the you edit the text after a |
| | 5 | refactoring, then undo the changes, all changes since the last |
| | 6 | refactoring were lost. This undo was one step only, but it could be |
| | 7 | extended to more steps. |
| | 8 | However, if we extend this undo, at refactoring undo there can arise |
| | 9 | conflicts among changes of editing and the transformations - and also among |
| | 10 | two transformations -, but refactoring undo should handle these conflicts, and it must be as |
| | 11 | complete as possible. |
| | 12 | In this section we introduce a new undo/redo mechanism for the tool integrated in Emacs. |
| | 13 | |
| | 14 | ==== Installation ==== |
| | 15 | |
| | 16 | The new undo mechanism is disabled by default, to enable it, we need additional software components. |
| | 17 | This extended undo is implemented by a stand alone Haskell program, so we need ghci Haskell Compiler |
| | 18 | and cabal packaging system, that makes easier the installation of the required packages, modules. |
| | 19 | The Haskell compiler can be downloaded from the website http://www.haskell.org/ghc/download. Cabal is |
| | 20 | available at http://www.haskell.org/cabal/download.html or on Linux systems with {cabal-install} package. |
| | 21 | The files of this component can be found in lib/referl_ui directory within the tool under emacs. In this directory |
| | 22 | you have to run make for compiling the source. To enable the new undo mode you had to set the |
| | 23 | refactorerl-undo-mode to selective-undo. |
| | 24 | |
| | 25 | ==== Usage ==== |
| | 26 | The undo (redo) function is available in the Refactor menu with Undo |
| | 27 | (Redo) menu item. Calling the undo |
| | 28 | operation the program undoes the last change in the current file. Case refactoring |
| | 29 | the modifications will be rejected in every affected file, but in some cases can conflits arise. |
| | 30 | When you edit an affected file, or make one another refactoring, the system checks, if the second |
| | 31 | change affects the refactored area in the file. If the changes are overlapped, the undo reverts also this |
| | 32 | change, otherwise only the first one, and you get a merged state of the file. At more complex changes can |
| | 33 | also more changes get reversed. In both cases the changes can be redone until a newer modification. |
| | 34 | |
| | 35 | |
| | 36 | |