Posts Tagged ‘Emacs’

Emacs Reference Mug

Wednesday, December 5th, 2007

13045051_240x240_back.jpgOh gentle reader, you have no idea how much I want one of these. Receptacle of refreshing beverage. Dispenser of Emacs wisdom.

Christmas is coming.

I wonder if I can convince family members to read my blog.
No one’s going to get this hint.

Update: I forced my wife to read my blog. She points out that it is both sad and telling that all I want for Christmas is an Emacs mug.

I’m going to bar her IP.

Default .emacs on Gentoo

Monday, July 2nd, 2007

Just a quick follow-up to Practicing Safe Emacs. Everyone knows that Gentoo is the greatest distro on the planet, superior in all ways to RedHat. Anyway, in Gentoo it’s possible to create a generic .emacs file for all users. A great way to ensure that everyone is, among other things, practicing safe editing.

To set this up, simply cons the commands you want into

/usr/share/emacs/site-lisp/site-start.el

and the config commands will be applied to all users. See the Gentoo Wiki Tip on using this to load Portage-installed Emacs packages.

Practicing Safe Emacs

Tuesday, June 26th, 2007

This has been bugging me for years and I finally got around to looking up a solution.

Everyone knows that Emacs is the greatest editor on the planet, superior in all ways to vi. Unfortunately, Emacs has this nasty habit of tossing tilde-terminated backup files around whatever directory in which you happen to be editing. Not only does this clutter up the file system, it can also be something of a security risk; especially if you’re working on web servers. And really, snapshots of your most recent save is not so useful if, like me, you pathologically ctrl-x ctrl-s your code every few characters or so.

After a bit of hunting I discovered that Emacs’ built-in versioning could solve both of these problems. Cons the following two commands into your local .emacs:

;; Enable versioning with default values.
(setq version-control t)

;; Save all backup file into the designated directory.
(setq backup-directory-alist (quote ((".*" . "~/.emacs.d/backups/"))))

and not only will Emacs remember all saves:

$ ls .emacs.d/backups/
!home!gates!GPLv3.txt.~1~ !home!gates!GPLv3.txt.~2~

but, as you see, it also tucks your backups safely out of harm’s way.