Fixing the Emacs distnoted Problem on OS X 10.9

With Emacs 24.3 (and possibly earlier versions) under OS X 10.9 there is a nasty problem that causes distnoted, the OS X distributed notifications daemon, to periodically suck up processor resources and basically tie up the machine. Sometimes it recovers on its own, sometimes you have to restart Emacs. That is particularly apt to happen after waking up from sleep mode.

The problem is fixed in the 24.4 release and I've been ignoring it while I waited for the new release. The other day, though, I ran out of patience and hunted up a patch I'd seen for it some time ago. If you build Emacs from source, it's trivial to apply it: just follow the instructions in the patch commentary1.

After applying the patch and rebuilding, everything worked normally again and I haven't had anymore runaway distnoted problems. Actually, the whole system seems snappier after I installed the patch. That's not too surprising given that Emacs is always running on my machines. If you're running Emacs on OS X 10.9, you may want to rebuild Emacs with the patch. As long as you have a C development environment, that's easy. I don't know if Homebrew and the other package systems have applied the patch or not.



For some reason that I've long forgotten, I don't have to do the

make bootstrap

step. If you get a fatal error on the

make install

step, just start over but omit the

make bootstrap


This entry was posted in General and tagged . Bookmark the permalink.
  • I'm intrigued, how did you get those oblong boxes round your 'build' commands? I like them and would love to use them on my blog too.

    • jcs

      I write my blog posts in Emacs/Org-mode. Those boxes are just snippets of source code between #+START_SRC and #+END_SRC but really all the magic is in CSS. Org just wraps the code snippet in <PRE> ... </PRE> tags and then this CSS:

      pre {
      font-family: "Courier 10 Pitch", Courier, monospace;
      border: 1pt solid black;
      padding: 3pt;
      background-color: #F0F8FF;
      overflow: auto;

      draws the box and will scroll it if the lines are too long.

  • I'm using 'org2blog' and just put in '<s' which expands to #+BEGIN_SRC bash -n & #+END_SRC much the same as you I guess. But I'm also using the plugin 'SyntaxHighlighter Evolved' which gives code starts as [sourcecode language="bash" light="false"] . I've found that if you have 'light=false' you have a slight border round the code, a view source button which gives a popout window of the source, and a small printer icon. Your css is loaded and then overwritten by the plugin, and I cant see where to change that. I like the code being highlighted, its pretty! :) But I'll keep looking, thanks.

    • jcs

      As far as I can see, there's no real reason to use SyntaxHighlighter Evolved unless you want the popup window and printer button. Org mode will highlight your code according to the language for you (see here, for instance). The CSS I showed above will draw the border. You can adjust it to be lighter if that suits you.

      You could probably get the printer button and popup window with a bit of CSS as well. If you're wondering how to get org2blog to push the CSS, you don't have to worry about that. You make a child theme with your CSS and WordPress will apply it for you.

  • Thanks for this, I now have a child theme called ‘magomra-child’ which is multi-site enabled, and then site-enabled, but when i look at the themes section of i can see ‘magomra-child’ but if i activate it then it replaces my magomra theme. i’m following and I can’t see where I am going wrong. This is my ‘style.css’ at Can you advise please?

  • Jason

    I updated to OSX 10.9 recently and was wondering why it was so sluggish. Rebuilding Emacs now. Thanks!

    (Sorry about making an on-topic comment)