emacs-devel
[Top][All Lists]
Advanced

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

Re: ps-print-color-p and the background colour of Emacs' frame


From: Vinicius Jose Latorre
Subject: Re: ps-print-color-p and the background colour of Emacs' frame
Date: Wed, 08 Aug 2007 13:42:11 -0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4

Christian Schlauer wrote:
Vinicius Jose Latorre <address@hidden> writes:
Christian Schlauer wrote:

[...]
There is only an inaccurate doc string:

,----[ C-h v ps-default-bg RET ]
| It's used only when `ps-print-color-p' is non-nil.
`----

Correct is "It's used only when `ps-print-color-p' is not nil or
black-white." -- see below:
Humm, isn't black-white a non-nil (not nil) value?

,----[ C-h v ps-print-color-p RET ]
| ps-print-color-p is a variable defined in `ps-print.el'.
| | Valid values are:
| |    nil              Do not print colors.
| |    t                Print colors.
| |    black-white      Print colors on black/white printer.
| | Any other value is treated as t.
| | You can customize this variable.
`----

`black-white' is a non-nil value, but ps-default-bg isn't used when
ps-print-color-p is `black-white' -- the following is tested with
Emacs 22.1.50:

| ps-print-color-p | Background colour in PS file when    |
|                  | `ps-default-bg' is `frame-parameter? |
|------------------+--------------------------------------|
| t                | yes                                  |
| black-white      | no                                   |
| nil              | no                                   |

So the doc-string of ps-default-bg *could* say "It is used iff
`ps-print-color-p' is t."

Ok, now I see what you mean.

I've just updated ps-print.el in trunk, Emacs 22 branch and Emacs Unicode branch.

Now ps-default-bg and ps-default-fg has:

This variable is used only when `ps-print-color-p' (which see) is neither nil
   nor black-white.

But there is this nasty "Any other value is treated as t." in the
doc-string of ps-print-color-p, as quoted above. That suggests that
the only way to *avoid* the background colour in the PS file is to set
ps-print-color-p to `nil' or `black-white' -- if I set it to `foo',
that would be treated as t according to the doc-string. That's why I
ended up with the above formulation. My suggestions are:

1. Either write "It is used unless `ps-print-color-p' is nil or
   black-white." in the doc-string of ps-default-bg (I tested that,
   see the table above) or

2. get rid of the "Any other value is treated as t." in the doc-string
   of ps-print-color-p.

It seems to me that (2) makes most sense: I can't seem to set
ps-print-color-p to anything else than t/black-white/nil. I tried

M-x set-variable RET ps-print-color-p RET foo RET

and

M-x set-variable RET ps-print-color-p RET 4 RET

but that doesn't work. And

M-x customize-variable RET ps-print-color-p RET

shows a `Value Menu' consisting of t/black-white/nil. So how could the
user set it to any other value?

Through Emacs Lisp:

(setq ps-print-color-p 4)

(setq ps-print-color-p (or (some-fun 10) 4))

(defun my-settings ()
  ;; ... some settings ...
  (setq ps-print-color 'my-setting))

(defun my-print (...)
  (let ((ps-print-color-p 'use-this-value))
    (ps-print-buffer-with-face ...)))





reply via email to

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