help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does ps-print-buffer-with-faces give the correct colors?


From: Mathias Dahl
Subject: Re: Does ps-print-buffer-with-faces give the correct colors?
Date: Thu, 23 Nov 2006 18:32:31 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (windows-nt)

Mathias Dahl <address@hidden> 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... :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]