From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#33799: 27.0.50; set-foreground-color completion shows background colors Date: Wed, 19 Dec 2018 23:34:54 +0200 Organization: LINKOV.NET Message-ID: <87lg4lnvwp.fsf@mail.linkov.net> References: <875zvqz8om.fsf@mail.linkov.net> <5aftutcptc.fsf@fencepost.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1545256689 387 195.159.176.226 (19 Dec 2018 21:58:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Dec 2018 21:58:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 33799@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 19 22:58:04 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZjqt-0008Qy-N0 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Dec 2018 22:58:04 +0100 Original-Received: from localhost ([::1]:34347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZjt0-0002Nf-FW for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Dec 2018 17:00:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZjst-0002NH-3x for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 17:00:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZjsp-0002ya-0m for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 17:00:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50936) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZjso-0002yP-Sy for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 17:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gZjso-00054w-RO for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 17:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Dec 2018 22:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33799 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33799-submit@debbugs.gnu.org id=B33799.154525679019445 (code B ref 33799); Wed, 19 Dec 2018 22:00:02 +0000 Original-Received: (at 33799) by debbugs.gnu.org; 19 Dec 2018 21:59:50 +0000 Original-Received: from localhost ([127.0.0.1]:55190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZjsa-00053V-0Y for submit@debbugs.gnu.org; Wed, 19 Dec 2018 16:59:50 -0500 Original-Received: from indri.birch.relay.mailchannels.net ([23.83.209.92]:26532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZjsY-00053N-L8 for 33799@debbugs.gnu.org; Wed, 19 Dec 2018 16:59:47 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 05243123B0D; Wed, 19 Dec 2018 21:59:45 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a54.g.dreamhost.com (unknown [100.96.35.77]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B65FA123E2F; Wed, 19 Dec 2018 21:59:44 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a54.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Wed, 19 Dec 2018 21:59:44 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Soft-Drop: 6708cb7d7d0ef7e9_1545256784833_1310182480 X-MC-Loop-Signature: 1545256784832:3990609468 X-MC-Ingress-Time: 1545256784832 Original-Received: from pdx1-sub0-mail-a54.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a54.g.dreamhost.com (Postfix) with ESMTP id 70C728039C; Wed, 19 Dec 2018 13:59:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=j/Y522XZukRat+IJi6UsLFb4W8k=; b= flOesAIMw9Wr4ee/sDLZ1OQu5JVhMiyzX9hZNIsDFr7YW/i3ZmiI/jOLm4T/VYHv Ex8755DxeVlILWfrmuhlZKewwET6yiLw18i1ze4gD252m8e8sVR0o02VQl9O6//3 DtzzbHb6bXrr7HC6YDJtOMcGOW2rcpXz/OdIcUx3fpI= Original-Received: from mail.jurta.org (m91-129-106-79.cust.tele2.ee [91.129.106.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a54.g.dreamhost.com (Postfix) with ESMTPSA id 8F0ED803B7; Wed, 19 Dec 2018 13:59:41 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a54 In-Reply-To: <5aftutcptc.fsf@fencepost.gnu.org> (Glenn Morris's message of "Wed, 19 Dec 2018 13:51:59 -0500") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudejtddgudehiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdeirdejleenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdeirdejledprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehrghhmsehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:153616 Archived-At: >> 1. M-x set-foreground-color RET TAB >> >> shows a completion list of colors with different backgrounds, not >> foregrounds as it would be natural to expect > > Very lightly tested: > > (mapcar > (lambda (color-name) > - (let ((foreground (readable-foreground-color color-name)) > - (color (copy-sequence color-name))) > - (propertize color 'face (list :foreground foreground > - :background color)))) > + (let ((readable (readable-foreground-color color-name)) > + (color (copy-sequence color-name))) > + (propertize color 'face > + (if foreground > + (list :foreground color) > + (list :foreground readable :background color))))) I don't know if readable background is needed for set-foreground-color like readable foreground is used for set-background-color. I think your change to not use readable background is more correct because then the user will see how the selected color will fit with the background. This helps to select a suitable combination of foreground/background colors. The same way maybe readable foreground should be removed from the completions of set-background-color. This would allow to see how the current foreground color will look on different backgrounds in the completion list.