Installing Aspell

As I posted yesterday, it turns out that I have some old 32 bit software left over from Fink installs on my machines. As far as I know, none of it was being used except for Ispell. Once I got rid of the /sw subdirectory, I needed a new version of Ispell for Emacs. As long as I was changing things I also looked at Aspell and compared their features. No doubt about it, Aspell is superior but Ispell had one advantage: it has a filter that allows it to work with nroff files. Because I do a lot of writing using Troff, this was important to me so I decided to just update Ispell.

That turned out to be harder than I thought. Despite having a configuration file for OS X, it wouldn’t even compile on my machine. I played around with it a little until I decided that I was just wasting my time and that Aspell probably made more sense anyway. Unlike Ispell, the Aspell installation was a snap.

First go to the Aspell site and download the latest version by clicking on the “latest version” link. Then click on the “available dictionaries” link to choose a dictionary. I put both of these in ~/tars/, which is where all my tars live, and then unpacked them into ~/tools/ with

cd ~/tools
tar -xvzf ../tars/aspell-0.60.6.1.tar.gz
tar -xvjf ../tars/aspell6-en-7.1-0.tar.bz2

next I built Aspell with

./configure
make
sudo make install

The last line will install Aspell in /usr/local/bin. You can also copy the Ispell and Spell emulation scripts, if you want them, with

sudo cp scripts/ispell /usr/local/bin
sudo cp scripts/spell /usr/local/bin

Finally I installed the dictionary with

./configure
make
sudo make install

At this point I had a working Aspell. The last step was to tell Emacs to use Aspell, which I did with

(setq ispell-program-name "/usr/local/bin/aspell")

Then I restarted Emacs and was up and running again.

So far, I really like Aspell. It is much better at suggesting alternatives for misspelled words and seems every bit as speedy as Ispell. If you’re still using Ispell for hysterical raisins you might want to give Aspell a try instead. I think you’ll like it.

Posted in General | Tagged | 2 Comments

Building Emacs 24 on OS X Lion

Now that Emacs 24.1 was officially released it was time to stop messing around and actually get it installed. I tried that last year but had problems with configure not finding tputs in any of the curses libraries. This time it was even worse.

The first problem was that configure couldn’t find gcc. Regular readers will remember that my laptop recently underwent significant sugery and had a complete OS reinstall. It turns out that the new Xcode doesn’t automatically load the command line versions of the compilers. Fortunately, Graeme Mathieson over at Notes from a Messy Desk had the answer. It’s a little involved so I’ll just send you over to Mathieson’s blog if you need to do this. I will note, though, that I didn’t bother with OSX GCC Installer and just used Xcode to load the command line tools as Mathieson explains.

After getting over that problem I was back to having configure fail while looking for tputs. I knew that the ncurses library was installed and that tputs was there so I couldn’t understand why configure was failing. After trying various things, I finally just commented out the test for tputs in configure to see what would happen. That change made configure run but then the compile failed. That failure gave me the final clue as to what was happening. Long ago I used the Fink package manager but stopped after OS X moved to 64 bits because it was too hard to get Fink upgraded. However, the /sw directory in which Fink installed its software was still there and in that subdirectory was an old 32 bit version of ncurses. As the error message from the compile made clear, the linker was finding this outdated library and quitting because it couldn’t use it. Once I got rid of /sw everything worked fine and I know have a working Emacs 24.

None of this would be worth a post except for the fact that during my research into the problem I found several others who had the same problems. Perhaps they will find the help they need in this post once Google gets around to indexing it

Posted in Programming | Tagged | 4 Comments

Hashing Passwords

Patrick Nielsen over at Throwing Fire has an excellent post on Storing Passwords Securely that serves as a nice coda to my previous post on Password Advice. One of the problems that I pointed out in that post was the failure of Child Support Services to hash their passwords. Nielsen explains why this is a huge mistake.

More importantly and interestingly, Nielsen explains how to do the hashing correctly. He mentions most of the common libraries and their strengths and weaknesses. It turns out that doing it correctly is a lot more subtle than just running the password through MD5 and storing the result. Even the original Unix password hashing scheme did better than that: it used several iterations of a modified DES algorithm on a salted password. Today, machines are much more powerful and those involved with password cracking are building cheap, specialized machines using GPUs that can check billions of MD5 hashes per second.

Defending against all this is non-trivial and if you’re involved with securing passwords you should definitely take a look at Nielsen’s post. It’s got a lot of good advice and information.

You might also want to take a look at Poul-Henning Kamp’s article in the acmqueue on the dangers of not salting passwords and stretching hashes as illustrated by the recent LinkedIn password exploit.

Posted in Programming | Tagged | Leave a comment

Replacing a Region With the Last Kill

I learned a another neat trick from Aaron Hawley’s Giant Emacs Reference Sheet. This is another of those tricks, like the revert buffer shortcut, that uses keystrokes intended to do something else in a novel way to accomplish something unexpected.

In this case, we want to replace the current region with the last kill. Hawley says to do this with 【Ctrl+w Ctrl+y Meta+y】. This looks odd because the 【Ctrl+w】 is already a complete shortcut.

If you look at the entire sequence carefully, you see that it accomplishes the task in 3 steps:

  1. Ctrl+w】 kill the region
  2. Ctrl+y】 yank it back
  3. Meta+y】 replace the last yank with the penultimate kill

So it’s really just a matter of combining 3 commands to do something new. A very nice trick and easy to remember because it’s not really anything new.

Posted in General | Tagged | 4 Comments

A Page on Emacs 24’s New Features

Xah Lee has started a page on New Features in Emacs 24. He’s promising to add to it every few days so it might be a good place to go to get familiar with some of Emacs 24’s new goodies at a leisurely pace.

Posted in General | Tagged | 3 Comments

Muscle Memory

I can so empathize.

Posted in General | Tagged | 1 Comment

Living Without Flash

Let’s face it: Flash is a mess. Hardly a week goes by without a new exploit and its performance problems are legion. Steve Jobs famously hated Flash and refused to allow its use in iOS. My Linux distribution strongly recommends against its use every time a new version of Flash is installed. In the meantime, HTML5 is poised to replace Flash.

Now Apple has pounded another nail into Flash’s coffin. As of OS X 10.7.4, OS X will disable Flash unless you have the latest version installed. They could have just installed the latest version for you as they have in the past but apparently decided to give their users a nudge by making them consciously choose to install Flash.

I’ve long thought about disabling Flash but it always seemed to me that I’d miss out on too much content that I might want to see. Nonetheless, after the upgrade I didn’t upgrade Flash and have been running Flash-free for the last few weeks. I have to say that not only have I not missed Flash, I’ve hardly noticed it’s gone.

I’m interested in other people’s experiences. I know many folks have stopped using Flash (whether or not they’re OS X users) but I have no idea of how widespread this is. If you’ve stopped using Flash or are thinking about doing so, leave a comment with your thoughts. Likewise, if you’ve consciously decided to continue using Flash, leave a comment with your reasoning.

Posted in General | Tagged | 2 Comments

Emacs 24.1 Has Been Released

Emacs 24.1 is ready for download from the usual places. There’s all kinds of little improvements that we’ve talked about from time to time but the main features, as described by the release notice, are:

  • The new packaging system. This was available in Emacs 23 as the ELPA add on but it’s now built in.
  • Bidirectional text. Probably not a huge item for most users but if you write in Arabic or Hebrew, I’m sure this will be very welcome.
  • Lexical scope in Emacs Lisp. I’ve written about this before.
  • Improved Custom Themes system. Again, this was available as an add on in Emacs 23 but is now built in.
  • Unified and improved completion system in many modes and packages.
  • Support of GnuTLS, GTK+ 3, ImageMagicK, SELinux, and Libxml2.

Those of you using OS X who don’t want to build from source, can get the binary from Emacs For Mac OS X.

Posted in General | Tagged | Leave a comment

Emacs display-battery-mode

I have occasionally run across the Emacs display-battery-mode command—it’s in Aaron Hawley’s excellent reference sheet, for example. I never bothered really looking at it because my MacBook Pro already has an battery status icon on the menu bar. Today, out of curiosity, I played around with it a little and discovered it can actually be useful in my situation. The Mac’s battery icon can display time remaining or percentage charge but not both. I have it display time remaining because that seems the most useful to me but sometimes I click on it and ask it what percentage of the charge remains. By using battery-display-mode I get the percentage displayed in Emacs and the time on the menu bar—the best of both worlds.

Actually, the display-battery-mode command is configurable—it’s Emacs after all—so you can display pretty much whatever information you want by editing the format-like battery-mode-line-format string. If you’d like additional information about your battery status displayed or if you have a Linux system and don’t want to take up room with a battery status widget, this could be just what you need.

Posted in General | Tagged | Leave a comment

Blind Tennis

The next time you’re tempted to whine about how hard a task is; how it’s simply impossible; how obviously no one could be expected to do it: remember this. I know I will.

Posted in General | Leave a comment