From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: Does ps-print-buffer-with-faces give the correct colors? Date: Thu, 23 Nov 2006 18:32:31 +0100 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1164390551 26129 80.91.229.2 (24 Nov 2006 17:49:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 24 Nov 2006 17:49:11 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 24 18:49:09 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GnfAi-0000ED-7b for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Nov 2006 18:49:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GnfAh-0004o1-Sb for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Nov 2006 12:49:07 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-X-Trace: individual.net NKvGC9mCjP7zZK0w5/bLIA7k5LZ/+2A6t6dqq2tr0VH8XfxWSu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (windows-nt) Cancel-Lock: sha1:XluXeTNPKo7HBNGVtcTLrz4Rgck= Original-Xref: shelby.stanford.edu gnu.emacs.help:143302 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:38919 Archived-At: Mathias Dahl writes: > I made a small hack today while playing wirh Ghostscript. It creates > a PDF file of the current buffer in Emacs. The problem is that the > colors of the faces become strange. Problem solved! :) I read the comments in ps-print.el and found this section: ;; ps-print keeps internal lists of which fonts are bold and which ;; are italic; these lists are built the first time you invoke ;; ps-print. AHA! ;; For the sake of efficiency, the lists are built only once; the ;; same lists are referred in later invocations of ps-print. And there seem to exist a cure too: ;; Because these lists are built only once, it's possible for them ;; to get out of sync, if a face changes, or if new faces are ;; added. To get the lists back in sync, you can set the variable ;; `ps-build-face-reference' to t, and the lists will be rebuilt ;; the next time ps-print is invoked. If you need that the lists ;; always be rebuilt when ps-print is invoked, set the variable ;; `ps-always-build-face-reference' to t. In my case I had first tested my hack using one color-theme and then I switched and it kept the colors that the old theme had. Testing from a newly started Emacs solved the problem. And I also tested setting the variable `ps-build-face-reference' mentioned above right now, and it also solved the problem. So, move along, nothing to see here... :)