From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Inclusion of naquadah-theme Date: Sat, 30 Jun 2012 10:15:23 +0800 Message-ID: <874nptk0jo.fsf@gnu.org> References: <87pq8nk8cj.fsf@zelenka.enovance.com> <87bok7zekq.fsf@gnu.org> <87k3yujqmn.fsf@zelenka.enovance.com> <87sjdf28ik.fsf@gnu.org> <874npvk990.fsf@zelenka.enovance.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1341022549 22779 80.91.229.3 (30 Jun 2012 02:15:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 30 Jun 2012 02:15:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 30 04:15:47 2012 Return-path: Envelope-to: ged-emacs-devel@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 1SknDl-0004qZ-W0 for ged-emacs-devel@m.gmane.org; Sat, 30 Jun 2012 04:15:38 +0200 Original-Received: from localhost ([::1]:38193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SknDl-0000E7-TY for ged-emacs-devel@m.gmane.org; Fri, 29 Jun 2012 22:15:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SknDh-0008W1-SG for emacs-devel@gnu.org; Fri, 29 Jun 2012 22:15:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SknDg-0007uN-0M for emacs-devel@gnu.org; Fri, 29 Jun 2012 22:15:33 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:50644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SknDf-0007uJ-TZ for emacs-devel@gnu.org; Fri, 29 Jun 2012 22:15:31 -0400 Original-Received: from cm162.gamma80.maxonline.com.sg ([202.156.80.162]:53461 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SknDe-0003GZ-CQ for emacs-devel@gnu.org; Fri, 29 Jun 2012 22:15:31 -0400 In-Reply-To: <874npvk990.fsf@zelenka.enovance.com> (Julien Danjou's message of "Thu, 28 Jun 2012 12:42:51 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151309 Archived-At: Julien Danjou writes: >> I'm not sure I understand. If you specify a face with a color like >> "#252A2B", doesn't Emacs display the closest matching color on terminals >> with limited colors? > > It does try, but the result is not always good. Some colors are > correctly picked up as closest/best choice, others aren't fine. We're > doing a better job manually. Well, first of all there are really only two cases that need to be handled: terminals that can handle #rrggbb, and 16-color terminals. In my experience, 256-color xterms give a rather good approximation of the desired colors automatically, without manual color placement. As for matching color names to faces, the approach that we've used in tango-theme.el and others is to do something like this: (let ((class '((class color) (min-colors 89))) ;; Tango palette colors. (butter-1 "#fce94f") ...) (custom-theme-set-faces 'tango-dark ... `(cursor ((,class (:background ,butter-1)))) Apart from handling multiple terminals, naquadah-simple-face-to-multiple aims to do the same thing, right? I'm guessing the reason is that you feel that having explicit functions is more structured/less ad-hoc than the above let-form. If that's the case, maybe the solution is to add a new macro to custom.el, which does something like this: (custom-theme-set-faces-with-color-names THEME TERMINALS COLORS FACES...) (custom-theme-set-faces-with-color-names 'tango-dark ((term-1 ((class color) (min-colors 4096))) (term-2 ((class color) (min-colors 16)))) ((butter (term-1 "#fce94f") (term-2 "yellow"))) (cursor :background butter) ...) WDYT?