Hack Jam Log Book is a log of progress made in and around a weekly hack session. Topics include natural language processing, high energy electronics, linguistics, interface design, &c. Enjoy.

Recent Posts:

Archives:

28.11.08

 

Write or Die: Now on Emacs!

For those of you that write, or wish you wrote, or otherwise procrastinate while performing text-based activities, try out write-or-die. It is a nice cattle prod; if you don't write for several seconds, it will punish you. I find that the Kamikaze mode is most effective --- the punishment is that it will delete words, bit by bit, until you begin to write again.

However, I use emacs; and switching from my carefully-tuned text-editor extraordinaire to a javascript-based text-box is a bit of a disappointment. That's why I threw together this emacs version of write-or-die.

Just paste the following into your init.el, and when the time comes, M-x write-or-die. When you have accomplished your goal, M-x no-more-die, and you're set.


(let ( (write-or-die-time ())
(write-or-die-init ()) )

(defun write-or-die ()
(interactive)
(setf write-or-die-init (run-with-idle-timer 3 t 'w-or-die)))

(defun w-or-die ()
(interactive)
(kill-region (point-max) (- (point-max) 10))
(setf write-or-die-time (run-with-idle-timer
(time-add (current-idle-time)
(seconds-to-time 3))
()
'w-or-die)))

(defun no-more-die ()
(interactive)
(cancel-timer write-or-die-init)
(cancel-timer write-or-die-time))

)

Possible improvements --- flashing colors, like the web-version has, to warn you of the time limit; word-by-word deletion, rather than 10 characters at a time; variable time limit; etc. But those can wait. Right now I need to write another 10,000 words.

Comments:
Cool, but I'm not an emacs man...

Well, I'm not really a Windows man either (go Tux!)...

...but I threw together a version in .NET cause I've been doing most of writing on a Vista (shudder) laptop. Check it out here.
 
Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]