Tools of the Trade: Timestamps and Text Editors

Quoting people accurately is a mundane but crucial task in my daily work. Over the years, I’ve tried a variety of approaches, but I think I’ve finally evolved the most efficient system for handling it. When I’m conducting an interview or attending a presentation at a research conference, I take copious notes. These used to be on paper, using a complicated note-taking technique I developed in college, but after discovering the amazing capabilities of Emacs (the One True Text Editor), I’ve switched to doing it on a computer.

My notes are not strict transcripts. I tried doing transcripts, but it was more hassle than it was worth, and I found that there’s a conflict between transcribing someone’s words accurately and actually understanding what they’re saying. Instead, I note the important parts of the conversation as if I were attending a lecture, and periodically insert a semi-transcribed snippet if they start saying something I think might be quotable. Such a snippet might read “thr’s bn a lotta contrvrsy n th fld abt this, bt itot tht th mech is rly simpl.” With that sort of primitive shorthand, I can transcribe even relatively quick talkers with about 90% accuracy in short bursts. But I want 100% accuracy.

To get that, I record all of my interviews and conference sessions. Yes, recording phone conversations is completely legal everywhere, as long as you ask permission first. The notes plus the recording give me all the information I need, complete with 100% accurate quotes. To streamline the process, though, I added one more piece: timestamps. As I’m taking notes, I hit a keyboard shortcut, and my computer inserts the elapsed time since I started the recording. When I’m writing, I can look through my notes to find the quote I want, then zip to that time in the recording, play back the tape, and check the quote. Cumulatively, this can shave hours of tedious rewind-play-forward-play searching on a long assignment.

Unfortunately, most word processing software doesn’t offer elapsed time stamps, and because the popular choices are either closed-source (Word, Pages) or mind-bogglingly complicated open source (OpenOffice), it’s not trivial to add this feature. You could sort of work around the problem by using real-time stamps, then calculate the elapsed time between when you started the tape and when you got to a particular point, but that could take as long as just searching the recording blindly. Instead, I suggest switching to a proper text editor (a choice that has a lot of other benefits, too). Once you’ve done that, there are at least two ways to add the elapsed time feature.

For Emacs users, the solution – like the solution to every other Emacs need – is to modify your “.emacs” customization file. It’s not hard. Here’s the bit that does the actual work:

<br /> ;;; Elapsed time and realtime stamp functions<br /> (defun clock-start ()<br /> "Starts a clock which can then be used by<br /> `clock-insert-elapsed' to insert elapsed time into the current buffer."<br /> (interactive)<br /> (setq clock-start (current-time)))

(defun clock-time-elapsed ()<br /> "Returns the elapsed time since the clock was started with `clock-start'."<br /> (interactive)<br /> (setq elapsed-time (time-since clock-start))<br /> (format-time-string "%T" elapsed-time t))

(defun clock-insert-elapsed ()<br /> "Inserts the elapsed time since the clock was started with `clock-start'."<br /> (interactive)<br /> (insert (clock-time-elapsed) " ")<br /> (newline))

(defun timestamp ()<br /> "Insert string for the current date and time."<br /> (interactive)<br /> (insert (current-time-string) " ")<br /> (newline))

To link that to some convenient shortcut keys, also add these lines:``

<br /> (global-set-key [(hyper f8)] 'timestamp)<br /> (global-set-key [(hyper f7)] 'clock-start)<br /> (global-set-key [f8] 'clock-insert-elapsed)<br />

That’s it. Now, hitting command-f8 inserts a real-time stamp, while command-f7 starts a stopwatch and f8 by itself inserts the elapsed time since the stopwatch started. Whenever I start recording a phone call or conference talk, I simply hit command-f7 right after pressing the “record” button. Whenever the source says someting potentially interesting, f8 then bookmarks it for later access. These keys are convenient on a Mac – if they’re already assigned to something else on your system, simply choose different shortcuts. Once you’ve used them a few times, they’ll become second nature.

For other text editors, I use a pair of Bash scripts that I can call from a general system-wide shortcut. These are incredibly primitive scripts, and I’m sure there’s a more elegant way to do this, but here’s my approach. First, we have a script to start the clock, creatively named starclock.sh:

`

!/bin/bash`

if test -e ~/Desktop/clock<br /> then<br /> rm ~/Desktop/clock<br /> fi

echo $(date +%s) > ~/Desktop/clock

That saves a file to my desktop with the current time, in seconds since the Unix epoch date (don’t ask – it works). The other script, etime.sh, looks like this:

`

!/bin/bash`

BEFORE=$(cat ~/Desktop/clock)<br /> AFTER=$(date +%s)

# Calculate elapsed time in seconds and subtract 19 hours (68,400 seconds)

ELAPSEDSECONDS=$(expr $AFTER - $BEFORE - 68400)

echo -e $(date -r $ELAPSEDSECONDS +%H:%M:%S)

That reads the clock start time from the desktop file, then calculates and returns the elapsed time since the clock started. Set a pair of keyboard shortcuts (such as command-f7 and f8) to call these two scripts and insert the result of the latter into your text document, and you’re all set. This has worked well for me in both Vim and the free version of Smultron, but any text editor that can call command-line scripts should be able to handle it.

Yes, I understand how useless this post will be to most of my readers. If you’re a scientist working in the lab, you probably have no need of timestamps or interview recordings. If you’re a journalist, you probably have no clue how to make a text editor execute a script, how to modify your .emacs file, or even whether any of this is safe. However, I hope it provides a good example of why you might want to learn those things. For modern writers, editing text on a screen is a fundamental job skill, and the software we use to do it is an essential tool. If you’re limiting yourself to corporate-oriented word processors, you’re like a photojournalist trying to shoot an assignment on a crappy camera phone. It might be possible, but it won’t be easy. Text editors are the digital SLRs of writing, and learning how to use and modify them is time well spent.

Explore

Subscribe