<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>oscarbonilla.com &#187; Emacs</title>
	<atom:link href="http://oscarbonilla.com/tag/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://oscarbonilla.com</link>
	<description></description>
	<lastBuildDate>Mon, 26 Jul 2010 21:25:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Beautiful Emacs (Windows Edition)</title>
		<link>http://oscarbonilla.com/2008/01/beautiful-emacs-windows-edition/</link>
		<comments>http://oscarbonilla.com/2008/01/beautiful-emacs-windows-edition/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 00:03:01 +0000</pubDate>
		<dc:creator>ob</dc:creator>
				<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://blog.oscarbonilla.com/2008/01/04/beautiful-emacs-windows-edition/</guid>
		<description><![CDATA[After fixing the font on my Carbon Emacs on Mac OS X, I'm spoiled with good fonts. Today I had to work on Windows and naturally, the only way to make Windows liveable is to work inside Emacs. This is what a default installation of EmacsW32 looks like. Oh horror! You guys are kidding, right? [...]]]></description>
			<content:encoded><![CDATA[<p>After <a href="http://blog.oscarbonilla.com/2007/12/05/beautiful-emacs/">fixing the font</a> on my <a href="http://homepage.mac.com/zenitani/emacs-e.html">Carbon Emacs</a> on Mac OS X, I'm spoiled with good fonts. Today I had to work on Windows and naturally, the only way to make Windows liveable is to work inside Emacs.</p>
<p>This is what a default installation of <a href="http://www.ourcomments.org/Emacs/EmacsW32.html">EmacsW32</a> looks like.</p>
<p><a href='http://blog.oscarbonilla.com/wp-content/uploads/2008/01/emacsw32-courier.png' class="lightview" rel="gallery[43]" title='EmacsW32 Courier'><img src='http://blog.oscarbonilla.com/wp-content/uploads/2008/01/emacsw32-courier.png' alt='EmacsW32 Courier' /></a></p>
<p>Oh horror! You guys are kidding, right? Courier? Seriously?</p>
<p>Naturally, my first inclination was to use <a href="http://www.levien.com/type/myfonts/inconsolata.html">Inconsolata</a> again. Just like in Mac OS X. However, this is what Inconsolata looks like.</p>
<p><a href='http://blog.oscarbonilla.com/wp-content/uploads/2008/01/emacsw32-inconsolata.png' class="lightview" rel="gallery[43]" title='Emacs W32 Inconsolata'><img src='http://blog.oscarbonilla.com/wp-content/uploads/2008/01/emacsw32-inconsolata.png' alt='Emacs W32 Inconsolata' /></a></p>
<p>WTF? What's with all the blurred text? Well, it turns out that <a href="http://antigrain.com/research/font_rasterization/">anti-aliasing and text rasterization differ significantly</a> between Mac OS X and Windows. Oh well. Scratch that plan.</p>
<p>Then I remembered that Incosolata is actually based on <a href="http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3">Consolas</a>, which is a font Microsoft created specifically for programming.</p>
<p>I downloaded and installed Consolas, and voil&agrave;! Beautiful Emacs once again.</p>
<p><a href='http://blog.oscarbonilla.com/wp-content/uploads/2008/01/emacsw32-consolas.png' class="lightview" rel="gallery[43]" title='EmacsW32 Consolas'><img src='http://blog.oscarbonilla.com/wp-content/uploads/2008/01/emacsw32-consolas.png' alt='EmacsW32 Consolas' /></a></p>
<p>Now it was just a matter of figuring out what the font was called. I had changed the font by clicking on the Emacs frame and pressing the shift key. In order to see what that does, I ran the <code>describe-key</code> function by typing <code>C-h k</code>, then clicking on the frame while holding the shift key. That told me the function that is called is <code>mouse-set-font</code> and it's defined in <code>c:/Program Files/Emacs/emacs/lisp/term/w32-win.elc</code>. You can click on the file link and Emacs will take you to the function definition.</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> mouse-set-font <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&amp;</span>rest fonts<span style="color: #66cc66;">&#41;</span>
  <span style="color: #ff0000;">&quot;Select an Emacs font from a list of known good fonts and fontsets.
&nbsp;
If `w32-use-w32-font-dialog' is non-nil (the default), use the Windows
font dialog to display the list of possible fonts.  Otherwise use a
pop-up menu (like Emacs does on other platforms) initialized with
the fonts in `w32-fixed-font-alist'.
If `w32-list-proportional-fonts' is non-nil, add proportional fonts
to the list in the font selection dialog (the fonts listed by the
pop-up menu are unaffected by `w32-list-proportional-fonts').&quot;</span>
  <span style="color: #66cc66;">&#40;</span>interactive
   <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> w32-use-w32-font-dialog
       <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>chosen-font <span style="color: #66cc66;">&#40;</span>w32-select-font <span style="color: #66cc66;">&#40;</span>selected-frame<span style="color: #66cc66;">&#41;</span>
					   w32-list-proportional-fonts<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	 <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">and</span> chosen-font <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">list</span> chosen-font<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
     <span style="color: #66cc66;">&#40;</span>x-popup-menu
      last-nonmenu-event
      <span style="color: #808080; font-style: italic;">;; Append list of fontsets currently defined.</span>
      <span style="color: #808080; font-style: italic;">;; Conditional on new-fontset so bootstrapping works on non-GUI compiles</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>fboundp 'new-fontset<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">append</span> w32-fixed-font-alist <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">list</span> <span style="color: #66cc66;">&#40;</span>generate-fontset-menu<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> fonts
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span>font<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>while fonts
	  <span style="color: #66cc66;">&#40;</span>condition-<span style="color: #b1b100;">case</span> <span style="color: #b1b100;">nil</span>
	      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">progn</span>
                <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> font <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">car</span> fonts<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#40;</span>set-default-font font<span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> fonts <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">error</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> fonts <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cdr</span> fonts<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">null</span> font<span style="color: #66cc66;">&#41;</span>
	    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">error</span> <span style="color: #ff0000;">&quot;Font not found&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Now, I don't know what all of that does, but it seems like <code>(set-default-font font)</code> is the one function that actually sets the font. In order to figure out what the font is called, I copied all of the function to the good old <code>*scratch*</code> buffer, and added a call to <code>(message font)</code> right after the call to <code>(set-default-font font)</code>. Then I redefined the function by typing <code>C-x C-e</code> at the end of it. After shift clicking on the frame again and selecting the Consolas font I had all the information I needed.</p>
<p>Now it was just a matter of putting the following snippet in my <code>.emacs</code> file:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;">    <span style="color: #66cc66;">&#40;</span>set-default-font
     <span style="color: #ff0000;">&quot;-outline-Consolas-normal-r-normal-normal-14-97-96-96-c-*-iso8859-1&quot;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Ahh... I feel so much better now... now what was I doing in Windows again?</p>
]]></content:encoded>
			<wfw:commentRss>http://oscarbonilla.com/2008/01/beautiful-emacs-windows-edition/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Lazy-loading emacs functionality</title>
		<link>http://oscarbonilla.com/2008/01/lazy-loading-emacs-functionality/</link>
		<comments>http://oscarbonilla.com/2008/01/lazy-loading-emacs-functionality/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 05:05:20 +0000</pubDate>
		<dc:creator>ob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://blog.oscarbonilla.com/2008/01/02/lazy-loading-emacs-functionality/</guid>
		<description><![CDATA[Quick, how big is your .emacs file? How long does it take emacs to load? A few days ago I found that my .emacs file had slowly grown to the point where it was taking emacs a significant amount of time to load. Something needed to be done. A quick glance at the file told [...]]]></description>
			<content:encoded><![CDATA[<p>Quick, how big is your <code>.emacs</code> file? How long does it take emacs to load? A few days ago I found that my <code>.emacs</code> file had slowly grown to the point where it was taking emacs a significant amount of time to load. Something needed to be done.</p>
<p>A quick glance at the file told me I was loading a lot of modules that I seldom use. For instance, I occasionally write some code in Common Lisp or Haskell, so naturally I was loading <a href="http://common-lisp.net/project/slime/">slime</a> and the <a href="http://www.haskell.org/haskell-mode/">haskell</a> environment. I commented those out.</p>
<p>However, after commenting them out, I quickly realized that not loading them was problematic. When I wanted to use them, I had to open my <code>.emacs</code> file, uncomment the relevant portion,  and <code>M-x eval-region</code> the code.</p>
<p>Then it occurred to me that I had a clear entry point for some of these modules. When I write Common Lisp, I usually start by loading SLIME's REPL by running <code>M-x slime</code>. I came up with the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> slime <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>interactive<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'load-path <span style="color: #ff0000;">&quot;~/emacs/slime&quot;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> inferior-lisp-program <span style="color: #ff0000;">&quot;/usr/local/bin/sbcl&quot;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>require 'slime<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>slime-setup<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>slime<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Which basically sets up my slime environment and then loads slime. Note that the <code>slime</code> function itself is redefined as part of the evaluation of <code>(require 'slime)</code>, so although this looks like a recursive call, it's not.</p>
<p>I've used this trick in several other cases and I think it's kind of neat. It helps me keep Emacs loading fast, but I still have all the bells and whistles available.</p>
]]></content:encoded>
			<wfw:commentRss>http://oscarbonilla.com/2008/01/lazy-loading-emacs-functionality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vive la différence</title>
		<link>http://oscarbonilla.com/2007/12/vive-la-difference/</link>
		<comments>http://oscarbonilla.com/2007/12/vive-la-difference/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 15:02:09 +0000</pubDate>
		<dc:creator>ob</dc:creator>
				<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://blog.oscarbonilla.com/?p=31</guid>
		<description><![CDATA[One of the more useful programs in the developer's toolkit is diff. This little utility compares two files and gives you just the differences (what changed) between them. Evey version control system in the world is ultimately based on diffs. One way I commonly use it, is to see what I've changed in a file [...]]]></description>
			<content:encoded><![CDATA[<p>One of the more useful programs in the developer's toolkit is <code>diff</code>. This little utility compares two files and gives you just the differences (what changed) between them. Evey version control system in the world is ultimately based on diffs.</p>
<p>One way I commonly use it, is to see what I've changed in a file or a set of files. Let me clarify. I put <strong>everything</strong> in version control. Even tiny little programs that I'm tempted to throw away are in version control. Being able to use diff between my modified file and the previous version is a major reason for doing so.</p>
<p>Now, if I told you to quit your editor and run <code>diff</code> in a terminal, I wouldn't be surprised if you decided to beat me with a clue stick. <em>You should <strong>NEVER</strong> leave your editor</em>. If you do, you don't know how to use your editor, or your editor is not powerful enough. If your problem is the latter, you should switch to <a href="http://www.gnu.org/software/emacs/">Emacs</a> right now. Otherwise, keep reading, I can help you.</p>
<p>Depending on what version control system you use, you should modify the commands given below. I use <a hrefame="http://www.bitkeeper.com">BitKeeper</a> (well, duh!), so all my examples will use that one.</p>
<p>To start with, stick this in your <code>.emacs</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> bk-diffs <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #ff0000;">&quot;Get diffs between current edited buffer and checked in revision&quot;</span>
  <span style="color: #66cc66;">&#40;</span>interactive<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span>* <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>filename <span style="color: #66cc66;">&#40;</span>buffer-file-<span style="color: #b1b100;">name</span> <span style="color: #66cc66;">&#40;</span>current-buffer<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>newbuf <span style="color: #66cc66;">&#40;</span>get-buffer-create
		 <span style="color: #66cc66;">&#40;</span>format <span style="color: #ff0000;">&quot;%s diffs&quot;</span>
			 <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> filename <span style="color: #66cc66;">&#40;</span>buffer-<span style="color: #b1b100;">name</span><span style="color: #66cc66;">&#41;</span> default-directory<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>set-buffer newbuf<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> buffer-read-only
	<span style="color: #66cc66;">&#40;</span>toggle-read-only<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>erase-buffer<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>insert
     <span style="color: #66cc66;">&#40;</span>shell-command-to-string
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> filename <span style="color: #66cc66;">&#40;</span>format <span style="color: #ff0000;">&quot;bk diffs -uph %s&quot;</span> filename<span style="color: #66cc66;">&#41;</span> <span style="color: #ff0000;">&quot;bk -r diffs -uph&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>switch-to-buffer-other-window newbuf<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>diff-mode<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>beginning-of-buffer<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>diff-hunk-next<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>toggle-read-only<span style="color: #66cc66;">&#41;</span>
    newbuf<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Now, whenever you are in a file and want to modify it, all you need to do is run the command <code>bk-diffs</code> and you'll get something like this:</p>
<p><a href='http://blog.oscarbonilla.com/wp-content/uploads/2007/12/emacs-bk-diffs-1.png' class="lightview" rel="gallery[31]" title='Emacs diff mode screenshot'><img src='http://blog.oscarbonilla.com/wp-content/uploads/2007/12/emacs-bk-diffs-1.png' alt='Emacs diff mode screenshot' /></a></p>
<p>Cool, eh?</p>
<p>The command is also context sensitive, so if you run it from a buffer where you're not editing a file, e.g. a dired buffer or a shell buffer, it will run a recursive diff and give you diffs for all the files. I use this all the time when I go back to repositories I haven't touched in a while. It's my "what the hell was I doing?" command. The output looks something like this:</p>
<p><a href='http://blog.oscarbonilla.com/wp-content/uploads/2007/12/emacs-bk-diffs-2.png' class="lightview" rel="gallery[31]" title='Emacs diff mode screenshot 2'><img src='http://blog.oscarbonilla.com/wp-content/uploads/2007/12/emacs-bk-diffs-2.png' alt='Emacs diff mode screenshot 2' /></a></p>
<p>That's not all. I have more tricks for you. First of all, navigation:</p>
<table>
<tr>
<td>n or M-n</td>
<td>Move to the next hunk</td>
</tr>
<tr>
<td>p or M-p</td>
<td>Move to the previous hunk</td>
</tr>
<tr>
<td>M-N</td>
<td>Move to the next file</td>
</tr>
<tr>
<td>M-P</td>
<td>Move to the previous file</td>
</tr>
</table>
<p>If you are an old school hacker and would rather see context diffs than unified diffs, you can hit <code>C-c C-d</code> while in the diffs buffer. To go back to unified diffs, hit <code>C-c C-u</code>.</p>
<p>There are also key strokes for going back to the source file from the diff buffer. Pressing <code>Enter</code> or <code>M-o</code> or <codde>C-c C-c will take you to the equivalent line (or thereabouts) in the source file from which the diff was taken.</p>
<p>Ok, that is useful, but I see you're not blown away. The truth is, I saved the best part for last. Once you're walking the diffs one by one, you can also press <code>C-c C-a</code> to either apply, or revert a hunk! How cool is that eh?</p>
<p>This last feature is something I use all the time to clean up a file before checking it in. E.g. I sometimes have a bunch of debug code or comments to myself that need to be removed before checking the file in. Rather than review the file by hand, I can go through the diffs and use the quick navigation that emacs provides for doing the clean up.</p>
<p>Finally, if you are a CVS user (I'm sorry, really. You should switch to something else), you can probably still use it inside vc-mode, hit <code>C-x v =</code> to get the diffs and try the keystrokes I mentioned.</p>
<p></codde></p>
]]></content:encoded>
			<wfw:commentRss>http://oscarbonilla.com/2007/12/vive-la-difference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beautiful Emacs</title>
		<link>http://oscarbonilla.com/2007/12/beautiful-emacs/</link>
		<comments>http://oscarbonilla.com/2007/12/beautiful-emacs/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 05:23:45 +0000</pubDate>
		<dc:creator>ob</dc:creator>
				<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://blog.oscarbonilla.com/?p=26</guid>
		<description><![CDATA[When you spend all day looking at code, it's important to select a good editor font. Obviously, the font needs to be monospaced or the alignment will be all wrong. Well, there are only a handful of monospaced fonts worth looking at (and Courier is not one of them). Take a look at the following [...]]]></description>
			<content:encoded><![CDATA[<p>When you spend all day looking at code, it's important to select a good editor font. Obviously, the font needs to be monospaced or the alignment will be all wrong. Well, there are only a handful of monospaced fonts worth looking at (and Courier is <strong>not</strong> one of them).</p>
<p>Take a look at the following image. Click on it, and pick your favorite of the four fonts.</p>
<p><a href='http://blog.oscarbonilla.com/wp-content/uploads/2007/12/fonts.png' class="lightview" rel="gallery[26]" title='Different fonts in Carbon Emacs'><img src='http://blog.oscarbonilla.com/wp-content/uploads/2007/12/fonts.png' alt='Different fonts in Carbon Emacs' /></a></p>
<p>These are the fonts in the image, clockwise from the top left corner: Bitstream Vera Sans Mono, Andale Mono, Monaco, and <a href="http://www.levien.com/type/myfonts/inconsolata.html">Inconsolata</a>.</p>
<p>Bitstream Vera Sans Mono is my second favorite. It's the font I use on my web browser. However, for editing code, I find it a bit too heavy. This probably has more to do with my color scheme than the font per se, so your millage might vary.</p>
<p>Andale Mono is very readable, but I find the spacing all wrong and somewhat distracting. Look at the word "String", the letters seem too far apart.</p>
<p>Inconsolata is my personal favorite. You need to crank up the font size because it seems to be a smaller font than the rest. I thought that point sizes were supposed to be standard, but apparently I was wrong.</p>
<p>Monaco is the default in Mac OS X, but it looks kind of silly. I used to use whatever was the default, so I've used this font quite a while. I never did mind it, but once I made the switch to Inconsolata, I can't stand it anymore.</p>
<p>If you want to play with different fonts in Carbon Emacs, you can enable mac keys by running the <code>(mac-key-mode)</code> function, and then pressing ⌘T, which will open a standard font dialog.</p>
<p>However, if you want to use Inconsolata as your default font, put this in your <code>.emacs</code></p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>require 'carbon-font<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>fixed-width-set-default-fontset
       <span style="color: #ff0000;">&quot;-apple-inconsolata-medium-r-normal--14-*-*-*-*-*-iso10646-1&quot;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>It took me a while to figure out how to change the font on Carbon Emacs, so I hope that even if you don't choose Inconsolata as your preferred font, this information might prove useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://oscarbonilla.com/2007/12/beautiful-emacs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
