1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-09 08:21:30 -07:00

Merge from origin/emacs-26

96aaeaaffa ; * src/lcms.c: Minor stylistic changes in comments.
c3df816585 Fix compilation warning in etags.c
5490ccc5eb Add lisp variable lcms-d65-xyz
dee96f4a17 * lisp/emacs-lisp/cl-macs.el (cl-letf): Fix Edebug spec (b...
12e864eb30 Avoid MinGW64 compiler warnings in unexw32.c
625cee5316 Start emacs-26 release branch

# Conflicts:
#	README
#	configure.ac
#	msdos/sed2v2.inp
#	nt/README.W32
This commit is contained in:
Paul Eggert 2017-09-25 11:16:05 -07:00
commit 0c06b93c1e
6 changed files with 46 additions and 21 deletions

View file

@ -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;

View file

@ -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.

View file

@ -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)))

View file

@ -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);

View file

@ -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"

View file

@ -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))