Thursday, April 30, 2009

Little Emacs Tricks #2

Emacs sometimes surprises me with wonderful little features.

Today, I realized the power of "undo in region".

If you remember you had made a change on a section of a file, but don't want to undo all the changes you've just been working on, mark a region and C-_ till you get what you're looking for. Until you unmark the region, it will only undo actions that affect that particular region.

This is particularly useful when working in large class files with many methods, or huge javascript files with too many functions. You can highlight a function, undo the changes you made half an hour ago, and continue on, without having to go redo the changes in between.

For instance, I was working on a heavily documented file, and realized I had accidentally deleted the Javadoc in one section of the file. I had done this a long time ago. I selected the lines where the Javadoc used to be, C-_, and boom, there it was, without affecting anything else in the document.

Wonderful stuff.

Labels: ,

Wednesday, April 29, 2009

Black screen when installing Windows XP after Linux

So recently I realized that my old laptop has a FAR stronger video card than my new one(GeForce 6800m vs. Intel X4500HD), so I decided to install windows in the empty space on the harddrive to get some casual gaming in.

Well, pop in the Windows XP disk, and boot from it: Setup is now inspecting the hardware configuration... and then a blank, black screen.

The problem is not with Linux.

I come to figure out, after days of random tinkering:

The problem is that Windows expects at least 6mb of free harddrive space at the beginning of the drive in order to start the installer.

GO FIGURE.

So I booted back into Ubuntu (9.04!) and fired up gparted. Took 12mb off the front of my oversized grub partition and restarted.

TADAAA!

The windows installer starts up great.

Microsoft really doesn't like anything but a virgin harddrive, I guess.