Remote Projects

February 14th, 2008

The latest updates of e has added support for remote projects. This means that you can open an ftp site directly in the project pane and use it as if it was a local project.

Working with Remote Project

In earlier versions of e, this could also be approximated with various shell plug-ins, but having it as an integrated part of e removes the reliance on external tools and gives a much nicer user experience. Implementing this features was also an opportunity to re-architect and improve a part of e that had gone a bit stale while the rest of the editor had evolved. The new underlying project framework is very flexible and extensible, and will allow for a lot of new capabilities in the near future.

Opening a remote project

To open a remote project just select ‘File/Open Remote Folder’ on the menu, create a new profile and press ‘Open’. The remote site will be opened in the project pane, and you can interact with it as if it was a local project.

Editing profile for remote project

You can also open remote files and projects directly from the command line. You just have to give it the path i url format:

e.exe ftp://ftp.mydomain.com/dir/file.txt
e.exe ftp://ftp.mydomain.com/dir/ (remember trailing slash for projects)
e.exe ftp://username:password@ftp.mydomain.com/dir/ (with login)

The remote projects feature is still very new and currently only supports the ftp, but support for protocols like sftp and webdav will be available soon.

Since the latest update of wxCocoaDialog, it has been possible to use it for making custom html dialogs. This gives you a lot more freedom when creating bundle commands as you can now use far richer and more responsive dialogs in your interaction with the user.

As an example of what is possible, and how easy it is to create interactive dialogs, I have created a bundle command version of the excellent Visibone Color Lab.

The modifications to the original html code is really minor. Mainly just moving some frames around and making it update on mouseOver. The interesting part comes where i modify it to return the color code when a color is clicked:

<area HREF=”cocoadialog://%23FFFFFF” onMouseOver=”pick(’FFFFFF’,'W’,'White’)” SHAPE=”POLYGON” COORDS=”184,200,202,168,221,200″>

By giving it a link with the protocol defined as “cocoadialog”, I instruct it to react on a click by closing the dialog and returning the links content (notice the url encoding for the # mark).

To make this into a bundle command, I just have to open the Bundle Editor and create a new command containing the following two lines:

cd "$TM_SUPPORT_PATH/Visibone"
CocoaDialog html --title "The 216-Color Webmaster's Palette" --html-from-file big.html --width 380 --height 542

By first setting the current working dir to the location of the html files (and images), I ensure that the dialog can find all it’s files.

I then set input to “None” and output to “Replace Selected Text”, so that the color code will be inserted in the text when a user clicks a color.

I hope that this has illustrated how easy it is to make html dialogs. Since you have full access to using javascript in your html, there is really no limit to how freeform and interactive you can make it.

Thanks to the kind permission of Bob Stein, the Visibone creator, I have been able to include the color lab in the latest update of e. You can find it as “Insert websafe color” in the HTML bundle.

Transpose - The MultiTool

March 21st, 2007

Transpose is a versatile command that can save you a lot of typing. What it does is to ‘reverse the order of things’, but what makes it really useful is the fact that what it reverses depends on the context:

  • If the caret is inside a word, the chars on each side of the caret are swapped, and the caret is moved to after the right char. This makes for a quick way to fix typing mistakes.

  • If the caret is between two words, the words are swapped.

  • If the caret is at the beginning of a line, the line is swapped with the line above. Similarly if the caret is at the end of a line, the line is swapped with the line below. This makes for an easy way to move lines up and down through the document.

  • If there is a selection, the contents is reversed.

  • If there are multible selections (made by holding down ctrl while selecting), the selections are swapped.

  • If there is a column selection (made by holding down alt while selecting), the order of items in the entire column is reversed.

You can access it from the menu, but to really make it a timesaver, I would recommend making it a habit to use it’s shortcut Ctrl-T.

Transpose Menu

Undo is one of the most fundamental features of modern software applications, yet it has hardly evolved since it was invented. And this is even though it widely acknowledged to be mostly useless when going beyond a few changes. This article presents a set of solutions to make undo far more useful. They not just blue sky ideas but actual features implemented and functional in e - the Collaborative Text Editor for Windows.

“By [undoing] repeatedly, you can gradually work your way back to a point before your mistake. This is convenient if you’ve made a mistake four or five commands back. It is marginally useful if you’ve made a mistake twenty or thirty characters back. And it is completely useless if your mistake is ancient history.” - Learning GNU Emacs (page 42)

Most modern software has an unlimited undo history, tracing the changes all the way back to the document creation. Yet, as the above quote attest, it is mostly useless beyond a few edits.

For some reason the introduction of unlimited undo seemed to be the end of innovations in this area. Maybe it was the because of the name. It was a convenient tick mark in the feature list, and what could you possible wish for beyond “unlimited”?

The main reason that undo has been mostly useless beyond the last few changes is that users get anxious in three ways:

  1. They lose any idea of where they are in the undo history.
    Solution: Keep them oriented with a Visual Undo History.
  2. They get unsure about what they actually just undid.
    Solution: Show the actual change in context.
  3. They get afraid of losing what they just undid.
    Solution: Ensure they never lose their old changes by branching.

A Visual Undo History

By showing a visual representation of the undo history, we help the user to keep his orientation. We can even add helpful markers like for when the document was last saved. This also makes it easy to jump around in the undo history.

Being capable of quickly jumping back and forth from a previous document state can be extremely useful. Anybody who have done some writing have probably tried to let some paragraphs, which should be deleted, stand because of a nagging feeling that parts of it might be useful later. When you know that you can always jump back and retrieve whatever parts you find useful, you can write much more freely.

Visualizing the Undo History

visual undo history in the e text editor

The undo history is shown in a separate window which updates live as the user types. The vertical line of small circles on the left shows the history of the changes. Each circle represents the document as it was at a specific point in time. By clicking on a circle the user can revert the document to the previous state.

To the right of each circle is a one-line summery of the changes that lead to it’s current state. Changes are indicated by colors: green for insertion and red for deletion. It is put in context by the gray text surrounding it. The window is resizable so you can easily enlarge it to see more of the change.

The solid blue circle indicates the users current position in the history and the small marker (in dark blue) indicates when the document was last saved.

The history is pretty terse but users quickly learn to scan over it, easily spotting the major insertions and deletions.

Showing the change in context

For the undo history to have any value, we have to show the changes in context. Showing the user that he deleted a few letters in a set of changes that could be done hours (or days) ago, doesn’t give him much idea of what really happened. But if you show it in context, with the words that the letters were part of surrounding them, it becomes much easier to remember where the change fit in the bigger picture.

Branching

branching in the visual undo history

What happens if you undo a lot of changes, start making new edits and suddenly discover that you undid too far? How do you get back what you undid by mistake? In most applications you don’t. Everything that was underneath you in the undo history was lost.

By allowing branches in the undo history any such loss can be avoided. Whenever you go back in history and start making changes a new branch is created.

Basically your work is held to be sacred, and an application should never let you accidentally lose any work. So you can always go back to a previous branch and continue to work from there, or maybe just copy the useful parts back to your current branch.

Persistence & Crash recovery

In just about all applications the undo history is lost the moment you close the document. There is really no reason for this since the undo history (if it is properly implemented) hardly takes up any space, and there is no guarantee that you won’t need it at a later time.

In e you always have the full undo history, even after reloading a document from a previous session. Should the computer crash (or lose power) while you are working, it will just start up where you left of.

Innovation

It is amazing that a feature as fundamental as undo has seen so little innovation over time. And it is even scarier that it has been implemented in a way that leaves anything beyond the last few changes mostly useless. Especially considering how many system & programmer resources that are used to keep track of the unlimited undo

It really makes you wonder how many other fundamental software features that could be radically improved if you just looked at them with new eyes.

Reality Now

So is this the pinnacle of undo functionality. Not at all. There are lots of possible improvements, like partial & selective undo or interactive diffs, which are obvious next steps and could be very useful.

But it is easy just to come up with critique and blue sky ideas which have no basis in reality. So I have limited this article to features which are actually implemented and functional, so you can try them out in the e text editor right now.

Experience with the text editor has shown that these basic improvements to the undo functionality greatly improves the writing experience. Making users much more confident in modifying and experimenting with their text.

It is my hope that showing that this is possible will raise the expectations of users, so that they will no longer accept applications that routinely lose or make inaccessible parts of their work.