From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#4033: 23.1; list-colors-display is misleading Date: Thu, 06 Aug 2009 00:35:43 +0300 Organization: JURTA Message-ID: <87ws5i9c5s.fsf@mail.jurta.org> References: <4B9B03BEE43E44B79206302B26E01B3A@us.oracle.com> <87ws5j9rcv.fsf@mail.jurta.org> <6875A66084B7406B8409F2C495A75D26@us.oracle.com> Reply-To: Juri Linkov , 4033@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249508867 26203 80.91.229.12 (5 Aug 2009 21:47:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Aug 2009 21:47:47 +0000 (UTC) Cc: 4033@emacsbugs.donarmstrong.com To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 05 23:47:39 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MYoKh-0004pF-0e for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Aug 2009 23:47:39 +0200 Original-Received: from localhost ([127.0.0.1]:54738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYoKg-0001y4-F6 for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Aug 2009 17:47:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYoK4-0001HE-N5 for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2009 17:47:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYoK0-0001By-4b for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2009 17:47:00 -0400 Original-Received: from [199.232.76.173] (port=55071 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYoJz-0001BX-PQ for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2009 17:46:55 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55433) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MYoJy-0006Nz-3c for bug-gnu-emacs@gnu.org; Wed, 05 Aug 2009 17:46:55 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n75Lkl0a029143; Wed, 5 Aug 2009 14:46:47 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n75Lj4SB028869; Wed, 5 Aug 2009 14:45:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Juri Linkov Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 05 Aug 2009 21:45:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4033 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4033-submit@emacsbugs.donarmstrong.com id=B4033.124950819628374 (code B ref 4033); Wed, 05 Aug 2009 21:45:04 +0000 Original-Received: (at 4033) by emacsbugs.donarmstrong.com; 5 Aug 2009 21:36:36 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mx1.starman.ee (smtp-out1.starman.ee [85.253.0.3]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n75LaZtw028371 for <4033@emacsbugs.donarmstrong.com>; Wed, 5 Aug 2009 14:36:36 -0700 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.69.104.cable.starman.ee [82.131.69.104]) by mx1.starman.ee (Postfix) with ESMTP id 668A43F41E6; Thu, 6 Aug 2009 00:36:29 +0300 (EEST) In-Reply-To: <6875A66084B7406B8409F2C495A75D26@us.oracle.com> (Drew Adams's message of "Tue, 4 Aug 2009 19:25:26 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Wed, 05 Aug 2009 17:47:00 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29909 Archived-At: > What about something like this: > > (defun rgb-color-format-for-display () > (let ((ncolors (display-color-cells (selected-frame))) > (exp 0)) > (while (> (lsh ncolors (- exp)) 1) (setq exp (1+ exp))) > (setq exp (/ exp 12)) > (format "#%%0%dx%%0%dx%%0%dx" exp exp exp))) > > For 16777216 colors, that gives #%02x%02x%02x, which seems right. > > In `list-colors-print', we would then do this: > > (insert (apply 'format (rgb-color-format-for-display) > (mapcar (lambda (c) (lsh c -8)) > (color-values (car color))))) > > IOW, replace the hard-coded "#%02x%02x%02x" with (rgb-color-format-for-display). > > But I guess Jason and Eli are saying that that wouldn't work or wouldn't be > appropriate. It's still not clear to me. I don't understand what is the reason to unnecessarily complicate this. In your original report you said that one user had some confusion with hex formats. Is this user using a system supporting more than 8 bits per component? -- Juri Linkov http://www.jurta.org/emacs/