From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12853: 24.2.50; doc of `color-defined-p' Date: Sat, 10 Nov 2012 20:33:13 +0200 Message-ID: <83bof5xq8m.fsf@gnu.org> References: <10495ABA26F14041A1E374AC3B820F6E@us.oracle.com> <83d2zlxs8g.fsf@gnu.org> <7DA4A38C21E342A8A4061EC7D8257556@us.oracle.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1352572437 11495 80.91.229.3 (10 Nov 2012 18:33:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2012 18:33:57 +0000 (UTC) Cc: 12853@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 10 19:34:07 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TXFsb-0001b8-2N for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Nov 2012 19:34:05 +0100 Original-Received: from localhost ([::1]:59102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXFsR-0005JM-K6 for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Nov 2012 13:33:55 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXFsN-0005JC-KP for bug-gnu-emacs@gnu.org; Sat, 10 Nov 2012 13:33:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXFsK-0004O6-IF for bug-gnu-emacs@gnu.org; Sat, 10 Nov 2012 13:33:51 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXFsK-0004O2-EG for bug-gnu-emacs@gnu.org; Sat, 10 Nov 2012 13:33:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TXFsY-0004NB-A0 for bug-gnu-emacs@gnu.org; Sat, 10 Nov 2012 13:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Nov 2012 18:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12853 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12853-submit@debbugs.gnu.org id=B12853.135257240316762 (code B ref 12853); Sat, 10 Nov 2012 18:34:02 +0000 Original-Received: (at 12853) by debbugs.gnu.org; 10 Nov 2012 18:33:23 +0000 Original-Received: from localhost ([127.0.0.1]:59799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXFru-0004MJ-Kx for submit@debbugs.gnu.org; Sat, 10 Nov 2012 13:33:22 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:34815) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXFrs-0004M8-0V for 12853@debbugs.gnu.org; Sat, 10 Nov 2012 13:33:21 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MDA00A00BGRA900@a-mtaout22.012.net.il> for 12853@debbugs.gnu.org; Sat, 10 Nov 2012 20:33:04 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MDA00AQBBJ43940@a-mtaout22.012.net.il>; Sat, 10 Nov 2012 20:33:04 +0200 (IST) In-reply-to: <7DA4A38C21E342A8A4061EC7D8257556@us.oracle.com> X-012-Sender: halo1@inter.net.il X-Spam-Score: 1.5 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: 1.5 (+) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66735 Archived-At: > From: "Drew Adams" > Cc: <12853@debbugs.gnu.org> > Date: Sat, 10 Nov 2012 10:12:34 -0800 > > However, I do not see either of those names returned by `defined-colors', which > has the same handling of optional arg FRAME as `color-defined-p'. Perhaps that > function does include those two names sometimes, under some circumstances? > Dunno - you tell me. defined-colors will also report only the 8 or 16 colors defined "natively" on a TTY, while color-defined-p will tell that, say, "DarkSeaGreen" is also "defined". Here, try this in "emacs -Q -nw": M-: (defined-colors) RET => ("black" "blue" "green" "cyan" "red" "magenta" "brown" "lightgray" "darkgray" "lightblue" "lightgreen" "lightcyan" "lightred" "lightmagenta" "yellow" "white") But M-: (color-defined-p "DarkSeaGreen") RET => t So these two functions do not support 1-to-1 correspondence of color names, as you seem to assume. That's because the purpose of these functions is different: defined-colors only return the "basic" colors supported by the current frame, while color-defined-p reports whether the frame can _display_ a given color. > If so, then the exceptional treatment of these two pseudo color names > (recognized as colors sometimes, in some contexts) seems like an ugly kludge. We need those pseudo-colors to express the unknown fore- and back-ground colors used by TTY frames on displays that cannot report what those default colors are. It is a kludge to some extent, because these colors obviously can be displayed, but having them return non-nil from color-defined-p gets in the way. This the note in the doc string. > In that case, please also mention in the doc that "defined color" is determined > by function `defined-colors' It isn't, see above. > On the other hand, if `defined-colors' in fact always DTRT - never returns those > noncolors, then the doc for `color-defined-p' should say just what I stated > originally. That would remove information that's important for someone who writes code which manipulates color names at a low level where these distinctions are important. It was important for me when I did that, and so I would object to removing this.