E-Scribe News : a programmer’s blog

About Me

PBX I'm Paul Bissex, and e-scribe.com is my consulting business. I build web applications using open source software, especially Django. I teach photographers web design and professional skills. In the '90s I did graphic design for newspapers and magazines. Then I wrote technology commentary and reviews for Wired, Salon.com, Chicago Tribune, and lots of little places you've never heard of. Feel free to email me.

Book

Python Web Development with Django I'm co-author of "Python Web Development with Django", an excellent guide to my favorite web framework. Its strong points include an introduction to Python, and better coverage of Django 1.0 than nearly anybody else. Published by Addison-Wesley, it is available from Amazon and your favorite technical bookstore as well.

Colophon

Built using Django, served by Apache and mod_wsgi. The database is SQLite. The operating system is FreeBSD, on a VPS hosted at Johncompanies.com. Comment-spam protection by Akismet. Vintage topo imagery from the Maptech archive. The markup engine is Markdown.

Pile o'Tags

Stuff I Use

Akismet, del.icio.us, Django, dpaste.com, Emacs, FreeBSD, Freenode, jQuery, LaunchBar, MacPorts, Markdown, Mercurial, OS X, Postfix, Python, SQLite, Subversion, TextMate, Trac, Ubuntu Linux, wmii

Spam Report

At least 67556 pieces of comment spam killed since January 2008, mostly via Akismet.

Keeping emacs backup files tidy

In the shell, emacs is my editor of choice. However, it has one default behavior that has gotten in the way more often than it has helped -- automatic generation of backup files in the same directory as the original.

Emacs is great for making quick edits to files on the web server. But I don't want or need all those *~ files sitting around. The material is all in version control, so I can revert to any point in history already.

I went to the #emacs IRC channel on Freenode to ask about this, and was prompty handed a canned help message that led right to the solution to my problem: backup-directory-alist lets you specify a directory where backup files get saved.

A little googling yielded the following nice snippet from Sean B. Palmer which I prompty deployed in my .emacs file. Problem solved. Thanks, everyone!

;; Turn off the annoying default backup behaviour
(if (file-directory-p "~/.emacs.d/backup")
    (setq backup-directory-alist '(("." . "~/.emacs.d/backup")))
    (message "Directory does not exist: ~/.emacs.d/backup"))

Monday, February 2nd, 2009
+ +
3 comments

Comment from Andrew , later that day

> Emacs is great for making quick edits to files on the web server.

Usually people like to complain that Emacs takes forever to start since it's an "OS," not a text editor. :)

Comment from simeon , later that day

>Usually people like to complain that Emacs takes forever to start

Yeah back when Emacs stood for "Eight Megs And Constantly Swapping" this was a problem. Not so much nowadays...

Comment from m , 1 day later

Try M-x customize-group backup

The first item is "Make Backup Files". Turn it off.

Post a comment

Thanks for reading! Please note: Your comment will not appear until approved, which may take a few hours or more. Spammers will be torpedoed.


(Will not be shared)

(Optional)