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: Kim F. Storm
Subject: Re: Does ps-print-buffer-with-faces give the correct colors?
Date: Fri, 24 Nov 2006 21:16:32 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

Mathias Dahl <brakjoller@gmail.com> writes:

> Mathias Dahl <brakjoller@gmail.com> 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... :)

I don't know how often people print files, but to me it seems more
user-friendly if the default for ps-always-build-face-reference is t,
so users don't have to wade through lots of documentation to find out
why things doesn't work -- just because of an optimization.
Is the time used to build that list noticable at all?

People who do read the "fine print" may still set that variable to nil
if they want the optimization.

-- 
Kim F. Storm  http://www.cua.dk





reply via email to

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