http://bjoernstechblog.rueffer.info/posts/lisp/emacs/2010/11/30/Fixing-Color-Printing-in-Aquamacs-Emacs-1.9/
last updated on 25 May 2018

30 November 2010

Fixing Color Printing in Aquamacs Emacs 1.9

30/11/2010 edit: This post is superseded by this one on the same subject. The new post provides a much cleaner solution.

Dark text on bright background – that hurt’s my eyes after a while. So I prefer to reverse this setting. Luckily, with Aquamacs that’s no big deal, just a simple M-x custumize-face RET default RET and you can easily change the basis of all modes.

So far so good. But recently I tried to print a text buffer containing the log of a meeting. For some reason the print preview showed me white text with some color highlights on white background. Not helpful. This seems to be due to some glitch in the mac-print package, as far as I can tell (since the option to always print on white background was not set).

The remedy is simple. Just switch to black text on white background before you print, and switch back to your original settings afterwards. For this to happen automatically, add something along the following lines to your .emacs file:

1
2
3
4
5
6
7
8
9
10
(add-hook 'htmlize-before-hook
	(lambda ()
	  (set-face-foreground 'default "black")
	  (set-face-background 'default "ivory")
	  ))
(add-hook 'htmlize-after-hook
	(lambda ()
	  (set-face-foreground 'default "ivory")
	  (set-face-background 'default "black")
	  ))

Comments (through old commenting system)

Joel C. Miller, 20 June 2013:  Hi, There is a link on this webpage saying that this post is superseded by a new post. But that link is broken. Can you update? thanks, Joel

Björn Rüffer, 20 June 2013:  Thanks for point this out. It's fixed now. Actually, I should also say that I am using GNU Emacs for Mac OS at the moment, and I haven't used the feature for long time. I hope you get some use out of it.

Björn Rüffer — Copyright © 2009–2018 — bjoern.rueffer.info