From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Issue with ns_color_defined makeIndex argument Date: Sat, 13 Apr 2019 11:09:33 +0100 Message-ID: <20190413100933.GA20582@breton.holly.idiocy.org> References: <87lg0gttmf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="11173"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.11.3 (2019-02-01) Cc: emacs-devel@gnu.org To: Alex Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 13 12:09:52 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hFFbb-0002pF-OO for ged-emacs-devel@m.gmane.org; Sat, 13 Apr 2019 12:09:51 +0200 Original-Received: from localhost ([127.0.0.1]:49308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFFba-0007Ym-E4 for ged-emacs-devel@m.gmane.org; Sat, 13 Apr 2019 06:09:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFFbQ-0007YW-TO for emacs-devel@gnu.org; Sat, 13 Apr 2019 06:09:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFFbP-0005aZ-Uo for emacs-devel@gnu.org; Sat, 13 Apr 2019 06:09:40 -0400 Original-Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:46607) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hFFbP-0005a1-JF for emacs-devel@gnu.org; Sat, 13 Apr 2019 06:09:39 -0400 Original-Received: by mail-wr1-x42a.google.com with SMTP id t17so15039427wrw.13 for ; Sat, 13 Apr 2019 03:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=jSFZZZXvk2rXPRN5ujQ/xx+nGcpt0UHMFVnsn5PwYxc=; b=VsHxCp3JHN5UXqIiO3HA5DRZsYTJkQF1Wj92wqXL0ZCzKlwEjyFocxH1vRA3gcYizh +/l95KcHYc1IEbZnBvx3sGgcvOju4PTgjoRoCpLBiyKLcJzzUFa8JQYokMr3VneCyUiw uFtFydnqNPnVS3fOapHPvmrvnrWA4BkpFdt47L8JHKmd+hA+J6jzW9rYzcRA7MxyyXNf 1DUkxGB/J4A3Szy+yopgto6ugqWd+N2+jk24gnsI6CMoTDtFkgZ40Vmc+2+DXrWf1klZ OsFFKRxwKcyyaG6iNuQhgWisEK2zJDNtvvZDL83oRyyJLMjvbGSoKtBoGHLcMCRFkzgn VdDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=jSFZZZXvk2rXPRN5ujQ/xx+nGcpt0UHMFVnsn5PwYxc=; b=hhTPmkmfyGfGJ3SFwuP36I/ykWvuYD366ATV4UvUu7fjbHzGyJ0ndzhMoRYnOdqqJf dw/VEZ3m7FDz1S1TgzHK9grbKTtq2sXxWj25Vq5ic40FzwYsBTTRK7oQpVJg6NNY7cLi RcUac6lG1bH7Ozcpt/+8rGknQis6fBr99sH3awz6+6dUXB8OzvO0E0y1GITY/64ubq8H E5bXS2UeDXbKvDMhVkkt/bDbC8R8F2PXJLv+LqxgUF3e+kIe+m5lh5V/77zDdVHVLFYF ISNZqQfWy4v9gBifFzs0dS6LkGpA5ig2VNonfIgfAYMQZdLZJo3cv6oPtM+5m0a/kuBZ FeYg== X-Gm-Message-State: APjAAAWbazEP8B108fvAr43pIM+Q+SGAlPj2DoU6NH6zlcxZ2tSGGrqe 2BFsm89Zhf7ub7h+57M2xY8= X-Google-Smtp-Source: APXvYqwstXuDISJPiPXKFvusIBMghTpxD6Zc1JkrRys0kie6i6GcSrg+5CMAXaL9dmVO786VhNmlBA== X-Received: by 2002:a5d:69c1:: with SMTP id s1mr39436892wrw.245.1555150177141; Sat, 13 Apr 2019 03:09:37 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-accc-50ba-b003-15ba.holly.idiocy.org. [2001:8b0:3f8:8129:accc:50ba:b003:15ba]) by smtp.gmail.com with ESMTPSA id y9sm75324198wrn.18.2019.04.13.03.09.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Apr 2019 03:09:36 -0700 (PDT) Content-Disposition: inline In-Reply-To: <87lg0gttmf.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:235393 Archived-At: On Thu, Apr 11, 2019 at 10:05:28AM -0600, Alex wrote: > I'm currently generalizing some window system-specific code into > terminal hooks, but I've run into an issue regarding ns_color_defined. > > In image.c when HAVE_NS is defined, x_defined_color is defined to be: > > ns_defined_color (f, name, color_def, alloc, 0) > > But in xfaces.c, defined_color calls ns_defined_color as follows: > > ns_defined_color (f, color_name, color_def, alloc, true); > > My intention is to remove defined_color in xfaces.c and the #define > x_defined_color calls in image.c and to replace each call with: > > FRAME_TERMINAL (f)->defined_color_hook (f, color_name, color_def, alloc) > > The issue here is that the calls in image.c have makeIndex as 0, and the > calls in xfaces.c as true; is this the intended behaviour? I’m not familiar with this area of the code, and a review hasn’t done anything to enlighten me. This code has been in since the NS port was merged, so there’s no explanatory reasoning in commit messages. If I’m reading the code right, when we lookup a colour in image.c, we store a 32bit integer representation of the colour in color_def.pixel, but when doing a lookup from xfaces.c, we store an index into a lookup table in color_def.pixel. > If so, does anyone have any ideas to rectify this besides adding an > extra argument that non-NS window systems just ignore? I'd rather avoid > doing that. I have no ideas, I’m afraid. -- Alan Third