Revisiting Recent Files

When you open a file, do you like Emacs to remember where you were when you last visited the file and return you to that place? I’m probably a minority but I find that behavior annoying. Of course, I can see why people would like that capability. The nice thing about Emacs is that you get to choose. As with most things in Emacs, you can have it your way.

James Dyer is one of those people who like having Emacs take him right back to where he left off when he opens a file. It’s a small part of his larger workflow for dealing with recent files. What he wanted was a list of recently used files, ordered by most-recently-visited, that would allow him to easily revisit a file and be positioned at the cursor’s last position. He discovered that recentf-mode and save-place-mode did almost what he wanted. The only problem was that recentf-mode opened its list of files in a separate buffer. Dyer wanted a more completion-like interface. It turns out that recentf-open-files does that but, annoyingly, the files get reordered.

Dyer solved this with a tiny bit of Elisp. You can read the details in his post. If you, too, like being able to revisit recently edited files and be taken back to the exact position where you left off, take a look at his post.

To me, the most interesting part of Dyer’s post comes at the end. His changes, he admits, are a small optimization but one that makes his workflow a tiny bit smoother. As he says,

That’s the kind of workflow improvement that makes every day at the keyboard just a little bit more pleasant, and those small pleasures add up to something significant over months and years of coding.

Who can argue?

This entry was posted in General and tagged . Bookmark the permalink.