all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: no-spam@cua.dk (Kim F. Storm)
Cc: help-gnu-emacs@gnu.org
Subject: Re: Does ps-print-buffer-with-faces give the correct colors?
Date: Fri, 24 Nov 2006 21:16:32 +0100	[thread overview]
Message-ID: <m3k61kk3bz.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <uy7q25as0.fsf@gmail.com> (Mathias Dahl's message of "Thu\, 23 Nov 2006 18\:32\:31 +0100")

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	other threads:[~2006-11-24 20:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-22 18:25 Does ps-print-buffer-with-faces give the correct colors? Mathias Dahl
2006-11-22 22:35 ` Peter Dyballa
2006-11-23  4:08   ` Eli Zaretskii
2006-11-23 10:46     ` Peter Dyballa
2006-11-23  0:43 ` Mathias Dahl
2006-11-23  4:16   ` Eli Zaretskii
     [not found] ` <mailman.1005.1164235028.2155.help-gnu-emacs@gnu.org>
2006-11-23  9:29   ` Mathias Dahl
2006-11-23 17:32 ` Mathias Dahl
2006-11-24 20:16   ` Kim F. Storm [this message]
2006-11-24 23:15     ` Lennart Borgman
2006-11-25 10:21       ` Eli Zaretskii
     [not found]   ` <mailman.1023.1164399420.2155.help-gnu-emacs@gnu.org>
2006-11-27  9:28     ` Mathias Dahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3k61kk3bz.fsf@kfs-l.imdomain.dk \
    --to=no-spam@cua.dk \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.