Many people think that learning to use Regular Expressions is difficult, but if you stick to the basics it is actually quite easy. This screencast and cheatsheet will give you a gentle introduction and allow you to gradually expand your knowledge into advanced usage.

Nothing can improve your ability to manipulate text as much as learning Regular Expressions, and it is not just in your editor. Just about any modern programming language support them, so you can greatly enhance your productivity and understanding of code by learning them.

The following screencast gives an introduction to the basics of regular expressions and shows how you can use them in your editor. The best way to learn is just playing around with them and watching the interactive feedback.

I have included a cheatsheet that you can use as a quick reference, and to expand your knowledge of Regular Expressions. I recommend that you print it out and gradually expand your comfort zone by trying out more and more features.

Regular Expression Cheatsheet

Ben Kittrell's rails environment

Ben Kittrell has written a straightforward how-to guide on creating the ideal Windows environment for Ruby on Rails development:

A Mac-esque Rails Development Environment on Windows

New website and tighter focus

February 20th, 2007

e finally has a new website! The old one was getting a bit long in the hair and didn’t really reflect the current focus (the TextMate support was only mentioned in a small note in the sidebar).

e icon

Luck had it that I was contacted by Junaid W. Hanif, a web designer from Pakistan. Who liked e so much, that he offered to design a new website for it. He had just left his job working with big clients to venture the freelance world and he wanted to work with people independently so he could show them his creativity and love for web standards. So designing a new website for e was a good chance to get some exposure and start building up a solid portfolio. Even with the time and cultural differences between Denmark and Pakistan, the collaboration went very well, and the new site is the culmination of many iterations where Junaid patiently adapted it to my specifications.

Some users have noticed that the new site was lacking any reference to the collaboration features. I still have a lot of plans for the collaboration and revision control features. But at right at this stage it was diverting from the current focus on TextMate compatability. I early had the realization that no matter how powerful I made the rcs features, they would never really get used if the basic editing features weren’t up to scratch. So the main focus now is to get the TextMate compatibility complete and stable.

I will actually be removing the collaboration features for a time. They will come back in a much more powerful version when the TextMate features are stable.

On Licensing and Trial periods

January 21st, 2007

When the first beta’s of e was released, it had a 30 day trial period, after which you had to buy a license to keep using the program. This was primarily based on experiences with other projects, where the transition from free to for-pay had resulted in a backslash from the user community.

This was a fine strategy when e was supposed to be simple editor, tightly focused on collaboration, which would be quickly out of beta. But the introduction of TextMate bundle support largely increased the scope and ability of the program, and greatly extended the beta period.

Based on thoughtful feedback from many users (many of whom had bought their own licenses), I have decided to make it possible to keep using the program beyond the trial period. This will stay possible for as long as the program is in beta state.

When you register e, the license is bound to you, and not to one specific computer. This means that you can use you license on as many computers as you like. There is also no limit on platforms, so it will also be valid on future versions for Linux or any other OS.

The license is valid for one year (time in beta does not count). After that minor updates are free but there will be an upgrade fee for major updates (2.0).

There is no greater encouragement than when users show that they like the program enough to buy it. So to show how much I appreciate those who do register while it is still in beta, all licenses being bought during the beta period will be extended to include the next major update + one more year of free updates.

The Power of Textmate on Windows

November 20th, 2006

The origin of the e text editor, comes from a project to create a next generation revision control system. The aim was to create an rcs, that could be deeply embedded into applications. This could give them all kinds of capabilities, which would otherwise be impossible. To have a real base to work from, I had to make an example application to embed it in. The choice of a text editor was obvious, since text currently is the main target for revision control. So after a lot of development, i had a very powerful and versatile revision control engine and a very basic text editor build on top of it.

The editor showed the potential of the underlying engine (like total crash survivability and undo as powerful as a fine-grained rcs), but it was still really to basic to be used for day-to-day work.

Enter Textmate

In the mean time Textmate had emerged as the new baseline for what a text editor should be capable of. It was the first editor since vi and emacs to introduce a radical improvement in interaction and usability. Only available on MacOS X, it’s modern interface had raised users expectations.

To get an idea of what makes textmate so special I can recommend viewing the screencasts at http://macromates.com/screencasts

It was obvious to me that my editor had to live up to these new expectations and it seemed that my only options was to either reinvent or blatantly copy textmates features, neither of which seemed very honest or appealing to me.

Instead I choose a third option: compatibility and cooperation.

Cooperation vs Competition

I contacted Allan Odgaard, the creator of textmate, to set up a meeting. Luck had it that we were both from Denmark, so we could meet in person. When we actually meet, we were surprised to find out that we had both studied at the same place (but never met), and when I told him where i live (which is in a small village in the countryside), we discovered that not only did his parents have a summerhouse in the same village, but it is actually within walking distance of my place. What are the odds? It is really a small world!

Allan was very positive about the prospect of me making the editor compatible with textmate, and he had no problems with me using the textmate bundles. Having more people, on more platforms, to use and improve the bundles, could only make them even more powerful and comprehensive.

This release is still a very early beta. It supports all the basic bundle features like themes, language grammars, snippets & commands. There is still no projects or bundle editor and there are many small features missing, but all the underpinnings are in place so it will advance rapidly from here.

Obviously some bundle items contain mac specific commands, so they will gradually be ported or replaced with equivalents.

e with the Vibrant Ink theme
Selecting a bundle item
Other Platforms

Currently e is only available for Windows. But since it is coded in wxWidgets, in a totally crossplatform manner, a Linux version is very possible if there is enough interest. Out of respect for Allan and his work I will not be making a Mac version.

The Future

I will keep working with Allan to ensure that e stays compatible with the textmate bundle system. He has a lot of really cool stuff lined up for version 2.0, so there is something to look forward to.

When the textmate compatibility is complete, I will return to the original goal. Using the power of the underlying revision control engine, to introduce features beyond what is seen in any other editor.

e with the Vibrant Ink theme
e with the ‘Vibrant Ink’ theme

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.

Introducing e

August 23rd, 2006

The central premise is this. Imagine if your entire filesystem was one big distributed revision control system and your text editor fully reflected this. Rather than using the realtime method of collaboration (like for example SubEthaEdit) it explores the intersection of editing and revision control. This gives you live revision history and makes collaboration effortless (even when people work asynchronously).

For this early beta I have just barely scratched the surface of what is possible when revision control is fully integrated into the application. The problem with most revision control systems is they often ends up being used as glorified backup systems. I would like to get beyond backup and sharing to make it’s usage an effortless and natural part of your daily work.

In this first release it only supports sharing over the local network (using Bonjour), but collaboration over WAN is on it’s way.