diff --git a/lib-src/etags.c b/lib-src/etags.c index 4000f47a414..009cba528d7 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -7068,14 +7068,16 @@ etags_mktmp (void) errno = temp_errno; templt = NULL; } - #if defined (DOS_NT) - /* The file name will be used in shell redirection, so it needs to have - DOS-style backslashes, or else the Windows shell will barf. */ - char *p; - for (p = templt; *p; p++) - if (*p == '/') - *p = '\\'; + else + { + /* The file name will be used in shell redirection, so it needs to have + DOS-style backslashes, or else the Windows shell will barf. */ + char *p; + for (p = templt; *p; p++) + if (*p == '/') + *p = '\\'; + } #endif return templt; diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 1e13e950476..6b67555770f 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1159,7 +1159,7 @@ Show the buffer in another window, but don't select it." (unless (eq symbol basevar) (message "`%s' is an alias for `%s'" symbol basevar)))) -(defvar customize-changed-options-previous-release "24.5" +(defvar customize-changed-options-previous-release "25.3" "Version for `customize-changed-options' to refer back to by default.") ;; Packages will update this variable, so make it available. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index d90e70d3d8b..32ba0ac3091 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2438,7 +2438,9 @@ As a special case, if `(PLACE)' is used instead of `(PLACE VALUE)', the PLACE is not modified before executing BODY. \(fn ((PLACE VALUE) ...) BODY...)" - (declare (indent 1) (debug ((&rest (gate gv-place &optional form)) body))) + (declare (indent 1) (debug ((&rest [&or (symbolp form) + (gate gv-place &optional form)]) + body))) (if (and (not (cdr bindings)) (cdar bindings) (symbolp (caar bindings))) `(let ,bindings ,@body) (cl--letf bindings () () body))) diff --git a/src/lcms.c b/src/lcms.c index 1f3ace3baac..f543a030399 100644 --- a/src/lcms.c +++ b/src/lcms.c @@ -102,7 +102,7 @@ DEFUN ("lcms-cie-de2000", Flcms_cie_de2000, Slcms_cie_de2000, 2, 5, 0, Each color is a list of L*a*b* coordinates, where the L* channel ranges from 0 to 100, and the a* and b* channels range from -128 to 128. Optional arguments KL, KC, KH are weighting parameters for lightness, -chroma, and hue, respectively. The parameters each default to 1. */) +chroma, and hue, respectively. The parameters each default to 1. */) (Lisp_Object color1, Lisp_Object color2, Lisp_Object kL, Lisp_Object kC, Lisp_Object kH) { @@ -162,8 +162,8 @@ parse_xyz_list (Lisp_Object xyz_list, cmsCIEXYZ *color) DEFUN ("lcms-cam02-ucs", Flcms_cam02_ucs, Slcms_cam02_ucs, 2, 3, 0, doc: /* Compute CAM02-UCS metric distance between COLOR1 and COLOR2. -Each color is a list of XYZ coordinates, with Y scaled to unity. -Optional argument is the XYZ white point, which defaults to illuminant D65. */) +Each color is a list of XYZ coordinates, with Y scaled about unity. +Optional argument is the XYZ white point, which defaults to illuminant D65. */) (Lisp_Object color1, Lisp_Object color2, Lisp_Object whitepoint) { cmsViewingConditions vc; @@ -186,15 +186,11 @@ Optional argument is the XYZ white point, which defaults to illuminant D65. */) if (!(CONSP (color1) && parse_xyz_list (color1, &xyz1))) signal_error ("Invalid color", color1); if (!(CONSP (color2) && parse_xyz_list (color2, &xyz2))) - signal_error ("Invalid color", color1); + signal_error ("Invalid color", color2); if (NILP (whitepoint)) - { - xyzw.X = 95.047; - xyzw.Y = 100.0; - xyzw.Z = 108.883; - } + parse_xyz_list (Vlcms_d65_xyz, &xyzw); else if (!(CONSP (whitepoint) && parse_xyz_list (whitepoint, &xyzw))) - signal_error("Invalid white point", whitepoint); + signal_error ("Invalid white point", whitepoint); vc.whitePoint.X = xyzw.X; vc.whitePoint.Y = xyzw.Y; @@ -243,7 +239,7 @@ Optional argument is the XYZ white point, which defaults to illuminant D65. */) DEFUN ("lcms-temp->white-point", Flcms_temp_to_white_point, Slcms_temp_to_white_point, 1, 1, 0, doc: /* Return XYZ black body chromaticity from TEMPERATURE given in K. -Valid range of TEMPERATURE is from 4000K to 25000K. */) +Valid range of TEMPERATURE is from 4000K to 25000K. */) (Lisp_Object temperature) { cmsFloat64Number tempK; @@ -295,6 +291,12 @@ DEFUN ("lcms2-available-p", Flcms2_available_p, Slcms2_available_p, 0, 0, 0, void syms_of_lcms2 (void) { + DEFVAR_LISP ("lcms-d65-xyz", Vlcms_d65_xyz, + doc: /* D65 illuminant as a CIE XYZ triple. */); + Vlcms_d65_xyz = list3 (make_float (0.950455), + make_float (1.0), + make_float (1.088753)); + defsubr (&Slcms_cie_de2000); defsubr (&Slcms_cam02_ucs); defsubr (&Slcms2_available_p); diff --git a/src/unexw32.c b/src/unexw32.c index 0c6b48342e5..e97a52ba07a 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -471,7 +471,7 @@ get_section_info (file_data *p_infile) } /* Format to print a DWORD_PTR value. */ -#ifdef MINGW_W64 +#if defined MINGW_W64 && defined _WIN64 # define pDWP "16llx" #else # define pDWP "08lx" diff --git a/test/src/lcms-tests.el b/test/src/lcms-tests.el index 74648e1979e..962902eb100 100644 --- a/test/src/lcms-tests.el +++ b/test/src/lcms-tests.el @@ -33,6 +33,9 @@ (require 'ert) (require 'color) +(defconst lcms-colorspacious-d65 '(0.95047 1.0 1.08883) + "D65 white point from colorspacious.") + (defun lcms-approx-p (a b &optional delta) "Check if A and B are within relative error DELTA of one another. B is considered the exact value." @@ -46,6 +49,22 @@ B is considered the exact value." (lcms-approx-p a2 b2 delta) (lcms-approx-p a3 b3 delta)))) +(ert-deftest lcms-cri-cam02-ucs () + "Test use of `lcms-cam02-ucs'." + (should-error (lcms-cam02-ucs '(0 0 0) '(0 0 0) "error")) + (should-error (lcms-cam02-ucs '(0 0 0) 'error)) + (should-not + (lcms-approx-p + (let ((lcms-d65-xyz '(0.44757 1.0 0.40745))) + (lcms-cam02-ucs '(0.5 0.5 0.5) '(0 0 0))) + (lcms-cam02-ucs '(0.5 0.5 0.5) '(0 0 0)))) + (should (eql 0.0 (lcms-cam02-ucs '(0.5 0.5 0.5) '(0.5 0.5 0.5)))) + (should + (lcms-approx-p (lcms-cam02-ucs lcms-colorspacious-d65 + '(0 0 0) + lcms-colorspacious-d65) + 100.0))) + (ert-deftest lcms-whitepoint () "Test use of `lcms-temp->white-point'." (skip-unless (featurep 'lcms2))