Pretty Emacs

Update: If you are using Ubuntu 8.04 LTS “Hardy Heron” or Ubuntu 8.10 “Intrepid Ibex”, use the packages in the PPA of the Ubuntu Emacs Lisp team, instead of the packages referenced here. For Ubuntu 9.04 “Jaunty Jackalope” and newer, use the packages in Ubuntu repositories.

Emacs is my editor of choice. In fact, I should say it’s my framework of choice, but that’s for another post. Until recently, I disliked the poor font backend of Emacs. So, I was always using Emacs within a terminal window to get a decent looking interface. However, this grungy font era is over, since Emacs’s hackers added recently to my favorite editor a XFont backend, thus making possible to use good looking fonts, like Bitstream Vera Sans Mono.

Screenshot of Emacs with XFT support

I made a package that makes the installation, as painless as possible. So, feel free to use it. However, please note that this is an alpha release of Emacs, therefore it should only be used for testing. (From my experience, it’s rock solid.)

Still interested? Then, here the instructions. First, add my repository into your software source list, by adding the following lines to /etc/apt/sources.list:

deb feisty main
deb-src feisty main

If you are running Ubuntu 6.10 (Edgy Eft) or the current development version of Ubuntu (Gutsy Gibbon), change feisty for edgy or gutsy.

Finally, run either apt-get or aptitude to fetch and install the packages:

sudo aptitude update
sudo aptitude install emacs-snapshot emacs-snapshot-el

Now, you need to specify the font you want to use in your Xresources file.

echo "Emacs.font: Monospace-10" >> ~/.Xresources
xrdb -merge ~/.Xresources

Here, I use the default monospace font, but any other monospaced font should work too. For example, if you want to use Lucida Sans Typewriter instead, change Monospace-10 for Lucida Sans Typewriter-10 in the above command.

And that’s it! Now, launch Emacs and enjoy the good looking fonts.

If you need support with the package, just email me at

Update: Il y a, maintenant, une version en français de ce guide sur le wiki de Ubuntu-fr.

· RSS feed for comments on this post


  1. Benjamin Hawkes-Lewis said,

    January 18, 2007 @ 3:55 am

    Thanks very much for these pretty packages! Much easier on the eyes.

    But is there any chance you could detail how you modify and build a snapshot package? (I’d like to add a patch of my own to make the Emacs toolbar work with Ubuntu-themed PNG icons.) Even without applying any patch, every time I try to build your source package with “fakeroot dpkg-buildpackage” (or variations thereof) “make” fails with the following error:

    sed -n '/^[^;]/ p' <  build/emacsbuild/emacs-snapshot-20070401/leim/leim-ext.el >> leim-list.el
    make[2]: Leaving directory `/build/emacsbuild/emacs-snapshot-20070401/leim'
    make[1]: Leaving directory `/build/emacsbuild/emacs-snapshot-20070401'
    Check for pure space overflow
    src/emacs -batch --eval "(print pure-space-overflow)" 2>/dev/null | grep -qx nil
    make: *** [emacs-stamp] Error 1

    Google didn’t turn up much, unfortunately.

    PS I can see you’re trying to keep your blog design clean (and very nice it is too). But it would still be enormously useful to have some guidance about what sort of special characters, markup, or markdown should be employed in comment boxes. It’s particularly worrying when it comes to entering code or sample output, which often contain characters that need to be escaped.

  2. Alexandre said,

    January 20, 2007 @ 12:10 am

    I am not sure what is the cause of that error. I just tested it and the built went perfectly fine. However, I did found some executables remaining in my source tarball (Oops). Although, it very unlikely that is the cause of the error.

    If you want, I wouldn’t mind to host your package in my repository. Just e-mail me your patch and I will build it for you.

  3. leslie said,

    January 20, 2007 @ 1:03 am

    Looks great, thanks!


  4. sony-B said,

    January 20, 2007 @ 1:31 pm

    Thank you so much for this.

    I am trying to use your .emacs file for the color-themes but I can’t find the following folders on your subversion repository:


    Could you please let me have that folder also. Thank you,


  5. Alexandre said,

    January 20, 2007 @ 4:15 pm

    I am trying to use your .emacs file for the color-themes but I can’t find the following folders on your subversion repository:


    I use the emacs-goodies-el package on Ubuntu to get color-theme, now.

    You can install it with: sudo aptitude install emacs-goodies-el

    Alternatively, you could download it with: cvs co color-theme

  6. Luc said,

    January 21, 2007 @ 12:17 pm

    Thank you for the prompt response Alexandre. That worked out great.


  7. Benjamin Hawkes-Lewis said,

    January 24, 2007 @ 9:25 am

    Details about the patch can be found at:

  8. Paul Oliver said,

    January 27, 2007 @ 5:03 pm

    Thanks for providing this version, Alexandre! Keep up the great work.

  9. Paul Oliver said,

    January 28, 2007 @ 5:50 pm

    BTW: I found that putting:

    Xft.hinting: 1

    In .Xresources made the display even better.

  10. howie said,

    January 29, 2007 @ 3:26 pm

    I get the message:

    No fonts match `Monospace-13′

    Could there be some packages missing? I have it in my Fonts preferences, though…

  11. howie said,

    January 29, 2007 @ 5:15 pm

    Found out: I had to run emacs-snapshot-gtk instead of emacs.

    Thanks for the package!

  12. david gibbs said,

    January 31, 2007 @ 1:40 am

    Thank you so much! It’s wonderful!

    I’m running it in edgy. Seems to be fine. One odd thing: when I change Monospace-13 to Monospace-8 in my .Xresources file, nothing changes in emacs… any ideas?

    Thanks again, dave

  13. Alexandre said,

    January 31, 2007 @ 8:32 am

    David, you probably need to reload the Xresources file with:

    xrdb -merge ~/.Xresources

    If that doesn’t work, then I ain’t sure what could be causing the problem.

  14. » Blog Archive » Tab dump // 20070205 said,

    February 5, 2007 @ 8:25 am

    [...] pretty emacs. Must do. [...]

  15. Mario said,

    February 6, 2007 @ 5:17 pm

    Is there a way I can use the stuff you have to create a dapper package. For whatever reasons, I am limited to using dapper at work, although I experimented with edgy and I loved your package (I had been trying to get emacs-xft running and it was never this beautiful).

  16. Alexandre said,

    February 6, 2007 @ 5:33 pm

    Mario, I am currently making a backport for Dapper. It should be out by the end of the week. Stay tuned!

  17. Daniel said,

    February 7, 2007 @ 3:15 pm

    Alexandre, thanks for your great work! The packages work flawlessly.

  18. Mario said,

    February 10, 2007 @ 3:42 pm

    Thanks, Alexandre! Will be waiting patiently :-)

  19. Mario said,

    February 10, 2007 @ 4:58 pm

    Awesome. Thank you for the dapper packages, using them now.

  20. Tyler Oderkirk’s Blog » Blog Archive » emacs-snapshot-gtk emacsclient and Using Ediff for Regions said,

    February 11, 2007 @ 12:42 pm

    [...] If you’re using the emacs-snapshot-gtk package (I use the one from Alexandre’s repository) and you want to use emacsclient, make sure you use the version that it supplies at /usr/bin/emacsclient.emacs-snapshot. If you just run emacsclient, it might confusingly say emacsclient: can’t stat /tmp/esrv1000-yourhost: Success [...]

  21. Dennis said,

    February 11, 2007 @ 7:11 pm

    Any possibility of creating a x64 package in your repository?

  22. Alexandre said,

    February 11, 2007 @ 7:32 pm

    Dennis, maybe. I got an AMD Athlon64, so I could compile it. However, it would require, from my part, some extra work (eg. installing an amd64 kernel and rebooting every time for compiling the package). If I get more requests, I will probably start to support it too.

  23. Pierre Radermecker said,

    February 13, 2007 @ 4:54 pm

    I am using edgy. I cannot get rid of the message : No fonts match `Monospace-13′

    If I remove .Xresources the line “Emacs.font: Monospace-13″ then it is fine but the editor font is ugly.

    I have checked my xorg.conf file, it seems fine : FontPath “/usr/share/fonts/X11″ FontPath “/usr/share/fonts/truetype” FontPath “/usr/share/fonts/X11/misc” FontPath “/usr/share/fonts/X11/cyrillic” FontPath “/usr/share/fonts/X11/100dpi/:unscaled” FontPath “/usr/share/fonts/X11/75dpi/:unscaled” FontPath “/usr/share/fonts/X11/Type1″ FontPath “/usr/share/fonts/X11/100dpi” FontPath “/usr/share/fonts/X11/75dpi” FontPath “/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType”

    I have tried to refresh the font cache. All the fonts seems to be there. Where Emacs expects these fonts to be ?

    Thanks for your help.

  24. Alexandre said,

    February 13, 2007 @ 6:44 pm

    Pierre, you probably either installed the wrong package — make sure you installed emacs-snapshot-gtk — or you are running a version of Emacs that was previously installed. Try to start Emacs from the command line with:

    $ emacs-snapshot-gtk

    If that doesn’t work, I will investigate the problem further.

  25. Pierre Radermecker said,

    February 14, 2007 @ 9:54 am

    Indeed the installed version was the wrong one. I re-installed yours. It works fine. Thanks so much.

  26. Conrad Nagy said,

    February 16, 2007 @ 2:27 am

    Any chance of making a 64bit version?

  27. Dierk said,

    February 18, 2007 @ 7:55 am

    Thanks for your efforts, I really like the new look of emacs. But unfortunately I have a problem: I cannot enter german “umlaute” (ö,ü,…) anymore. Typing them only displays rectangles, typing them after starting emacs via “emacs -nw” produces a segmentation fault. Can someone help?

  28. Alexandre said,

    February 18, 2007 @ 11:13 am

    Dierk, this version of Emacs supports Unicode input, at least it’s supposed to. The trick is to use the C-x 8 key sequences, instead of the usual compose-key. For example, for ‘ü’ you type C-x 8 " u. To see all the non-ascii characters you can type with C-x 8 prefix, type C-x 8 C-h.

  29. Istvan Hoka said,

    February 20, 2007 @ 1:39 am

    What is the color theme you are using in the screenshot?

  30. Kristian R said,

    February 20, 2007 @ 3:27 pm

    Using Dapper, work flawless :) Thank you so much!

  31. Alexandre said,

    February 20, 2007 @ 7:42 pm

    Istvan, it’s a custom color theme I made myself. You can find it in the Subversion repository of my Emacs configuration.

  32. Daniel W said,

    February 21, 2007 @ 5:35 pm

    It’s working great on kubuntu dapper! Thanks!

    At first the colours weren’t working properly (there was a different background colour when there was no text), but setting up kde as described on the emacswiki fixed everything.

  33. sfp said,

    February 23, 2007 @ 1:02 pm

    Thanks for the packages!

    Do you know how I can generate a package that contains the debug symbols? I’ve got a repeatable segfault and I’d like to get a meaningful backtrace using gdb.


  34. Alexandre said,

    February 23, 2007 @ 10:24 pm

    sfp, the packages are compiled with the debug symbols, but stripped just before building the archive. Therefore, you just need to comment out dh_strip -a in debian/rules.

    Here a quick & dumb build guide:

    1. Download the source package:

      apt-get source emacs-snapshot
      cd emacs-snapshot*
    2. Open the package build rules for editing:

      emacs debian/rules
    3. Edit to disable stripping:

      M-x replace-regexp \\(dh_strip\\) RET # \\1 RET ! C-x C-c
    4. Install the build-dependencies and some packaging tools:

      sudo apt-get build-dep emacs-snapshot
      sudo apt-get install devscripts fakeroot
    5. Build the package (take about 30-60 minutes):

      debuild -rfakeroot

    Hopefully, it should work has intended, but I may have forgotten something. Also, keep in mind that Emacs is linked to libraries which are stripped, so you will still see some (no debugging symbols found) message from gdb. Really the best way would to checkout Emacs from the upstream CVS repository, compile and then test. The instructions to do so are on the EmacsWiki.

  35. 逸·Ease said,

    February 26, 2007 @ 5:03 pm

    A Beautiful Emacs…

    I’ve written 2 posts about emacs last week, but after they were finished, I found something more to improve. So I deleted the previous two and summarized all the pieces of tips mainly for Xft font configuration here as one post.

    Install Emacs…

  36. Karim Dibba n said,

    February 27, 2007 @ 1:54 am

    I did the install as per your guideline but it always tell me that ‘no match for monospace 13 found’ Can you kindly help…. Below is the error message..

    dibson@TTUnet:~$ cat .Xresources
    Emacs.FontBackend: xft
    Emacs.font: Monospace-13
    Xft.dpi: 96
    Xft.hinting: None
    dibson@TTUnet:~$ xrdb -merge ~/.Xresources
    dibson@TTUnet:~$ emacs
    No fonts match `Monospace-13'
    dibson@TTUnet:~$ emacs-snapshot-gtk
    No fonts match `Monospace-13'
  37. tibbe said,

    March 2, 2007 @ 4:43 am

    For some reason, this build (on dapper) breaks python syntax color highlighting if the source file contains a \”\”\” string. The same file works correctly in standard ubuntu emacs.

  38. Alexandre said,

    March 2, 2007 @ 11:22 am

    Yes, tibbe. I am well aware of this problem. The simple solution is to use the Python mode that comes with Emacs, instead the one the Python project maintains.

  39. Alexandre said,

    March 2, 2007 @ 11:50 am

    Karim, makes sure you installed the package from my reposistory. You are probably still using the package from Ubuntu repository, which doesn’t have the capability to load FreeType fonts.

  40. Victor Rodriguez said,

    March 2, 2007 @ 11:10 pm

    Thank you very much!

    Now, does anyone know how to get this working on RHEL? Now that I seen it work, I can’t go back!

  41. Arve said,

    March 5, 2007 @ 1:50 pm

    After installing this package, the only font I ever get is some proportional font — it doesn’t use the font specified in .XResources, and setting a font from within emacs does not help either.

    Any clues as to what’s wrong?

  42. Alexandre said,

    March 5, 2007 @ 5:01 pm

    Arve, have you closely followed the instructions? If the proportional fonts you got are anti-aliased, then you’re on the right path. Try to rename .XResources to .Xresources; run xrdb -merge .Xresources; and then launch emacs-snapshot-gtk from the command line. If that doesn’t fix the problem, post your .Xresources file and any error message you get.

  43. Arve said,

    March 6, 2007 @ 11:40 am

    Alexandre: The problem seems to have been fixed. What exactly got fixed, I don’t know, but I did two things:

    1. I removed any trace of emacs sitting on my system
    2. Installed just the packages suggested, for some reason emacs-snapshot was among the other packages I had installed
    3. My .Xresources (which was named correctly) was lacking a trailing newline.

    Now it works, and I have pretty fonts in Emacs too. Thank you so much.

  44. Victor Rodriguez said,

    March 6, 2007 @ 1:07 pm

    On the RHEL system I have compiled the emacs-unicode-2 branch and it kind of works, but some faces do not use the font specified in .Xresources. On my Ubuntu system with your package, this is not a problem.

    Would you have some insight as to what is the problem and how to fix it?


    Victor R.

  45. Alexandre said,

    March 6, 2007 @ 2:49 pm

    Victor, maybe you forgot to enable an compile-time option. Try to compile Emacs with these configure options:

    $ ./configure  --with-gtk \
                   --enable-font-backend \
                   --with-xft \
  46. tibbe said,

    March 7, 2007 @ 10:43 am

    Alexandre, if I can’t use the Emacs python mode but need to use the Python project one for other reasons is there a way to hack around this? Is it specific to this build or XFT rendering in general?

  47. HuMin said,

    March 7, 2007 @ 10:49 am

    Hi, Alexandre.

    As a Kubuntu user, I’ve switched to Emacs 23a from Vim 7.0 for a couple of months. The new features of Emacs23a, like better UNICODE support and XFT things, are really amazing.

    I really like the color theme you posted here. It looks great in python-mode. Good Job.

  48. Alexandre said,

    March 7, 2007 @ 5:44 pm

    tibbe, I patched python-mode in my configuration, so that triple-quoted strings are handled correctly. Just checkout with Subversion my python-mode with:

    svn co

    The patch came from python-mode’s tracker on SourceForge.

  49. HuMin said,

    March 7, 2007 @ 11:00 pm

    I noticed some details of your windows decoration.

    Do you use beryl? thx

  50. Alexandre said,

    March 8, 2007 @ 1:10 am

    HuMin, no. This is actually Metacity, the default window manager of GNOME. The theme is a mix — LegacyHuman’s window border with Silicon’s controls. Both are installed, by default, in Ubuntu.

  51. Dias said,

    March 13, 2007 @ 3:16 am

    Has the repository changed/moved/down? When “sudo apt-get update”, I get the “failed to fetch” messages:

    Failed to fetch  302 Moved
    Failed to fetch 302 Moved

    I would like to update the edgy packages for Xft goodness., pretty emacs.

  52. Jacek said,

    March 14, 2007 @ 6:28 am


    Your pretty emacs is great! Thanks!

    BUT ;) I have an ugly menu font and I cannot change it. Any ideas? I have ubuntu 6.10, emacs and emacs-snapshot-gtk (from your site). I am using the Xfce environment I tried the following .Xresources menu-related entries (with no success): Emacs.pane.menubar*font: Monospace-10*.font: -*-bitstream vera I did remember to put a LF at the end of file, reload Xresources after every change etc.

    BTW: Regular emacs also has an ugly menu font, it looks different, but I guess it is the same font, but rendered differently



  53. Bjørn said,

    March 14, 2007 @ 6:58 pm

    Thanks for providing the packages. I never managed to get this stuff working for myself, so I’ve been waiting (for ages) for someone to properly package this version of emacs. And you’re the man !


  54. Alexandre Vassalotti » Bad luck said,

    March 16, 2007 @ 5:43 pm

    [...] I just wanted to notice the users of my Emacs package that I won’t be able to update it, until I get my system back [...]

  55. Andrew Goodnough said,

    March 17, 2007 @ 9:36 pm

    Worked great! This was a thorn in my side. Thanks.

  56. Stefan Schwarzburg said,

    March 23, 2007 @ 5:20 am

    Hi, Thanks for the package! I have a question: when I start “normal” emacs with a filename: “emacs some_dir/some_file.txt” it will open that file. If I do this with “emacs-snapshot-gtk some_dir/some_file.txt” it will not open that file, although emacs will be in “some_dir” as the working directory. How can I change this behaviour to the “normal” one?

  57. Alexandre said,

    March 23, 2007 @ 3:09 pm

    Stefan, any Emacs versions should have, as you call it, the “normal” behavior. Please check your configuration and try run Emacs with the -Q flag (e.g. emacs -Q some_dir/some_file.txt). If this doesn’t fix the problem, I recommend you to send a bug report to GNU about it.

  58. Stefan Schwarzburg said,

    March 25, 2007 @ 11:35 am

    Thanks, that seems to be my fault. It works with -Q and so it seems to be something in my config file. I will check this. Thanks.

  59. manuel said,

    March 27, 2007 @ 10:49 am

    Thanks! It worked perfectly under Beryl, as well

  60. Ross Laird said,

    March 29, 2007 @ 12:23 pm

    Thanks very much for making this emacs package. I have tried various strategies to get the antialiasing to work (as have many others in the ubuntu forums) and yours is the first method that has worked flawlessly on my system.

    Merci beaucoup.

    Ross Laird Vancouver

  61. Emacs bonitinho « Power On said,

    March 30, 2007 @ 7:02 am

    [...] de descobrir aqui um tutorial para deixar o emacs com um aspecto mais [...]

  62. Tony said,

    March 30, 2007 @ 9:09 pm

    Thanks very much for the package. However, I found that I can’t have black background anymore. For example, color-theme-white-on-black in my .emacs file only gives me white background. Any idea? Thanks.

  63. Enrique said,

    April 2, 2007 @ 2:18 am

    Thank you for the effort put into this, it looks great! I had always been put off by emacs’ font support, until now.

    Keep up the good work.

  64. Alexandre said,

    April 2, 2007 @ 7:51 am

    Tony, you can have a black background — just look at my screenshot. You probably have a mistake in your color theme definition. Here an example of configuration:

    (defun my-color-theme ()
         ((background-color . "black")
          (foreground-color . "white")
          (cursor-color . "white")
          (mouse-color . "white")
          (background-mode . dark)))))
  65. olive22 said,

    April 2, 2007 @ 3:16 pm

    Thanks for these packages !

    Works fine on a current Feisty install.

  66. Pretty GNU Emacs with XFT goodness » Akshay Surve said,

    April 5, 2007 @ 11:56 am

    [...] to like it and now I can say that I am an Emacs addict. A week back I stumbled upon this article Pretty Emacs while search for some popular themes for Emacs. I tried installing Emacs from the repositories but [...]

  67. Alexandre Vassalotti » Back in Business said,

    April 6, 2007 @ 4:13 pm

    [...] the fans my Emacs package, I just uploaded a new release, and I will continue to provide weekly releases. Unfortunately, it [...]

  68. Paulo J. S. Silva said,

    April 7, 2007 @ 10:42 am

    Thanks for the package.

    However, it doesn’t seem to play well with aspell with some languages that have accented characters. I have problems with my native language (Portuguese) using the brasileiro or the portugues dictionaries. It looks like the problem is that the aspell dicitionary is in iso-latin-1 and the text files are in utf-8. I am running feisty beta.

    Emacs 21 works well with these dictionaries, but it uses special spell.el, flyspell.el, and debian-spell.el files from the dictionaries-common package that refuse to compile for emacs-snapshot (it says: install/dictionaries-common: Skipping byte-compilation for emacs-snapshot, while installing).

    Any hints on how to get spell working?

  69. apfan said,

    April 8, 2007 @ 3:35 pm

    Can I have your theme.el file that is seen here: Also, how do I load from my .emacs?

    Nice work!

  70. apfan said,

    April 8, 2007 @ 4:19 pm

    Forget about the theme.el :) Couldn’t you write a blog post about how to configure emacs the way you do? That will spare you from us bugging you :)

  71. Jeff Kowalczyk said,

    April 9, 2007 @ 8:35 pm

    Pardon the silly question, but is this post describing a patched XEmacs, or emacs that has some compiled-in GTK emulation of a terminal host, freeing it to run as XEmacs does, outside a gnome-terminal session?


  72. Alexandre said,

    April 9, 2007 @ 8:49 pm

    Apfan, my theme.el is, here, in my Emacs configuration repository. Just look at emacs.el, to know how to use it.

    Jeff, this the GTK version of GNU Emacs, compiled with XFont and Unicode support.

  73. » Aprendiendo Lisp said,

    July 8, 2007 @ 6:03 pm

    [...] veía mejor. Bien, siempre hay soluciones. Buscando en Google “pretty emacs”, encontré esta página, donde se explica cómo instalar una versión de Emacs más reciente, compilada para que haga un [...]

  74. Emacs tips « baysao’s blog said,

    July 10, 2007 @ 4:08 pm

    [...] Emacs snapshort v. for [...]

  75. » Blog Archive » Pretty Emacs = Emacs mit aliased Fonts said,

    September 8, 2007 @ 4:54 am

    [...] hier wird gezeigt, wie schön Emacs mit aliased Fonts aussehen würde… – btw.: CarbonEmacs und [...]

  76. awesome radtastic ninjacore! » Blog Archive » It’s a Gibbon said,

    September 9, 2007 @ 7:07 pm

    [...] pretty Emacs has also stopped working, but that’s to be expected. It’s a third-party package that [...]

  77. pk stuff » Emacs Pretty Fonts on Feisty said,

    October 8, 2007 @ 2:54 pm

    [...] To dramatically improve the look of GNU emacs under X on Feisty, take a look here. [...]

  78. Understanding » Blog Archive » Installing Emacs with Hinted Fonts on Gobuntu said,

    October 15, 2007 @ 6:15 pm

    [...] to the most excellent Alexandre Vassalotti, Emacs is available with hinting for all version of Ubuntu, including Gobuntu. It can be installed [...]