commit 0fae08d0072f74d97ca70b91a4d46d8d28a03952 (HEAD, refs/remotes/origin/master) Author: Tom Tromey Date: Sun Mar 5 17:16:00 2017 -0700 Fix typos in EIEIO manual * doc/misc/eieio.texi (Slot Options, Class Options): Fix typos. diff --git a/doc/misc/eieio.texi b/doc/misc/eieio.texi index ce31bc84b4..dfae565dee 100644 --- a/doc/misc/eieio.texi +++ b/doc/misc/eieio.texi @@ -479,31 +479,31 @@ Name of a generic function which can be used to fetch the value of this slot. You can call this function later on your object and retrieve the value of the slot. -This options is in the CLOS spec, but is not fully compliant in @eieio{}. +This option is in the CLOS spec, but is not fully compliant in @eieio{}. @item :writer Name of a generic function which will write this slot. -This options is in the CLOS spec, but is not fully compliant in @eieio{}. +This option is in the CLOS spec, but is not fully compliant in @eieio{}. @item :reader Name of a generic function which will read this slot. -This options is in the CLOS spec, but is not fully compliant in @eieio{}. +This option is in the CLOS spec, but is not fully compliant in @eieio{}. @item :custom A custom :type specifier used when editing an object of this type. See documentation for @code{defcustom} for details. This specifier is equivalent to the :type spec of a @code{defcustom} call. -This options is specific to Emacs, and is not in the CLOS spec. +This option is specific to Emacs, and is not in the CLOS spec. @item :label When customizing an object, the value of :label will be used instead of the slot name. This enables better descriptions of the data than would usually be afforded. -This options is specific to Emacs, and is not in the CLOS spec. +This option is specific to Emacs, and is not in the CLOS spec. @item :group Similar to @code{defcustom}'s :group command, this organizes different @@ -511,7 +511,7 @@ slots in an object into groups. When customizing an object, only the slots belonging to a specific group need be worked with, simplifying the size of the display. -This options is specific to Emacs, and is not in the CLOS spec. +This option is specific to Emacs, and is not in the CLOS spec. @item :printer This routine takes a symbol which is a function name. The function @@ -546,7 +546,7 @@ Access this slot only from methods of the same class or a child class. Access this slot only from methods of the same class. @end table -This options is specific to Emacs, and is not in the CLOS spec. +This option is specific to Emacs, and is not in the CLOS spec. @end table @@ -571,7 +571,7 @@ the @code{:type} is specifies something such as @code{string} then allow this to pass. The default is to have this option be off. This is implemented as an alternative to unbound slots. -This options is specific to Emacs, and is not in the CLOS spec. +This option is specific to Emacs, and is not in the CLOS spec. @item :abstract A class which is @code{:abstract} cannot be instantiated, and instead commit 040644302120bfb11f28461aadb96c14e39f8630 Author: Paul Eggert Date: Sun Mar 5 13:30:32 2017 -0800 Merge from gnulib This incorporates: 2017-03-04 dtotimespec: simplify * lib/dtotimespec.c: Copy from gnulib. diff --git a/lib/dtotimespec.c b/lib/dtotimespec.c index 9d81b68d81..3ca5a9cfd3 100644 --- a/lib/dtotimespec.c +++ b/lib/dtotimespec.c @@ -29,15 +29,9 @@ struct timespec dtotimespec (double sec) { - double min_representable = TYPE_MINIMUM (time_t); - double max_representable = - ((TYPE_MAXIMUM (time_t) * (double) TIMESPEC_RESOLUTION - + (TIMESPEC_RESOLUTION - 1)) - / TIMESPEC_RESOLUTION); - - if (! (min_representable < sec)) + if (! (TYPE_MINIMUM (time_t) < sec)) return make_timespec (TYPE_MINIMUM (time_t), 0); - else if (! (sec < max_representable)) + else if (! (sec < 1.0 + TYPE_MAXIMUM (time_t))) return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_RESOLUTION - 1); else { commit 53f3dd66f12660a47018fc03d50d460787ab6f64 Author: Paul Eggert Date: Sun Mar 5 13:29:28 2017 -0800 ffloor etc. now accept only floats * etc/NEWS: Say why. * src/floatfns.c (Ffceiling, Fffloor, Ffround, Fftruncate): Require arg to be float. * test/src/floatfns-tests.el (fround-fixnum): Check this. diff --git a/etc/NEWS b/etc/NEWS index fe02236ecc..8f7356f3e0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -908,6 +908,12 @@ due to internal rounding errors. For example, (< most-positive-fixnum (+ 1.0 most-positive-fixnum)) now correctly returns t on 64-bit hosts. --- +** The functions 'ffloor', 'fceiling', 'ftruncate' and 'fround' now +accept only floating-point arguments, as per their documentation. +Formerly, they quietly accepted integer arguments and sometimes +returned nonsensical answers, e.g., (< N (ffloor N)) could return t. + +--- ** On hosts like GNU/Linux x86-64 where a 'long double' fraction contains at least EMACS_INT_WIDTH - 3 bits, 'format' no longer returns incorrect answers due to internal rounding errors when formatting diff --git a/src/floatfns.c b/src/floatfns.c index 9ae810669e..4c09036ac7 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -504,17 +504,19 @@ DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0, \(Round toward +inf.) */) (Lisp_Object arg) { - double d = extract_float (arg); + CHECK_FLOAT (arg); + double d = XFLOAT_DATA (arg); d = ceil (d); return make_float (d); } DEFUN ("ffloor", Fffloor, Sffloor, 1, 1, 0, doc: /* Return the largest integer no greater than ARG, as a float. -\(Round towards -inf.) */) +\(Round toward -inf.) */) (Lisp_Object arg) { - double d = extract_float (arg); + CHECK_FLOAT (arg); + double d = XFLOAT_DATA (arg); d = floor (d); return make_float (d); } @@ -523,17 +525,19 @@ DEFUN ("fround", Ffround, Sfround, 1, 1, 0, doc: /* Return the nearest integer to ARG, as a float. */) (Lisp_Object arg) { - double d = extract_float (arg); + CHECK_FLOAT (arg); + double d = XFLOAT_DATA (arg); d = emacs_rint (d); return make_float (d); } DEFUN ("ftruncate", Fftruncate, Sftruncate, 1, 1, 0, doc: /* Truncate a floating point number to an integral float value. -Rounds the value toward zero. */) +\(Round toward zero.) */) (Lisp_Object arg) { - double d = extract_float (arg); + CHECK_FLOAT (arg); + double d = XFLOAT_DATA (arg); d = emacs_trunc (d); return make_float (d); } diff --git a/test/src/floatfns-tests.el b/test/src/floatfns-tests.el index cdfb8244f5..de3e44314f 100644 --- a/test/src/floatfns-tests.el +++ b/test/src/floatfns-tests.el @@ -28,4 +28,10 @@ (ert-deftest logb-extreme-fixnum () (should (= (logb most-negative-fixnum) (1+ (logb most-positive-fixnum))))) +(ert-deftest fround-fixnum () + (should-error (ffloor 0) :type 'wrong-type-argument) + (should-error (fceiling 0) :type 'wrong-type-argument) + (should-error (ftruncate 0) :type 'wrong-type-argument) + (should-error (fround 0) :type 'wrong-type-argument)) + (provide 'floatfns-tests) commit 788a5b8447253fdbbb171d3219acbd7600bb465a Author: Paul Eggert Date: Sun Mar 5 08:18:40 2017 -0800 ; Spelling fixes diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el index b4ceefb9b1..7e886fba08 100644 --- a/lisp/emacs-lisp/cl-print.el +++ b/lisp/emacs-lisp/cl-print.el @@ -1,4 +1,4 @@ -;;; cl-print.el --- CL-style generic printer facilies -*- lexical-binding: t; -*- +;;; cl-print.el --- CL-style generic printing -*- lexical-binding: t; -*- ;; Copyright (C) 2017 Free Software Foundation, Inc. diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index f0a1cf1200..8b9bb037e9 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el @@ -1642,7 +1642,7 @@ just try dropping it.")) ;;; Various movement directions (defun dun-movement (dir) - "Return enumeral of movement symbol DIR." + "Return number associated with movement symbol DIR." (cdr (assq dir dun-movement-alist))) (defun dun-n (_args) diff --git a/src/insdel.c b/src/insdel.c index 5a95d41e7a..e4ad9a2dec 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -571,7 +571,7 @@ make_gap (ptrdiff_t nbytes_added) * With /1024 => 51s * With /4096 => 131s * With /∞ => gave up after 858s - * Of couse, ideally we should never call set-buffer-multibyte on + * Of course, ideally we should never call set-buffer-multibyte on * a non-empty buffer (e.g. use buffer-swap-text instead). * We chose /64 because it already brings almost the best performance while * limiting the potential wasted memory to 1.5%. */ diff --git a/test/src/floatfns-tests.el b/test/src/floatfns-tests.el index 448d6167f2..cdfb8244f5 100644 --- a/test/src/floatfns-tests.el +++ b/test/src/floatfns-tests.el @@ -1,4 +1,4 @@ -;;; floatfn-tests.el --- tests for floating point operations +;;; floatfns-tests.el --- tests for floating point operations ;; Copyright 2017 Free Software Foundation, Inc. commit a0c8531c9db89e6e7f053f656cae592465be8220 Author: Eli Zaretskii Date: Sun Mar 5 17:56:12 2017 +0200 ; * doc/misc/cl.texi (Top): Add Concept Index to the main menu. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 98898b9eec..079f534168 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -77,6 +77,7 @@ Appendices Indexes * Function Index:: An entry for each documented function. * Variable Index:: An entry for each documented variable. +* Concept Index:: An entry for each concept. @end menu @node Overview commit 8e1ae12c37d373007daabcba51b78163a88e55f4 Author: Eli Zaretskii Date: Sun Mar 5 17:49:22 2017 +0200 Fix display of cursor on underlined text * src/nsterm.m (ns_draw_text_decoration): * src/xterm.c (x_draw_glyph_string): * src/w32term.c (x_draw_glyph_string): Compute the position and thickness of the underline by looking for the first glyph of the run of underlined glyphs that includes the glyph string we are drawing. (Bug#25845) diff --git a/src/nsterm.m b/src/nsterm.m index 80261d6d76..bc89925b0e 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3043,11 +3043,29 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar cursors. } else { - struct font *font; - unsigned long descent; + /* If we are drawing in the middle of a glyph row, find + the first glyph in the run of underlined glyphs + preceding the beginning of glyph string S. This is + because that glyph determines the underline position + and thickness for the entire run of the underlined + glyphs. */ + struct glyph *g0 = s->row->glyphs[s->area], *g; + + for (g = s->first_glyph - 1; g >= g0; g--) + { + struct face *prev_face = FACE_FROM_ID (s->f, g->face_id); + if (!(prev_face && prev_face->underline_p)) + break; + } + + /* Now use the font of the last glyph we saw that + still has the underlined_p flag set. */ + struct face *glyph_face = FACE_FROM_ID (s->f, g[1].face_id); + struct font *font = glyph_face->font; + if (font) + font_prepare_for_face (s->f, glyph_face); - font=s->font; - descent = s->y + s->height - s->ybase; + unsigned long descent = s->y + s->height - s->ybase; /* Use underline thickness of font, defaulting to 1. */ thickness = (font && font->underline_thickness > 0) diff --git a/src/w32term.c b/src/w32term.c index 28bf6fb3d9..6a98fc721c 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -2433,9 +2433,31 @@ x_draw_glyph_string (struct glyph_string *s) } else { + /* If we are drawing in the middle of a glyph row, + find the first glyph in the run of underlined + glyphs preceding the beginning of glyph string S. + This is because that glyph determines the + underline position and thickness for the entire + run of the underlined glyphs. */ + struct glyph *g0 = s->row->glyphs[s->area], *g; + + for (g = s->first_glyph - 1; g >= g0; g--) + { + struct face *prev_face = FACE_FROM_ID (s->f, g->face_id); + if (!(prev_face && prev_face->underline_p)) + break; + } + + /* Now use the font of the last glyph we saw that + still has the underlined_p flag set. */ + struct face *glyph_face = FACE_FROM_ID (s->f, g[1].face_id); + struct font *font = glyph_face->font; + if (font) + font_prepare_for_face (s->f, glyph_face); + /* Get the underline thickness. Default is 1 pixel. */ - if (s->font && s->font->underline_thickness > 0) - thickness = s->font->underline_thickness; + if (font && font->underline_thickness > 0) + thickness = font->underline_thickness; else thickness = 1; if (x_underline_at_descent_line) @@ -2451,10 +2473,10 @@ x_draw_glyph_string (struct glyph_string *s) ROUND (x) = floor (x + 0.5) */ if (x_use_underline_position_properties - && s->font && s->font->underline_position >= 0) - position = s->font->underline_position; - else if (s->font) - position = (s->font->descent + 1) / 2; + && font && font->underline_position >= 0) + position = font->underline_position; + else if (font) + position = (font->descent + 1) / 2; } position = max (position, underline_minimum_offset); } @@ -2465,7 +2487,7 @@ x_draw_glyph_string (struct glyph_string *s) if (s->y + s->height < s->ybase + position + thickness) thickness = (s->y + s->height) - (s->ybase + position); s->underline_thickness = thickness; - s->underline_position =position; + s->underline_position = position; y = s->ybase + position; if (s->face->underline_defaulted_p) { diff --git a/src/xterm.c b/src/xterm.c index 24d1702cec..57e64c4888 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3636,9 +3636,31 @@ x_draw_glyph_string (struct glyph_string *s) } else { + /* If we are drawing in the middle of a glyph row, + find the first glyph in the run of underlined + glyphs preceding the beginning of glyph string S. + This is because that glyph determines the + underline position and thickness for the entire + run of the underlined glyphs. */ + struct glyph *g0 = s->row->glyphs[s->area], *g; + + for (g = s->first_glyph - 1; g >= g0; g--) + { + struct face *prev_face = FACE_FROM_ID (s->f, g->face_id); + if (!(prev_face && prev_face->underline_p)) + break; + } + + /* Now use the font of the last glyph we saw that + still has the underlined_p flag set. */ + struct face *glyph_face = FACE_FROM_ID (s->f, g[1].face_id); + struct font *font = glyph_face->font; + if (font) + font_prepare_for_face (s->f, glyph_face); + /* Get the underline thickness. Default is 1 pixel. */ - if (s->font && s->font->underline_thickness > 0) - thickness = s->font->underline_thickness; + if (font && font->underline_thickness > 0) + thickness = font->underline_thickness; else thickness = 1; if (x_underline_at_descent_line) @@ -3654,10 +3676,10 @@ x_draw_glyph_string (struct glyph_string *s) ROUND(x) = floor (x + 0.5) */ if (x_use_underline_position_properties - && s->font && s->font->underline_position >= 0) - position = s->font->underline_position; - else if (s->font) - position = (s->font->descent + 1) / 2; + && font && font->underline_position >= 0) + position = font->underline_position; + else if (font) + position = (font->descent + 1) / 2; else position = underline_minimum_offset; } commit 67073248693bf460a92769cbea06168aa7b720c6 Author: Mark Oteiza Date: Sun Mar 5 10:45:11 2017 -0500 Add more CL concept index items, print Concept Index * doc/misc/cl.texi: Print concept index. (Generalized Variables, Variable Bindings): (Dynamic Bindings, Function Bindings, Macro Bindings, Conditionals): (Blocks and Exits, Iteration, Multiple Values): Add concept index items. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 338d3345ff..98898b9eec 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -888,6 +888,7 @@ provides an even more convenient way to swap two variables; @node Generalized Variables @section Generalized Variables +@cindex generalized variable A @dfn{generalized variable} or @dfn{place form} is one of the many places in Lisp memory where values can be stored. The simplest place @@ -1252,6 +1253,7 @@ of symbol macros; @pxref{Macro Bindings}. @node Variable Bindings @section Variable Bindings +@cindex variable binding @noindent These Lisp forms make bindings to variables and function names, @@ -1268,6 +1270,7 @@ are also related to variable bindings. @node Dynamic Bindings @subsection Dynamic Bindings +@cindex dynamic binding @noindent The standard @code{let} form binds variables whose names are known @@ -1288,6 +1291,7 @@ are ignored. @node Function Bindings @subsection Function Bindings +@cindex function binding @noindent These forms make @code{let}-like bindings to functions instead @@ -1341,6 +1345,7 @@ differently. @xref{Obsolete Macros}. @node Macro Bindings @subsection Macro Bindings +@cindex macro binding @noindent These forms create local macros and ``symbol macros''. @@ -1434,6 +1439,7 @@ works much like @code{my-dolist}. @node Conditionals @section Conditionals +@cindex conditionals @noindent These conditional forms augment Emacs Lisp's simple @code{if}, @@ -1509,6 +1515,7 @@ simply returning @code{nil}. @node Blocks and Exits @section Blocks and Exits @cindex block +@cindex exit @noindent Common Lisp @dfn{blocks} provide a non-local exit mechanism very @@ -1588,6 +1595,7 @@ Labels have lexical scope and dynamic extent. @node Iteration @section Iteration +@cindex iteration @noindent The macros described here provide more sophisticated, high-level @@ -2483,6 +2491,7 @@ buffers are Emacs-specific extensions. @node Multiple Values @section Multiple Values +@cindex multiple values @noindent Common Lisp functions can return zero or more results. Emacs Lisp @@ -5200,12 +5209,14 @@ that called @code{get-setf-method}. @node Function Index @unnumbered Function Index - @printindex fn @node Variable Index @unnumbered Variable Index - @printindex vr +@node Concept Index +@unnumbered Concept Index +@printindex cp + @bye commit b2b8cc06958ebfc5ed005a965da590e463a77902 Author: Mark Oteiza Date: Sun Mar 5 10:28:53 2017 -0500 Add 'loop facility' to the CL concept index * doc/misc/cl.texi (Loop Facility): Add "loop facility" as a concept index item. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 8baa0bd88c..338d3345ff 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -1728,6 +1728,7 @@ iterating over vectors or lists. @node Loop Facility @section Loop Facility +@cindex loop facility @noindent A common complaint with Lisp's traditional looping constructs was commit 702aecac26accb6afb65c5482f76b3666573d9d2 Author: martin rudalics Date: Sun Mar 5 12:26:26 2017 +0100 In `window--display-buffer' fix behavior reported in Bug#25946 * lisp/window.el (window--display-buffer): Set the dedicated status of the window used and clear its history of previous buffers also for the case that the window already shows the buffer to be displayed. (Bug#25946) diff --git a/lisp/window.el b/lisp/window.el index 358d7bc58f..505024342e 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6643,11 +6643,11 @@ live." (display-buffer-record-window type window buffer) (unless (eq buffer (window-buffer window)) (set-window-dedicated-p window nil) - (set-window-buffer window buffer) - (when dedicated - (set-window-dedicated-p window dedicated)) - (when (memq type '(window frame)) - (set-window-prev-buffers window nil))) + (set-window-buffer window buffer)) + (when dedicated + (set-window-dedicated-p window dedicated)) + (when (memq type '(window frame)) + (set-window-prev-buffers window nil)) (let ((quit-restore (window-parameter window 'quit-restore)) (height (cdr (assq 'window-height alist))) (width (cdr (assq 'window-width alist)))