From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: Re: Emacs 26.1 release branch created Date: Fri, 22 Sep 2017 12:59:41 -0400 Message-ID: <20170922165941.sirfk6qzfvdfw4i2@logos.localdomain> References: <83377mls4d.fsf@gnu.org> <87bmmazt77.fsf@udel.edu> <83zi9ukbj3.fsf@gnu.org> <20170916145112.GA22458@holos.localdomain> <83wp4yk7ve.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1506099629 10850 195.159.176.226 (22 Sep 2017 17:00:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 22 Sep 2017 17:00:29 +0000 (UTC) User-Agent: NeoMutt/20170912-13-728bb5 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 22 19:00:25 2017 Return-path: Envelope-to: ged-emacs-devel@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 1dvRJP-0002Vk-68 for ged-emacs-devel@m.gmane.org; Fri, 22 Sep 2017 19:00:23 +0200 Original-Received: from localhost ([::1]:60215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvRJW-0006j7-G1 for ged-emacs-devel@m.gmane.org; Fri, 22 Sep 2017 13:00:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvRIq-0006aP-1u for emacs-devel@gnu.org; Fri, 22 Sep 2017 12:59:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvRIm-0001lR-2o for emacs-devel@gnu.org; Fri, 22 Sep 2017 12:59:48 -0400 Original-Received: from mail-qt0-x22b.google.com ([2607:f8b0:400d:c0d::22b]:45132) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dvRIl-0001lI-Sw for emacs-devel@gnu.org; Fri, 22 Sep 2017 12:59:44 -0400 Original-Received: by mail-qt0-x22b.google.com with SMTP id t46so1674284qtj.2 for ; Fri, 22 Sep 2017 09:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fN0cGHxwkcxFY5RhPVRzswYDvwT2vi3Dc8E3H3t1gug=; b=m2ToCB+ZShTcvoTkYbIK/3lT03vjU2LIEVSS6VBXuuZR3Q4eIIkq+YBjbgSdz/U9AT rVJlnyl9VytbGxgSy2MU/00eTOn3b+pSX9HrJ8wsAQRaNL01uzGzi0ES7BrnpGn3hciO pO7NthcwW3mXSpYUltf7uVnLsoqztroZoJudPpkxvic292/6nW2mK0grwXItm2frSsnC RzzxMSgqBwYmR0hNmPsDTL/GSLvibwy+G7+/sLO31OMKTF+73phU4DGGioAsnskytPWm pEgDExHmieas+qJowZCn7r1f4Z8ptOQ7avygcBwe87NH4QMjFwmgywFWREEeLxj9tZK6 Nq3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fN0cGHxwkcxFY5RhPVRzswYDvwT2vi3Dc8E3H3t1gug=; b=NlTetj3YQcj9+zQgavx8riPBITRyAqBfboKSZQG40ZXGi0utCEedN8Zy3KVJejuuhT 0I3WvT8cwOnJc38u9Jba95BUatdIEXr6Osed9KWCJ7FrkB0eahMRscqfzZeWV5+yziNW J7VrNAgzJM2LapyBTHNC+8v5eQWoy0DlYrfK3Pf6DHEZ+4kgqU4rztGCUUmxEz5kWpkU XvuN7sbbdEqyiK6cO7nDTW52jc/MkpU0jISPjLTbQK1f9KVl3PDK+TguYl26QhVQytM6 QFUnsBy+3+n8d0Qu7uInWVmt7F+2UkQM4HorcwuB3lu13LBK6mLPIwFOe80YIjaJL0v9 sBow== X-Gm-Message-State: AHPjjUhLQF+bOR3f4yqTL8WMq5sKUdUEkDeEcIjy0atIwlxP0xvQpkW1 5jlJUCHTgTp8/8IOLNw/UrOf+w== X-Google-Smtp-Source: AOwi7QBi6+ZebH3TN1uh+Ae/eYI0+3WFW+sjL6IyFI3v1flEoXp13W/5FATrQVwUdky/BpTRSGjJyQ== X-Received: by 10.237.57.161 with SMTP id m30mr9343090qte.157.1506099583147; Fri, 22 Sep 2017 09:59:43 -0700 (PDT) Original-Received: from logos.localdomain (pool-173-67-36-61.bltmmd.fios.verizon.net. [173.67.36.61]) by smtp.gmail.com with ESMTPSA id c185sm190610qke.60.2017.09.22.09.59.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Sep 2017 09:59:42 -0700 (PDT) Content-Disposition: inline In-Reply-To: <83wp4yk7ve.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22b 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:218691 Archived-At: On 16/09/17 at 02:58pm, Eli Zaretskii wrote: > > Date: Sat, 16 Sep 2017 10:51:12 -0400 > > From: Mark Oteiza > > Cc: emacs-devel@gnu.org > > > > making the Lisp functions: > > > > lcms-xyz->jch > > lcms-jch->jab > > lcms-jab->jch > > lcms-jch->xyz > > > > and adding a Lisp variable `lcms-d65-xyz' as the default whitepoint for > > all the functions in lcms.c that need one. That should be two commits > > if I can get all the Windows build stuff correct. > > That can certainly go to emacs-26. > > > I plan to add more, but I can wait for an emacs-26 -> master merge and > > continue to work on master. > > If you consider the feature fairly complete for a first release, then > that's fine. Otherwise we could consider adding more of your code to > emacs-26, unless you think the development will take a considerable > time. In general, once the first pretest is out (which will be > probably a week or 2 from now), no new features should be added. I ended up going back on what I said in d24ec5854 after thinking about what I wanted to add, how the API should look, and going through some iterations adding those functions. I think I'll leave it at those three functions for emacs-26. In the interest of reducing the amount of (duplicated) code, especially as more Lisp functions are added, I propose the following. I followed from your code and from how it's done in xml.c, not sure if you have a particular reason for doing it one way or the other. src/lcms.c | 75 ++++++++++++++++++++++---------------------------------------- 1 file changed, 26 insertions(+), 49 deletions(-) diff --git a/src/lcms.c b/src/lcms.c index a5e527911e..950ffb5f51 100644 --- a/src/lcms.c +++ b/src/lcms.c @@ -76,6 +76,26 @@ init_lcms_functions (void) #endif /* WINDOWSNT */ +static bool +lcms2_available_p (void) +{ +#ifdef WINDOWSNT + Lisp_Object found = Fassq (Qlcms2, Vlibrary_cache); + if (CONSP (found)) + return NILP (XCDR (found)) ? false : true; + else + { + Lisp_Object status; + lcms_initialized = init_lcms_functions (); + status = lcms_initialized; + Vlibrary_cache = Fcons (Fcons (Qlcms2, status), Vlibrary_cache); + return status; + } +#else /* !WINDOWSNT */ + return true; +#endif +} + static bool parse_lab_list (Lisp_Object lab_list, cmsCIELab *color) { @@ -109,15 +129,8 @@ chroma, and hue, respectively. The parameters each default to 1. */) cmsCIELab Lab1, Lab2; cmsFloat64Number Kl, Kc, Kh; -#ifdef WINDOWSNT - if (!lcms_initialized) - lcms_initialized = init_lcms_functions (); - if (!lcms_initialized) - { - message1 ("lcms2 library not found"); - return Qnil; - } -#endif + if (!(init_lcms_functions ())) + return Qnil; if (!(CONSP (color1) && parse_lab_list (color1, &Lab1))) signal_error ("Invalid color", color1); @@ -244,15 +257,8 @@ The default viewing conditions are (20 100 1 1). */) double Jp1, ap1, bp1, Jp2, ap2, bp2; double Mp1, Mp2, FL, k, k4; -#ifdef WINDOWSNT - if (!lcms_initialized) - lcms_initialized = init_lcms_functions (); - if (!lcms_initialized) - { - message1 ("lcms2 library not found"); - return Qnil; - } -#endif + if (!(init_lcms_functions ())) + return Qnil; if (!(CONSP (color1) && parse_xyz_list (color1, &xyz1))) signal_error ("Invalid color", color1); @@ -313,15 +319,8 @@ Valid range of TEMPERATURE is from 4000K to 25000K. */) cmsCIExyY whitepoint; cmsCIEXYZ wp; -#ifdef WINDOWSNT - if (!lcms_initialized) - lcms_initialized = init_lcms_functions (); - if (!lcms_initialized) - { - message1 ("lcms2 library not found"); - return Qnil; - } -#endif + if (!(init_lcms_functions ())) + return Qnil; CHECK_NUMBER_OR_FLOAT (temperature); @@ -332,27 +331,6 @@ Valid range of TEMPERATURE is from 4000K to 25000K. */) return list3 (make_float (wp.X), make_float (wp.Y), make_float (wp.Z)); } -DEFUN ("lcms2-available-p", Flcms2_available_p, Slcms2_available_p, 0, 0, 0, - doc: /* Return t if lcms2 color calculations are available in this instance of Emacs. */) - (void) -{ -#ifdef WINDOWSNT - Lisp_Object found = Fassq (Qlcms2, Vlibrary_cache); - if (CONSP (found)) - return XCDR (found); - else - { - Lisp_Object status; - lcms_initialized = init_lcms_functions (); - status = lcms_initialized ? Qt : Qnil; - Vlibrary_cache = Fcons (Fcons (Qlcms2, status), Vlibrary_cache); - return status; - } -#else /* !WINDOWSNT */ - return Qt; -#endif -} - /* Initialization */ void @@ -360,7 +338,6 @@ syms_of_lcms2 (void) { defsubr (&Slcms_cie_de2000); defsubr (&Slcms_cam02_ucs); - defsubr (&Slcms2_available_p); defsubr (&Slcms_temp_to_white_point); Fprovide (intern_c_string ("lcms2"), Qnil);