From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.devel Subject: Re: ps-print-color-p and the background colour of Emacs' frame Date: Wed, 08 Aug 2007 13:42:11 -0300 Message-ID: <46B9F263.60708@ig.com.br> References: <46A0F18B.1080108@ig.com.br> <46A76AB1.8060807@ig.com.br> <46B6352F.1060604@ig.com.br> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1186591259 6819 80.91.229.12 (8 Aug 2007 16:40:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Aug 2007 16:40:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: cs-usenet@arcor.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 08 18:40:57 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IIoae-0002nY-Rn for ged-emacs-devel@m.gmane.org; Wed, 08 Aug 2007 18:40:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIoae-0007jk-Dh for ged-emacs-devel@m.gmane.org; Wed, 08 Aug 2007 12:40:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IIoab-0007jQ-4b for emacs-devel@gnu.org; Wed, 08 Aug 2007 12:40:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IIoaZ-0007iX-9m for emacs-devel@gnu.org; Wed, 08 Aug 2007 12:40:52 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIoaZ-0007iR-3c for emacs-devel@gnu.org; Wed, 08 Aug 2007 12:40:51 -0400 Original-Received: from an-out-0708.google.com ([209.85.132.242]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IIoaY-0006Fo-Oz for emacs-devel@gnu.org; Wed, 08 Aug 2007 12:40:50 -0400 Original-Received: by an-out-0708.google.com with SMTP id c25so33223ana for ; Wed, 08 Aug 2007 09:40:49 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=D34sC3/LyaTsqwSwcQUtOYFxcYYj0ON3Rb5Kj8Yk+NyOqs+t2ks/iXezGxC1y0NweWb1Puv1Xax2Zp1yzPe0SIUvFrujZxw1544hi4d5flbl3alm/82GxB5xJ8CJ0G8bVvxZdGUzsC/kjJm3lALKbWEQH7z9qNDRrEnZ7m/4Cf0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=CHn4pn5sM3kpZFjCjxWL+s8DmMlOiVkLStjVtL0SVjpFDzDm6zaM0NH36UwYPnHhQn0q/ER+oDnsY6jluquJzYGXc3pmzzK9lZmI2RS8VR5YL5QVwhaCkp/ovGQVVU9LdBY3qgsgwznJngVCSaIXoS56a33Bi/DZlD574k9q4KI= Original-Received: by 10.100.153.17 with SMTP id a17mr1450426ane.1186591249323; Wed, 08 Aug 2007 09:40:49 -0700 (PDT) Original-Received: from ?201.82.142.28? ( [201.82.142.28]) by mx.google.com with ESMTPS id b32sm871737ana.2007.08.08.09.40.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Aug 2007 09:40:47 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 In-Reply-To: X-Detected-Kernel: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:76200 Archived-At: Christian Schlauer wrote: > Vinicius Jose Latorre 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 ...)))