Monday, December 29, 2014

Some Work, So I Can Do Some Work, Emacs-style

Today, on my work box (OS X, version 10.9.5), I installed/updated packages in order to get org-mode to work completely and properly. Specifically, I downloaded the huge MacTex package so that I could export a buffer in org-mode to TeX (and likely to PDF from there). Also, I'd been running into small but frustrating errors ever since I switched the machine over to Mavericks.

But then something odd happened: when I tried to open a new buffer, "test.org", I encountered the following error:

Symbol's function definition is void: org-with-silent-modifications

I ended up commenting out the line: (setq org-startup-indented t), and was able to open a buffer. I don't like those excessive asterisks, though, so I called M-x org-indent-mode, but that also raised an error. Oddly, by calling it a second time, I got the same error message, but the buffer indented properly anyhow.

It was puzzling to me, but I copy-pasted the error message into Google and found this blog. I found that this was a well-known issue when using ELPA. It then came back to me that, when I first set up org-mode, I installed the package manually, and only came to use ELPA later. So I moved the 'org-20140728' file to ~/tmp, restarted emacs, and used the 'package-install' command to get a fresh org-mode installed.

Long story short: it eventually worked, but I had to comment out a single line in my init.el file (after uncommenting the setq line above):

(require 'org)

I don't know exactly why; I suspect it has something to do with when the org-mode files are actually read, and either is required before some necessary function or variable is defined, or requiring it twice messes up an existing function or variable. In any case, that line is now commented out, and I can once again export my notes to PDF.

cheers,
Adam

No comments:

Post a Comment