Backup Fonts for Unicode Glyphs

Trey Harris posed a question on the Google+ Emacs Community that’s been bothering me for some time. I use the terrific Inconsolata as the default for monospaced fonts but many of the Unicode glyphs are missing. Mac OS X takes care of finding missing glyphs in native apps like Terminal.app or Mail.app but with Emacs I just get a missing glyph. I’ve tried various fixes over the years but nothing worked very well.

Harris suggested using the unicode-fonts package to handle this. Happily, it’s an ELPA package so I just loaded it up and added the required lines to my init.el and those missing glyphs starting appearing in Emacs. Years of frustration gone just like that.

There are still a few missing characters but the README for unicode-fonts lists a few font packages that you can load to supply most characters you’re apt to need. Even without loading the extra fonts, I’ve got almost everything I need so I haven’t bothered with them. If you’ve been having a problem with missing Unicode glyphs, give unicode-fonts a try. It’s easy to load with ELPA and if it doesn’t work for you, it’s easy to uninstall. It’s a huge win for me.

Posted in General | Tagged , | 6 Comments

Russ Cox on Debugging

There’s a new site, Debuggers, that is sort of reminiscent of The Setup. The idea is that every week (on Tuesdays) they publish a short questionnaire with a programmer asking about his or her most interesting debugging problem.

This week Russ Cox describes one of his most interesting bugs. As regular readers know, I admire Cox and his work a lot and always learn something new from his writings. Cox’s bug involves threads and locking, surely one of the most fertile grounds for bugs. What’s interesting is the way that assumptions about the locking mechanisms and manual memory management conspire to make a bug that was really hard to understand.

I’ll let Cox tell his story and only urge you to give it a read. Like me, you’ll very likely learn something.

Posted in Programming | Leave a comment

The 10 Greatest Programmers of all Time

Last week, I wrote about NetWork World’s 14 Greatest Living Programmers. This week, I’m Programmer has a list of The 10 Greatest Programmers in the World of all Time.

Lists of these sorts are always silly, of course, but nevertheless fun to read and argue about. I’m Programmer’s list is pretty noncontroversial. It starts out with DMR and ends with Knuth. Those in between are just as worthy. It’s got Thompson, Stroustrup, Gosling, Kernigham, Torvolds, and others. Each entry has a picture and short blurb of the candidates accomplishments. Best of all, it’s not a slide show.

You might possibly argue that someone more deserving was left off the list but you would, I think, be hard put to claim that anyone on the list didn’t deserve to be there. But take a look and see for yourself. Leave a comment if you disagree with the list or think someone more deserving was left off it.

Posted in General | Tagged | Leave a comment

Let’s Play Emacs Golf!

It’s been a while since Irreal has had an EmacsGolf challenge but yesterday’s post on Programming Silliness suggested a nice one. When I ran the grep, I got

A
a
aa
Ab
aba
faff
fe
fed
fee
feed

The challenge is in two parts:

  1. Rearrange the long, single column list into four columns the way it was in yesterday’s post.
  2. I was lazy in yesterday’s post and left the results sorted by rows instead of the more natural by columns. Rearrange the list so that the results are sorted by columns.
Posted in General | Tagged | Leave a comment

Programming Silliness

The other day I saw this post. Although I’m not interested in Java, I was struck by the magic number CAFEBABE that marked the beginning of the structure. That got me wondering how many words can be made with the hexadecimal digits A-F. Before you read further, ask yourself how you’d go about solving this problem.

Being a developer, my first thought was, “Well I’ll just write a quick Lisp program.” The only aspect I wasn’t sure of was whether I should use Common Lisp or Emacs Lisp. It was pretty easy to layout the general structure in either language.

Then I had that “DUH” moment when I realized I was working way too hard. The easy way to solve this problem is

grep -v [^a-fA-F] /usr/share/dict/words

which gave me the results

A a aa Ab
aba abac abaca abaff
abb Abba Abe abed
acca accede ace ad
Ada Adad adad add
Adda adda added Ade
ade adead ae aface
affa B b ba
baa Bab baba babe
bac bacaba bacca baccae
bad bade bae baff
be Bea bead beaded
bebed bed bedad bedded
bedead bedeaf Bee bee
beef C c ca
cab caba cabda Caca
cad cade caeca caffa
ce cede cee D
d da dab dabb
dabba dace dad Dada
dada dade dae daff
de dead deaf Deb
deb decad decade dee
deed deedeed deface E
e ea ebb ecad
Ecca Ed Edda edea
efface F f fa
Faba Fabaceae facade face
faced fad fade faded
fae faff fe fed
fee feed

Sadly, cafe isn’t in the system dictionary on my MacBook but the method stands.

The moral here is that we developers should remember that not every problem is a nail. Now that I think about it, this is the exact same point that I made two years ago.

Posted in Programming | Tagged | 3 Comments

SBCL 1.2.1 and Slime

A couple of weeks ago, SBCL 1.2.1 came out and as I reported at the time, although it compiled and installed correctly, there was a problem with Slime. The 1.2.1 SBCL release changed some internals that Slime relied on and as a consequence Slime wouldn’t compile.

Now Xach has released this month’s Quicklisp distribution with a new version of Slime that fixes the problem. I reinstalled SBCL 1.2.1, fired it up, and everything was fine. If you had the same problem, it’s now safe to install the latest SBCL. If for some inexplicable reason you’re not using Quicklisp, just grab the new slime from GitHub.

Even if you didn’t have the problem, it’s worth noting that the new Quicklisp distribution is available. As usual, there is lots of goodness in it.

Posted in Programming | Tagged , , | Leave a comment

Résumés with Markdown or Org-mode

Continuing with our theme of using Emacs for writing rather than coding, Mark Szepieniec and Christophe-Marie Duquesne have a couple of nice posts about writing your résumé in Markdown and then exporting it to the desired format with Pandoc.

There’s a lot to be said for this strategy. You can have a single master copy for your résumé and use it to generate whatever format is needed. The same master copy can generate a nice HTML for your Web site, a PDF for an employer that prefers a traditional format, or a Word document for employment agencies, which generally prefer that format. If you try to keep separate copies for each of these different formats, errors are sure to creep in and some formats will have the latest updates missing.

Both these posts discuss using Markdown for your master copy but exactly the same strategy works for Org-mode. You might not even need Pandoc with Org-mode because of Org’s powerful export engine. Either way, I think the Markdown/Org-mode method is the winning strategy. You have a single, portable source for your resume that can be exported to just about any desired format. One thing for sure, it’s a lot better than using Word or one of its demonic spawn. It’s also better, I submit, than writing it in TeX or LaTeX for many of the same reasons.

Posted in General | Tagged | 2 Comments

Creative Writing with Emacs

Like many (most?) Emacs users, I do all my writing with Emacs. This mostly involves Org-mode but even when it doesn’t I’m still in some sort of Emacs buffer. I just came across this old Stack Exchange post asking about Emacs configurations for creative writing.

If you’re looking for an excellent writing tool, you should check out this thread. Also be sure to follow the link to Randall Wood’s Woodnotes Guide to Emacs for Writers. It covers those aspects of Emacs most likely to be useful to writers. Wood doesn’t consider coding at all, only creative writing.

I know many writers like tools such as Scrivener for organizing their writing. While I’ve never used any of those special tools—let alone the horror that is Word—I find it hard to believe that an appropriately configured Emacs is not equally good or better. One of the nice things about writing with Emacs and Org-mode or Markdown is that you can export to Word format with Pandoc or Org’s export engine. That’s really handy because you can write with a decent editor and still provide your publisher with the Word document that most publishers insist upon.

It’s an interesting thread. If you do any writing, especially creative writing, you should check it out.

Update: Randal → Randall

Posted in General | Tagged | 6 Comments

Xah’s JavaScript Tutorial

Many of us have benefited from Xah Lee’s Emacs Lisp tutorial. I found it very useful for learning the Elisp library and idioms. Now Lee has put together a JavaScript tutorial.

When I was learning Elisp, I had the advantage of already being familiar with Common Lisp and Scheme so I understood the Lisp parts. It was just the Elisp specific bits that I needed help with. In the case of JavaScript, I’m a complete novice as I don’t know the language at all. It’s enough like C that I can get a general idea what a simple program is doing but I certainly couldn’t write in JavaScript or even understand anything harder than a toy program.

That makes me a perfect test case for Lee’s tutorial. I’ve gone through the first section (8 lessons) and learned a lot. I don’t have much interest in writing large JavaScript programs but I would like to have enough facility that I can read and understand others’ work and write my own (possibly simple) programs when necessary.

It’s still too early for me to say I’ve reached that goal but I do understand some of the things that confused when I looked at JavaScript scripts before. If you’ve been wanting to learn JavaScript, Lee’s tutorial is an easy way. You can go through a lesson or two a day in just a few minutes so it doesn’t require a large time commitment. Perhaps I’ll write a followup post after I finish the tutorial. In the meantime, I’m enjoying it and learning a bit of JavaScript.

Posted in Programming | Tagged | 1 Comment

14 Great Programmers

Over at NetworkWorld they have an interesting article featuring the 14 greatest living programmers. I was a bit surprised that DMR wasn’t on the list but then I remembered the part about living. Also, oddly, you and I aren’t on it either.

The latter shocking omissions aside, I think you’ll agree that the 14 are world class engineers. Perhaps your favorite isn’t there but by and large it’s a good list. My only complaint is that the article is in the form of one of those obnoxious slide shows designed to maximize ad impressions.

Definitely worth a glimpse.

Posted in General | Tagged | Leave a comment