unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vinicius Jose Latorre <viniciusjl@ig.com.br>
To: cs-usenet@arcor.de
Cc: emacs-devel@gnu.org
Subject: Re: ps-print-color-p and the background colour of Emacs' frame
Date: Wed, 08 Aug 2007 13:42:11 -0300	[thread overview]
Message-ID: <46B9F263.60708@ig.com.br> (raw)
In-Reply-To: <f9ap3c$89i$1@sea.gmane.org>

Christian Schlauer wrote:
> Vinicius Jose Latorre <viniciusjl@ig.com.br> 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	other threads:[~2007-08-08 16:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-05 20:22 ps-print-color-p and the background colour of Emacs' frame Christian Schlauer
2007-07-20 17:31 ` Vinicius Jose Latorre
2007-07-23 18:54   ` Christian Schlauer
2007-07-25 15:22     ` Vinicius Jose Latorre
2007-08-05 20:19       ` Christian Schlauer
2007-08-05 20:38         ` Vinicius Jose Latorre
2007-08-07 21:44           ` Christian Schlauer
2007-08-08 16:42             ` Vinicius Jose Latorre [this message]
2007-08-18  7:50               ` Christian Schlauer

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=46B9F263.60708@ig.com.br \
    --to=viniciusjl@ig.com.br \
    --cc=cs-usenet@arcor.de \
    --cc=emacs-devel@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).