This site is best viewed in Firefox.

Enterprise Emacs

Sunday, 24 February 2008

Many years ago I discovered the beauty in a beast called Emacs. I am actually a frequent user of both Emacs and VIM, but I firmly belive in the notion of learning one editor well. It took me several years to get to know it well, but it was all worth it!

This is the first tale in a series of entries about my thoughts and ideas about something I would like to call Enterprise Emacs. Enterprise? Yes, everything these days is enterprise this and enterprise that, stick some glue on it and you are enterprise ready! Let me give you some glue...

At many jobs I have had people have looked over my shoulder and said; "Oh, Emacs. Yeah I used that ages ago when I was working on UNIX, is it still C-x M-v...?". Of course, I say, because it still is. They usually continue; "Well, I left it because it was too hard to use...".

Until now I have not really had a good reply — because I understand these people. Emacs can be really counter intuitive and an outright pain in the **** to use. That is my gripe and I will use this blog to present the small things I have done to make Emacs more user friendly.

I find it a shame that still today, after so many decades (literally!) there are no sane defaults setup — I have seen something in Win32-Emacs that resembled what I would like to have — a sort of use cases possible to chose from. Why not have that on the GNU/Linux versions as well?

OK, so what is it that I want by default? Well, to me it is, at the very least, the following really obvious things:

Most of these settings today have a graphical menu called "Options", where you can actually click and save. So those tiny things are fixed in the latest Emacs versions. Wow...

In the coming months I will present some useful tips from my bag of tricks. Including, but not limited to:

Plus the usual Emacs features that users of Microsoft products may not have ever known. To mention a few: complete indentation engine, with several predefined indentation modes. Built-in calculator (converts between bases!)

The first tip is Emacs-23 with, grab on to something, font anti-aliasing! Yes, it's still an experimental feature, and if you did not already know this, "experimental" in free/open source is often quite stable. I have used it daily for >6 months and it has crashed on me only once.

Start off by installing it and discover the Options menu. Then return to this blog and I will have the next installment ready.

Posted by Joachim Nilsson at 10:59 in /emacs | Permalink

Suspend/Resume Nightmare on Ubuntu

Saturday, 23 February 2008

I've had my ThinkPad T43 for a while now and I'm really pleased with it, everything just works! It took some pleading and, I admit, begging to persuade my boss and the IT department to buy it since they usually only buy from Dell or HP. This was mainly due to care packs and payment plans that these suppliers offer companies. My ThinkPad they had to actually pay for straight up. So if I were a Lenovo sales person, that was something I would fix to boost my sales.

This post is however not about sales, brands of laptops or how the cat ate my homework ... well, OK, almost. Ubuntu/Gnome ate my resume!

When I initially installed the laptop, early 2006, I went with Ubuntu 5.10. Ubuntu is great Linux dist! Ubuntu is to Debian what Mandrake was to RedHat in the beginning: RedHat + all the tweaks you usually had to apply.

I remember the first install, it was a Breeze! All features and extras of the laptop was of course not working so after some digging I found a few pages detailing what to do to get things like susped, hibernate and such working. A couple of hours later everything was working! Cool, that had to be the first computer where I actually bothered setting it all up.

Now, two years later I run 7.10 and I am less than happy. All upgrades have made this laptop a complete mess. Each upgrade has failed to integrate the necessary changes I made and simply installed the new default settings from each package. OK, I can live with that. But I was starting to really miss having no suspend, so the last four months I have been working on fixing it all again.

It turns out that if I run the script /etc/acpi/suspend.sh manually from the prompt suspend and resume works fine, even with X. But when I press Fn-F4 from within X or select "Suspend" from the Gnome "logout" menu the machine happily goes to sleep but always fails at resume. I always get a black screen!

Why is it so complicated? I really don't understand. What is it doing?

OK, so I started digging. The Fn-F4 button didn't work in the console so that seemed like a first thing to investigate. I started acpi_listen and pressed Fn-F4, bingo! It returned a key press. A grep later and I had found it in /etc/acpi/events/ibm-sleepbtn, alright! Simple syntax, seems it looks for the ThinkPad sleep button and then sends another new combination $KEY_SLEEP, wtf?

I changed the action to call /etc/acpi/sleep.sh, restarted the ACPI stuff and, yes it works! At least from the console, not from X/Gnome. Aha, so we have a Gnome app that does magic things, HAL + gnome-power-manager.

I didn't get any further. Removing gnome-power-manager fixed my problem, I can now press Fn-F4 from Gnome, close the lid, come back the next morning and sucessfully resume when opening the lid again.

So, the question is, wtf is gnome-power-manager doing and why do I have to learn this stuff all over again every time I upgrade?

Posted by Joachim Nilsson at 21:34 in /ubuntu | Permalink