Auto Save and Versions

In the beginning, Jobs created the Save command—because computers were really slow. Every time you saved, your work was interrupted for a few seconds (or a lot of seconds) as the very slow program on your very slow computer saved your work onto a very slow floppy disk.

And that, ladies and gentlemen, is why most programs still don’t autosave: because the interruptions were just too annoying.

But computers now have plenty of horsepower. They could be saving your work every few seconds, and you’d never even know it. Why shouldn’t all programs save your work as you go, automatically and invisibly? As long as you also have the option to rewind and take your document in a different direction, what could possibly be the harm?

And so it is that, in Lion, Auto Save is one of the key new features.

Unfortunately, it’s available in only a few programs, at least at the outset. You’ll find it in Pages, Keynote, Numbers, Preview, and TextEdit. In these programs, your document is saved every time there’s even the tiniest pause in your typing or working—in the background. No progress bar, no interruption. And if you’re on a tear, typing nonstop, your work is saved every 5 minutes, even while you type.

In these programs, you’ll never even see the Save command in the File menu—except in that short time before you’ve saved and named a new document for the first time. After that, the command says Save a Version, which is a different beast altogether (read on).

Versions

In those enlightened programs that work with Lion’s Auto Save feature, there’s a more complicated but more powerful feature at work: Versions. It’s an invisible paper trail of every in-progress condition of your document—and you can return to any earlier version at any time. You can even return to an earlier version and copy just a chunk of it into the current version, which is great when one paragraph of your previous draft was gold, but the rest was junk.

It’s all much more sensible, elegant, and useful than the old Save As command.

The Versions world of document management is quite a bit different from the old setup. Here’s what you need to know:

  • All the version information is stored in the same original document file. (It’s not like there’s a rat’s nest of icons for each thing you’re working on.) But when you send the document to somebody else (by email or network, for example), Lion is smart enough to send only the current version, stripping out all the history. Nobody will ever know how much you labored over your work (or how little).

    Note

    Behind the scenes, the various versions of each document are saved in an invisible folder on your hard drive called .DocumentRevisions-V100.

  • Lion creates a new snapshot of your document once an hour. You can also create new snapshots manually at even shorter intervals—by using the File→Save a Version command (which is why your reflex of periodically hitting -S isn’t wasted).

    These snapshots, or versions, represent rewind points that you can return to later, even months or years after you first created the document. Thoughtfully enough, Lion records, invisibly, only what’s changed between versions, so your files don’t get all big and bloated.

    Note

    All right, you don’t have total time-rewinding control. Lion stores hourly versions for a day, daily versions for a month, and weekly versions for all previous months.

  • There’s no Save As command anymore in these programs. Instead, when you want to spin off a different version of a document—because you want to experiment with taking it into a radical new direction, for example—choose File→Duplicate. (Or choose Duplicate from the title-bar menu shown in Figure 4-24.)

    Before your very eyes, a duplicate version of the open window springs into existence. If the original was called “Kumquat Tarts,” the new one is called “Kumquat Tarts copy.”

    At least that’s what it says in the title bar. Don’t be fooled, however. In fact, you still have to save this new document (File→Save) to give it a folder location and new title, if you like.

    Point to the title of your document to see this secret menu. It contains the full list of commands that pertain to Versions.

    Figure 4-24. Point to the title of your document to see this secret menu. It contains the full list of commands that pertain to Versions.

  • There’s a secret Versions menu in the title bar. Point to the name of your document. In Auto Save–compatible files, a little ▾ appears in the title bar (Figure 4-24).

Rewinding to an earlier version

The point of all of this, of course, is to make it easy to go back in time—to undo the mediocre work you’ve done, or to resurrect some genius work that you later deleted.

The quick way is to choose File→Revert to Saved. (You can also choose Revert to Last Saved Version from the menu shown in Figure 4-24.) That command restores the document to the last snapshot version (or to the way it was when you most recently opened it, if no new versions have been created). That, of course, is nothing new; lots of programs have Revert to Saved commands that work similarly.

What’s new in Lion is that you can revert your document to any snapshot, even an ancient one from weeks or months ago.

To do that, open the Versions menu (shown in Figure 4-24). From the pop-up menu, choose Browse All Versions.

After a moment, you see the stunning display shown in Figure 4-25. On the left, you see your document in its current condition. On the right, you see a stack of windows that represent all the different snapshots of your document, going back in time. (And behind it all, you see another sort of version: Apple’s animated, starry version of the galaxy.)

If you’ve ever used Mac OS X’s Time Machine feature, this display should look familiar. It’s your chance to go back in time to recover an earlier, better version of your document (or just a part of it).

Figure 4-25. If you’ve ever used Mac OS X’s Time Machine feature, this display should look familiar. It’s your chance to go back in time to recover an earlier, better version of your document (or just a part of it).

You can have all kinds of productive fun in this version browser:

  • Compare the current version (on the left) with the next-most-recent one (on the right). These are live documents, so you can scroll through them as necessary. If you decide to stick with the latest edition on the left, just click Done. You leave the starry version-history world and go back to editing.

  • Zoom back in time to inspect older versions (snapshots) of your document. On the right side of the screen, you see earlier versions of the document—maybe even dozens of them, stretching back in time.

    You can click individual windows’ title bars to see what’s in them. You can also click or drag your cursor through the notches at the right side. It’s like a time ruler that flies through the windows into the past. (As you go, the time/date stamp below the right-side window identifies where you are in time—that is, which version you’re examining.)

  • Restore an earlier version. If you finally find the incarnation of the document you consider superior to your current one, click Restore. You leave Starry Versionland and return to your document, which has now been rewound to its earlier condition.

    If you later decide you should not have gone back to that earlier version, no problem. Your later version—the one you started out with—is still in the version browser, too. So you can go back to it, if necessary.

    Tip

    If you press Option, the Restore button changes to say Restore a Copy. In other words, you’ll create a previous-version duplicate of the document, without disturbing the current condition of the one you’ve just been working on.

  • Restore part of an earlier version. Often, the current version of your work is generally good, but you really wish you could recover one magical sentence or paragraph or section—something you’ve since edited or deleted.

    You can do that in Starry Versionland, too, because Copy and Paste work here!

    Use the time ruler to find the earlier edition of your document, the one containing the good stuff. Then drag through the desired text or graphics in the window on the right, as shown in Figure 4-25. Now copy the highlighted material (either press -C, or move your mouse to the top of the screen so that the menu bar appears, and choose Edit→Copy). Click in the current version of the document, the one at left, and now paste (-V, or use the menu bar). Click Done to complete this astonishing act of salvation.

  • Delete a version. There are all kinds of reasons why you might want to delete one of your older snapshots. Maybe you wrote it in a fit of pique (or exhaustion), and you want to make sure nobody ever, ever reads that awful prose. Maybe you know there’s nothing valuable in it, and you’d rather not dedicate hard drive space to it.

    In any case, deleting a version is easy to do. Once you’re in Starry Versionland, point to the ▾ in the title bar of the version (on the right side). You’ll discover that the menu now contains only one command: Delete This Version. Click Delete in the confirmation box. Any questions?

Tip

If you press Option, the command says Delete Old Versions. Once you confirm your decision, you’ll be left with only the most recent edition, without any way to rewind.

Locking documents

If all this version recording is making you dizzy, you can call a halt. You can freeze a document in its current condition so that nobody can make any further changes to it. You might lock a contract document before you send it to someone, for example, or just freeze your novel into what you hope is its final form.

To do that, click the ▾ in the title bar; from the shortcut menu, choose Lock. Now the title bar says “Locked.” If you try to edit the document, you’re offered the dialog box shown in Figure 4-26.

It’s also worth noting that Mac OS X itself locks every document two weeks after you last made changes to it—what Apple considers a useful safety net.

Tip

You can turn off this auto-locking thing, or just change the interval. To find these controls, open → System Preferences. Click Time Machine. Click Options.

If you try to make changes to a document, Lion gives you two choices. You can unlock the document or click Duplicate, which spins off an unlocked perfect copy.

Figure 4-26. If you try to make changes to a document, Lion gives you two choices. You can unlock the document or click Duplicate, which spins off an unlocked perfect copy.

Get Switching to the Mac: The Missing Manual, Lion Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.