Now on revision 109976. ------------------------------------------------------------ revno: 109976 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-09-11 08:22:03 +0400 message: Convenient macro to check whether the buffer is live. * buffer.h (BUFFER_LIVE_P): New macro. * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c: * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-11 03:32:41 +0000 +++ src/ChangeLog 2012-09-11 04:22:03 +0000 @@ -1,3 +1,10 @@ +2012-09-11 Dmitry Antipov + + Convenient macro to check whether the buffer is live. + * buffer.h (BUFFER_LIVE_P): New macro. + * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c: + * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it. + 2012-09-11 YAMAMOTO Mitsuharu * xdisp.c (right_overwritten, right_overwriting): Also handle gstring === modified file 'src/alloc.c' --- src/alloc.c 2012-09-07 07:24:08 +0000 +++ src/alloc.c 2012-09-11 04:22:03 +0000 @@ -3682,7 +3682,7 @@ struct Lisp_Marker *m; /* No dead buffers here. */ - eassert (!NILP (BVAR (buf, name))); + eassert (BUFFER_LIVE_P (buf)); /* Every character is at least one byte. */ eassert (charpos <= bytepos); === modified file 'src/buffer.c' --- src/buffer.c 2012-09-09 21:11:14 +0000 +++ src/buffer.c 2012-09-11 04:22:03 +0000 @@ -388,7 +388,7 @@ Value is nil if OBJECT is not a buffer or if it has been killed. */) (Lisp_Object object) { - return ((BUFFERP (object) && ! NILP (BVAR (XBUFFER (object), name))) + return ((BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))) ? Qt : Qnil); } @@ -776,7 +776,7 @@ base_buffer = Fget_buffer (base_buffer); if (NILP (base_buffer)) error ("No such buffer: `%s'", SDATA (tem)); - if (NILP (BVAR (XBUFFER (base_buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (base_buffer))) error ("Base buffer has been killed"); if (SCHARS (name) == 0) @@ -1553,7 +1553,7 @@ { buf = XCAR (tail); if (BUFFERP (buf) && !EQ (buf, buffer) - && !NILP (BVAR (XBUFFER (buf), name)) + && BUFFER_LIVE_P (XBUFFER (buf)) && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ') /* If the frame has a buffer_predicate, disregard buffers that don't fit the predicate. */ @@ -1573,7 +1573,7 @@ { buf = Fcdr (XCAR (tail)); if (BUFFERP (buf) && !EQ (buf, buffer) - && !NILP (BVAR (XBUFFER (buf), name)) + && BUFFER_LIVE_P (XBUFFER (buf)) && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ') /* If the frame has a buffer_predicate, disregard buffers that don't fit the predicate. */ @@ -1615,7 +1615,7 @@ { buf = Fcdr (XCAR (tail)); if (BUFFERP (buf) && !EQ (buf, buffer) - && !NILP (BVAR (XBUFFER (buf), name)) + && BUFFER_LIVE_P (XBUFFER (buf)) && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')) return buf; } @@ -1734,7 +1734,7 @@ b = XBUFFER (buffer); /* Avoid trouble for buffer already dead. */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qnil; /* Query if the buffer is still modified. */ @@ -1770,7 +1770,7 @@ } /* If the hooks have killed the buffer, exit now. */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qt; /* We have no more questions to ask. Verify that it is valid @@ -1802,7 +1802,7 @@ UNGCPRO; /* Exit if we now have killed the base buffer (Bug#11665). */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qt; } @@ -1813,7 +1813,7 @@ replace_buffer_in_windows (buffer); /* Exit if replacing the buffer in windows has killed our buffer. */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qt; /* Make this buffer not be current. Exit if it is the sole visible @@ -1846,7 +1846,7 @@ /* Killing buffer processes may run sentinels which may have killed our buffer. */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qt; /* These may run Lisp code and into infinite loops (if someone @@ -1878,7 +1878,7 @@ } /* Deleting an auto-save file could have killed our buffer. */ - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) return Qt; if (b->base_buffer) @@ -2047,7 +2047,7 @@ CHECK_BUFFER (buffer); - if (NILP (BVAR (XBUFFER (buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (buffer))) error ("Attempt to set major mode for a dead buffer"); if (strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) @@ -2183,7 +2183,7 @@ buffer = Fget_buffer (buffer_or_name); if (NILP (buffer)) nsberror (buffer_or_name); - if (NILP (BVAR (XBUFFER (buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (buffer))) error ("Selecting deleted buffer"); set_buffer_internal (XBUFFER (buffer)); return buffer; @@ -2194,7 +2194,7 @@ Lisp_Object set_buffer_if_live (Lisp_Object buffer) { - if (! NILP (BVAR (XBUFFER (buffer), name))) + if (BUFFER_LIVE_P (XBUFFER (buffer))) set_buffer_internal (XBUFFER (buffer)); return Qnil; } @@ -2289,7 +2289,7 @@ CHECK_BUFFER (buffer); other_buffer = XBUFFER (buffer); - if (NILP (BVAR (other_buffer, name))) + if (!BUFFER_LIVE_P (other_buffer)) error ("Cannot swap a dead buffer's text"); /* Actually, it probably works just fine. @@ -2685,7 +2685,7 @@ /* Copy this buffer's new multibyte status into all of its indirect buffers. */ FOR_EACH_BUFFER (other) - if (other->base_buffer == current_buffer && !NILP (BVAR (other, name))) + if (other->base_buffer == current_buffer && BUFFER_LIVE_P (other)) { BVAR (other, enable_multibyte_characters) = BVAR (current_buffer, enable_multibyte_characters); === modified file 'src/buffer.h' --- src/buffer.h 2012-09-04 17:34:54 +0000 +++ src/buffer.h 2012-09-11 04:22:03 +0000 @@ -959,7 +959,10 @@ b->INTERNAL_FIELD (width_table) = val; } - +/* Convenient check whether buffer B is live. */ + +#define BUFFER_LIVE_P(b) (!NILP (BVAR (b, name))) + /* Chain of all buffers, including killed ones. */ extern struct buffer *all_buffers; === modified file 'src/editfns.c' --- src/editfns.c 2012-09-05 17:05:32 +0000 +++ src/editfns.c 2012-09-11 04:22:03 +0000 @@ -2613,7 +2613,7 @@ if (NILP (buf)) nsberror (buffer); bp = XBUFFER (buf); - if (NILP (BVAR (bp, name))) + if (!BUFFER_LIVE_P (bp)) error ("Selecting deleted buffer"); if (NILP (start)) @@ -2677,7 +2677,7 @@ if (NILP (buf1)) nsberror (buffer1); bp1 = XBUFFER (buf1); - if (NILP (BVAR (bp1, name))) + if (!BUFFER_LIVE_P (bp1)) error ("Selecting deleted buffer"); } @@ -2715,7 +2715,7 @@ if (NILP (buf2)) nsberror (buffer2); bp2 = XBUFFER (buf2); - if (NILP (BVAR (bp2, name))) + if (!BUFFER_LIVE_P (bp2)) error ("Selecting deleted buffer"); } === modified file 'src/insdel.c' --- src/insdel.c 2012-09-04 17:34:54 +0000 +++ src/insdel.c 2012-09-11 04:22:03 +0000 @@ -2107,7 +2107,7 @@ non-nil, and insertion calls a file handler (e.g. through lock_file) which scribbles into a temp file -- cyd */ if (!BUFFERP (combine_after_change_buffer) - || NILP (BVAR (XBUFFER (combine_after_change_buffer), name))) + || !BUFFER_LIVE_P (XBUFFER (combine_after_change_buffer))) { combine_after_change_list = Qnil; return Qnil; === modified file 'src/lread.c' --- src/lread.c 2012-09-09 16:06:33 +0000 +++ src/lread.c 2012-09-11 04:22:03 +0000 @@ -1734,7 +1734,7 @@ { ptrdiff_t count1 = SPECPDL_INDEX (); - if (b != 0 && NILP (BVAR (b, name))) + if (b != 0 && !BUFFER_LIVE_P (b)) error ("Reading from killed buffer"); if (!NILP (start)) === modified file 'src/marker.c' --- src/marker.c 2012-09-04 17:34:54 +0000 +++ src/marker.c 2012-09-11 04:22:03 +0000 @@ -407,7 +407,7 @@ does not preserve the buffer from being GC'd (it's weak), so markers have to be unlinked from their buffer as soon as the buffer is killed. */ - eassert (!NILP (BVAR (XBUFFER (buf), name))); + eassert (BUFFER_LIVE_P (XBUFFER (buf))); return buf; } return Qnil; @@ -462,13 +462,13 @@ if (NILP (buffer)) { b = current_buffer; - eassert (!NILP (BVAR (b, name))); + eassert (BUFFER_LIVE_P (b)); } else { CHECK_BUFFER (buffer); b = XBUFFER (buffer); - if (NILP (BVAR (b, name))) + if (!BUFFER_LIVE_P (b)) b = NULL; } return b; @@ -595,7 +595,7 @@ register struct Lisp_Marker *tail, **prev; /* No dead buffers here. */ - eassert (!NILP (BVAR (b, name))); + eassert (BUFFER_LIVE_P (b)); marker->buffer = NULL; prev = &BUF_MARKERS (b); === modified file 'src/minibuf.c' --- src/minibuf.c 2012-09-04 17:34:54 +0000 +++ src/minibuf.c 2012-09-11 04:22:03 +0000 @@ -798,7 +798,7 @@ Vminibuffer_list = nconc2 (Vminibuffer_list, tail); } buf = Fcar (tail); - if (NILP (buf) || NILP (BVAR (XBUFFER (buf), name))) + if (NILP (buf) || !BUFFER_LIVE_P (XBUFFER (buf))) { buf = Fget_buffer_create (make_formatted_string (name, " *Minibuf-%"pI"d*", depth)); === modified file 'src/print.c' --- src/print.c 2012-09-09 16:06:33 +0000 +++ src/print.c 2012-09-11 04:22:03 +0000 @@ -1873,7 +1873,7 @@ } else if (BUFFERP (obj)) { - if (NILP (BVAR (XBUFFER (obj), name))) + if (!BUFFER_LIVE_P (XBUFFER (obj))) strout ("#", -1, -1, printcharfun); else if (escapeflag) { === modified file 'src/process.c' --- src/process.c 2012-09-07 01:27:44 +0000 +++ src/process.c 2012-09-11 04:22:03 +0000 @@ -5298,7 +5298,7 @@ } /* If no filter, write into buffer if it isn't dead. */ - else if (!NILP (p->buffer) && !NILP (BVAR (XBUFFER (p->buffer), name))) + else if (!NILP (p->buffer) && BUFFER_LIVE_P (XBUFFER (p->buffer))) { Lisp_Object old_read_only; ptrdiff_t old_begv, old_zv; @@ -6722,7 +6722,7 @@ /* Avoid error if buffer is deleted (probably that's why the process is dead, too) */ - if (NILP (BVAR (XBUFFER (buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (buffer))) continue; Fset_buffer (buffer); === modified file 'src/window.c' --- src/window.c 2012-09-05 07:18:46 +0000 +++ src/window.c 2012-09-11 04:22:03 +0000 @@ -2668,7 +2668,7 @@ /* Check for a window that has a killed buffer. */ case CHECK_ALL_WINDOWS: if (! NILP (w->buffer) - && NILP (BVAR (XBUFFER (w->buffer), name))) + && !BUFFER_LIVE_P (XBUFFER (w->buffer))) emacs_abort (); break; @@ -3273,7 +3273,7 @@ XSETWINDOW (window, w); buffer = Fget_buffer (buffer_or_name); CHECK_BUFFER (buffer); - if (NILP (BVAR (XBUFFER (buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (buffer))) error ("Attempt to display deleted buffer"); tem = w->buffer; @@ -3338,7 +3338,7 @@ if (STRINGP (object)) object = Fget_buffer (object); - if (BUFFERP (object) && !NILP (BVAR (XBUFFER (object), name))) + if (BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))) { /* Walk all windows looking for buffer, and force update of each of those windows. */ @@ -5549,7 +5549,7 @@ saved_windows = XVECTOR (data->saved_windows); new_current_buffer = data->current_buffer; - if (NILP (BVAR (XBUFFER (new_current_buffer), name))) + if (!BUFFER_LIVE_P (XBUFFER (new_current_buffer))) new_current_buffer = Qnil; else { @@ -5624,7 +5624,7 @@ w = XWINDOW (window); if (!NILP (w->buffer) && !EQ (w->buffer, p->buffer) - && !NILP (BVAR (XBUFFER (p->buffer), name))) + && BUFFER_LIVE_P (XBUFFER (p->buffer))) /* If a window we restore gets another buffer, record the window's old buffer. */ call1 (Qrecord_window_buffer, window); @@ -5774,7 +5774,7 @@ if (NILP (p->buffer)) /* An internal window. */ wset_buffer (w, p->buffer); - else if (!NILP (BVAR (XBUFFER (p->buffer), name))) + else if (BUFFER_LIVE_P (XBUFFER (p->buffer))) /* If saved buffer is alive, install it. */ { wset_buffer (w, p->buffer); @@ -5793,7 +5793,7 @@ Fgoto_char (w->pointm); } else if (!NILP (w->buffer) - && !NILP (BVAR (XBUFFER (w->buffer), name))) + && BUFFER_LIVE_P (XBUFFER (w->buffer))) /* Keep window's old buffer; make sure the markers are real. */ { === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-11 03:32:41 +0000 +++ src/xdisp.c 2012-09-11 04:22:03 +0000 @@ -3667,7 +3667,7 @@ } /* There isn't much we can reasonably do to protect against misbehaving fontification, but here's a fig leaf. */ - else if (!NILP (BVAR (obuf, name))) + else if (BUFFER_LIVE_P (obuf)) set_buffer_internal_1 (obuf); /* The fontification code may have added/removed text. @@ -9910,7 +9910,7 @@ for (i = 0; i < 2; ++i) if (!BUFFERP (echo_buffer[i]) - || NILP (BVAR (XBUFFER (echo_buffer[i]), name))) + || !BUFFER_LIVE_P (XBUFFER (echo_buffer[i]))) { char name[30]; Lisp_Object old_buffer; ------------------------------------------------------------ revno: 109975 committer: YAMAMOTO Mitsuharu branch nick: trunk timestamp: Tue 2012-09-11 12:32:41 +0900 message: Fix wrong overhang display for gstring compositions (Bug#12364). * xdisp.c (right_overwritten, right_overwriting): Also handle gstring composition cases (Bug#12364). * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left overhang of succeeding glyphs overlapping box cursor. * w32term.c (x_draw_glyph_string): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-11 02:28:27 +0000 +++ src/ChangeLog 2012-09-11 03:32:41 +0000 @@ -1,3 +1,13 @@ +2012-09-11 YAMAMOTO Mitsuharu + + * xdisp.c (right_overwritten, right_overwriting): Also handle gstring + composition cases (Bug#12364). + + * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left + overhang of succeeding glyphs overlapping box cursor. + + * w32term.c (x_draw_glyph_string): Likewise. + 2012-09-11 Paul Eggert Simplify, document, and port floating-point (Bug#12381). === modified file 'src/w32term.c' --- src/w32term.c 2012-09-04 17:34:54 +0000 +++ src/w32term.c 2012-09-11 03:32:41 +0000 @@ -2591,6 +2591,7 @@ w32_set_clip_rectangle (next->hdc, NULL); next->hl = save; next->num_clips = 0; + next->clip_head = s->next; } } } === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-11 01:20:56 +0000 +++ src/xdisp.c 2012-09-11 03:32:41 +0000 @@ -23050,7 +23050,8 @@ { int x = 0, i; struct glyph *glyphs = s->row->glyphs[s->area]; - int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars); + int first = (s->first_glyph - glyphs + + (s->first_glyph->type == COMPOSITE_GLYPH ? 1 : s->nchars)); int end = s->row->used[s->area]; for (i = first; i < end && s->right_overhang > x; ++i) @@ -23073,7 +23074,8 @@ int i, k, x; int end = s->row->used[s->area]; struct glyph *glyphs = s->row->glyphs[s->area]; - int first = (s->first_glyph - glyphs) + (s->cmp ? 1 : s->nchars); + int first = (s->first_glyph - glyphs + + (s->first_glyph->type == COMPOSITE_GLYPH ? 1 : s->nchars)); k = -1; x = 0; === modified file 'src/xterm.c' --- src/xterm.c 2012-09-07 01:27:44 +0000 +++ src/xterm.c 2012-09-11 03:32:41 +0000 @@ -2975,6 +2975,7 @@ XSetClipMask (next->display, next->gc, None); next->hl = save; next->num_clips = 0; + next->clip_head = s->next; } } } ------------------------------------------------------------ revno: 109974 committer: Paul Eggert branch nick: trunk timestamp: Mon 2012-09-10 19:28:27 -0700 message: Simplify, document, and port floating-point. The porting part of this patch fixes bugs on non-IEEE platforms with frexp, ldexp, logb. * admin/CPP-DEFINES (HAVE_CBRT, HAVE_LOGB, logb): Remove. * configure.ac (logb, cbrt): Do not check for these functions, as they are not being used. * doc/lispref/numbers.texi (Float Basics, Arithmetic Operations, Math Functions): Document that / and mod (with floating point arguments), along with asin, acos, log, log10, expt and sqrt, return special values instead of signaling exceptions. (Float Basics): Document that logb operates on the absolute value of its argument. (Math Functions): Document that (log ARG BASE) also returns NaN if BASE is negative. Document that (expt X Y) returns NaN if X is a finite negative number and Y a finite non-integer. * etc/NEWS: Document NaNs versus signaling-error change. * src/data.c, src/lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error): Now static. * src/floatfns.c: Simplify discussion of functions that Emacs doesn't support, by removing commented-out code and briefly listing the C89 functions excluded. The commented-out stuff was confusing maintenance, e.g., we thought we needed cbrt but it was commented out. (logb): Remove decl; no longer needed. (isfinite): New macro, if not already supplied. (isnan): Don't replace any existing macro. (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp are present on all C89 platforms. (Ffrexp): Do not special-case zero, as frexp does the right thing for that case. (Flogb): Do not use logb, as it doesn't have the desired meaning on hosts that use non-base-2 floating point. Instead, stick with frexp, which is C89 anyway. Do not pass an infinity or a NaN to frexp, to avoid getting an unspecified result. diff: === modified file 'ChangeLog' --- ChangeLog 2012-09-10 01:03:27 +0000 +++ ChangeLog 2012-09-11 02:28:27 +0000 @@ -1,3 +1,9 @@ +2012-09-11 Paul Eggert + + Simplify, document, and port floating-point (Bug#12381). + * configure.ac (logb, cbrt): Do not check for these functions, + as they are not being used. + 2012-09-10 Paul Eggert Improve robustness of 'make bootstrap' (Bug#12376). === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2012-09-09 16:06:33 +0000 +++ admin/CPP-DEFINES 2012-09-11 02:28:27 +0000 @@ -120,7 +120,6 @@ HAVE_BDFFONT HAVE_BOXES HAVE_C99_STRTOLD -HAVE_CBRT HAVE_CFMAKERAW HAVE_CFSETSPEED HAVE_CLOCK_GETTIME @@ -251,7 +250,6 @@ HAVE_LINUX_VERSION_H HAVE_LOCALTIME_R HAVE_LOCAL_SOCKETS -HAVE_LOGB HAVE_LONG_FILE_NAMES HAVE_LONG_LONG_INT HAVE_LRAND48 @@ -574,7 +572,6 @@ isatty kill link -logb lseek mkdir mktemp @@ -616,7 +613,6 @@ getpid index isatty -logb lseek mkdir mktemp === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-09-09 16:06:33 +0000 +++ admin/ChangeLog 2012-09-11 02:28:27 +0000 @@ -1,3 +1,8 @@ +2012-09-11 Paul Eggert + + Simplify, document, and port floating-point (Bug#12381). + * CPP-DEFINES (HAVE_CBRT, HAVE_LOGB, logb): Remove. + 2012-09-09 Paul Eggert Assume C89 or later for math functions (Bug#12381). === modified file 'configure.ac' --- configure.ac 2012-09-09 16:06:33 +0000 +++ configure.ac 2012-09-11 02:28:27 +0000 @@ -2689,8 +2689,8 @@ AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.]) fi -# fmod, logb, and frexp are found in -lm on most systems. -# On HPUX 9.01, -lm does not contain logb, so check for sqrt. +# sqrt and other floating-point functions such as fmod and frexp +# are found in -lm on most systems. AC_CHECK_LIB(m, sqrt) # Check for mail-locking functions in a "mail" library. Probably this should @@ -2770,7 +2770,7 @@ AC_CHECK_FUNCS(gethostname \ closedir getrusage get_current_dir_name \ -lrand48 logb cbrt setsid \ +lrand48 setsid \ fpathconf select euidaccess getpagesize setlocale \ utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ __fpending strsignal setitimer \ === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-09 07:50:45 +0000 +++ doc/lispref/ChangeLog 2012-09-11 02:28:27 +0000 @@ -1,3 +1,16 @@ +2012-09-11 Paul Eggert + + Simplify, document, and port floating-point (Bug#12381). + * numbers.texi (Float Basics, Arithmetic Operations, Math Functions): + Document that / and mod (with floating point arguments), along + with asin, acos, log, log10, expt and sqrt, return special values + instead of signaling exceptions. + (Float Basics): Document that logb operates on the absolute value + of its argument. + (Math Functions): Document that (log ARG BASE) also returns NaN if + BASE is negative. Document that (expt X Y) returns NaN if X is a + finite negative number and Y a finite non-integer. + 2012-09-09 Chong Yidong * lists.texi (Sets And Lists): Explain that the return value for === modified file 'doc/lispref/numbers.texi' --- doc/lispref/numbers.texi 2012-09-01 01:04:26 +0000 +++ doc/lispref/numbers.texi 2012-09-11 02:28:27 +0000 @@ -196,6 +196,14 @@ correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN. (NaN values can also carry a sign, but for practical purposes there's no significant difference between different NaN values in Emacs Lisp.) + +When a function is documented to return a NaN, it returns an +implementation-defined value when Emacs is running on one of the +now-rare platforms that do not use @acronym{IEEE} floating point. For +example, @code{(log -1.0)} typically returns a NaN, but on +non-@acronym{IEEE} platforms it returns an implementation-defined +value. + Here are the read syntaxes for these special floating point values: @table @asis @@ -241,7 +249,7 @@ @defun logb number This function returns the binary exponent of @var{number}. More -precisely, the value is the logarithm of @var{number} base 2, rounded +precisely, the value is the logarithm of |@var{number}| base 2, rounded down to an integer. @example @@ -694,7 +702,8 @@ quotient downward (towards minus infinity) to an integer, and uses that quotient to compute the remainder. -An @code{arith-error} results if @var{divisor} is 0. +If @var{divisor} is zero, @code{mod} signals an @code{arith-error} +error if both arguments are integers, and returns a NaN otherwise. @example @group @@ -1096,8 +1105,8 @@ @tex @math{\pi/2} @end tex -(inclusive) whose sine is @var{arg}; if, however, @var{arg} is out of -range (outside [@minus{}1, 1]), it signals a @code{domain-error} error. +(inclusive) whose sine is @var{arg}. If @var{arg} is out of range +(outside [@minus{}1, 1]), @code{asin} returns a NaN. @end defun @defun acos arg @@ -1108,8 +1117,8 @@ @tex @math{\pi} @end tex -(inclusive) whose cosine is @var{arg}; if, however, @var{arg} is out -of range (outside [@minus{}1, 1]), it signals a @code{domain-error} error. +(inclusive) whose cosine is @var{arg}. If @var{arg} is out of range +(outside [@minus{}1, 1]), @code{acos} returns a NaN. @end defun @defun atan y &optional x @@ -1141,8 +1150,8 @@ @defun log arg &optional base This function returns the logarithm of @var{arg}, with base @var{base}. If you don't specify @var{base}, the natural base -@math{e} is used. If @var{arg} is negative, it signals a -@code{domain-error} error. +@math{e} is used. If @var{arg} or @var{base} is negative, @code{log} +returns a NaN. @end defun @ignore @@ -1160,21 +1169,21 @@ @end ignore @defun log10 arg -This function returns the logarithm of @var{arg}, with base 10. If -@var{arg} is negative, it signals a @code{domain-error} error. -@code{(log10 @var{x})} @equiv{} @code{(log @var{x} 10)}, at least -approximately. +This function returns the logarithm of @var{arg}, with base 10: +@code{(log10 @var{x})} @equiv{} @code{(log @var{x} 10)}. @end defun @defun expt x y This function returns @var{x} raised to power @var{y}. If both arguments are integers and @var{y} is positive, the result is an integer; in this case, overflow causes truncation, so watch out. +If @var{x} is a finite negative number and @var{y} is a finite +non-integer, @code{expt} returns a NaN. @end defun @defun sqrt arg This returns the square root of @var{arg}. If @var{arg} is negative, -it signals a @code{domain-error} error. +@code{sqrt} returns a NaN. @end defun In addition, Emacs defines the following common mathematical === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-09-04 18:29:04 +0000 +++ etc/ChangeLog 2012-09-11 02:28:27 +0000 @@ -1,3 +1,8 @@ +2012-09-11 Paul Eggert + + Simplify, document, and port floating-point (Bug#12381). + * NEWS: Document NaNs versus signaling-error change. + 2012-09-04 Paul Eggert Give more-useful info on a fatal error (Bug#12328). === modified file 'etc/NEWS' --- etc/NEWS 2012-09-10 19:22:53 +0000 +++ etc/NEWS 2012-09-11 02:28:27 +0000 @@ -729,6 +729,14 @@ must be in the range 1000..9999. It now works with any year supported by the underlying C implementation. +** Floating point + +*** When floating point functions such as `log' are given invalid +arguments, e.g., (log -1.0), they now uniformly return special values +such as NaNs instead of signaling errors. Previously, these functions +returned NaNs on some platforms but signaled errors on others. The affected +functions are acos, asin, tan, exp, expt, log, log10, sqrt, and mod. + ** New function file-name-base. ** New function `tty-top-frame' returns the topmost frame of a text terminal. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-11 01:20:56 +0000 +++ src/ChangeLog 2012-09-11 02:28:27 +0000 @@ -1,5 +1,26 @@ 2012-09-11 Paul Eggert + Simplify, document, and port floating-point (Bug#12381). + The porting part of this patch fixes bugs on non-IEEE platforms + with frexp, ldexp, logb. + * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error): + Now static. + * floatfns.c: Simplify discussion of functions that Emacs doesn't + support, by removing commented-out code and briefly listing the + C89 functions excluded. The commented-out stuff was confusing + maintenance, e.g., we thought we needed cbrt but it was commented out. + (logb): Remove decl; no longer needed. + (isfinite): New macro, if not already supplied. + (isnan): Don't replace any existing macro. + (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp + are present on all C89 platforms. + (Ffrexp): Do not special-case zero, as frexp does the right thing + for that case. + (Flogb): Do not use logb, as it doesn't have the desired meaning + on hosts that use non-base-2 floating point. Instead, stick with + frexp, which is C89 anyway. Do not pass an infinity or a NaN to + frexp, to avoid getting an unspecified result. + * xdisp.c (Qinhibit_debug_on_message): Now static. 2012-09-10 Jan Djärv === modified file 'src/data.c' --- src/data.c 2012-09-09 16:06:33 +0000 +++ src/data.c 2012-09-11 02:28:27 +0000 @@ -71,8 +71,8 @@ Lisp_Object Qcdr; static Lisp_Object Qad_advice_info, Qad_activate_internal; -Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error; -Lisp_Object Qoverflow_error, Qunderflow_error; +static Lisp_Object Qdomain_error, Qsingularity_error, Qunderflow_error; +Lisp_Object Qrange_error, Qoverflow_error; Lisp_Object Qfloatp; Lisp_Object Qnumberp, Qnumber_or_marker_p; === modified file 'src/floatfns.c' --- src/floatfns.c 2012-09-09 16:06:33 +0000 +++ src/floatfns.c 2012-09-11 02:28:27 +0000 @@ -22,9 +22,10 @@ along with GNU Emacs. If not, see . */ -/* C89 requires only these math.h functions: - acos, asin, atan, atan2, ceil, cos, cosh, exp, fabs, floor, fmod, - frexp, ldexp, log, log10, modf, pow, sin, sinh, sqrt, tan, tanh. +/* C89 requires only the following math.h functions, and Emacs omits + the starred functions since we haven't found a use for them: + acos, asin, atan, atan2, ceil, cos, *cosh, exp, fabs, floor, fmod, + frexp, ldexp, log, log10, *modf, pow, sin, *sinh, sqrt, tan, *tanh. */ #include @@ -42,10 +43,12 @@ #include -/* This declaration is omitted on some systems, like Ultrix. */ -#if !defined (HPUX) && defined (HAVE_LOGB) && !defined (logb) -extern double logb (double); -#endif /* not HPUX and HAVE_LOGB and no logb macro */ +#ifndef isfinite +# define isfinite(x) ((x) - (x) == 0) +#endif +#ifndef isnan +# define isnan(x) ((x) != (x)) +#endif /* Extract a Lisp number as a `double', or signal an error. */ @@ -126,9 +129,6 @@ return make_float (d); } -#undef isnan -#define isnan(x) ((x) != (x)) - DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0, doc: /* Return non nil iff argument X is a NaN. */) (Lisp_Object x) @@ -153,6 +153,7 @@ return make_float (copysign (f1, f2)); } +#endif DEFUN ("frexp", Ffrexp, Sfrexp, 1, 1, 0, doc: /* Get significand and exponent of a floating point number. @@ -167,15 +168,9 @@ (Lisp_Object x) { double f = XFLOATINT (x); - - if (f == 0.0) - return Fcons (make_float (0.0), make_number (0)); - else - { - int exponent; - double sgnfcand = frexp (f, &exponent); - return Fcons (make_float (sgnfcand), make_number (exponent)); - } + int exponent; + double sgnfcand = frexp (f, &exponent); + return Fcons (make_float (sgnfcand), make_number (exponent)); } DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0, @@ -187,118 +182,6 @@ CHECK_NUMBER (exponent); return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exponent))); } -#endif - -#if 0 /* Leave these out unless we find there's a reason for them. */ - -DEFUN ("bessel-j0", Fbessel_j0, Sbessel_j0, 1, 1, 0, - doc: /* Return the bessel function j0 of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = j0 (d); - return make_float (d); -} - -DEFUN ("bessel-j1", Fbessel_j1, Sbessel_j1, 1, 1, 0, - doc: /* Return the bessel function j1 of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = j1 (d); - return make_float (d); -} - -DEFUN ("bessel-jn", Fbessel_jn, Sbessel_jn, 2, 2, 0, - doc: /* Return the order N bessel function output jn of ARG. -The first arg (the order) is truncated to an integer. */) - (Lisp_Object n, Lisp_Object arg) -{ - int i1 = extract_float (n); - double f2 = extract_float (arg); - - f2 = jn (i1, f2); - return make_float (f2); -} - -DEFUN ("bessel-y0", Fbessel_y0, Sbessel_y0, 1, 1, 0, - doc: /* Return the bessel function y0 of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = y0 (d); - return make_float (d); -} - -DEFUN ("bessel-y1", Fbessel_y1, Sbessel_y1, 1, 1, 0, - doc: /* Return the bessel function y1 of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = y1 (d); - return make_float (d); -} - -DEFUN ("bessel-yn", Fbessel_yn, Sbessel_yn, 2, 2, 0, - doc: /* Return the order N bessel function output yn of ARG. -The first arg (the order) is truncated to an integer. */) - (Lisp_Object n, Lisp_Object arg) -{ - int i1 = extract_float (n); - double f2 = extract_float (arg); - - f2 = yn (i1, f2); - return make_float (f2); -} - -#endif - -#if 0 /* Leave these out unless we see they are worth having. */ - -DEFUN ("erf", Ferf, Serf, 1, 1, 0, - doc: /* Return the mathematical error function of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = erf (d); - return make_float (d); -} - -DEFUN ("erfc", Ferfc, Serfc, 1, 1, 0, - doc: /* Return the complementary error function of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = erfc (d); - return make_float (d); -} - -DEFUN ("log-gamma", Flog_gamma, Slog_gamma, 1, 1, 0, - doc: /* Return the log gamma of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = lgamma (d); - return make_float (d); -} - -DEFUN ("cube-root", Fcube_root, Scube_root, 1, 1, 0, - doc: /* Return the cube root of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); -#ifdef HAVE_CBRT - d = cbrt (d); -#else - if (d >= 0.0) - d = pow (d, 1.0/3.0); - else - d = -pow (-d, 1.0/3.0); -#endif - return make_float (d); -} - -#endif DEFUN ("exp", Fexp, Sexp, 1, 1, 0, doc: /* Return the exponential base e of ARG. */) @@ -383,63 +266,6 @@ return make_float (d); } -#if 0 /* Not clearly worth adding. */ - -DEFUN ("acosh", Facosh, Sacosh, 1, 1, 0, - doc: /* Return the inverse hyperbolic cosine of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = acosh (d); - return make_float (d); -} - -DEFUN ("asinh", Fasinh, Sasinh, 1, 1, 0, - doc: /* Return the inverse hyperbolic sine of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = asinh (d); - return make_float (d); -} - -DEFUN ("atanh", Fatanh, Satanh, 1, 1, 0, - doc: /* Return the inverse hyperbolic tangent of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = atanh (d); - return make_float (d); -} - -DEFUN ("cosh", Fcosh, Scosh, 1, 1, 0, - doc: /* Return the hyperbolic cosine of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = cosh (d); - return make_float (d); -} - -DEFUN ("sinh", Fsinh, Ssinh, 1, 1, 0, - doc: /* Return the hyperbolic sine of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = sinh (d); - return make_float (d); -} - -DEFUN ("tanh", Ftanh, Stanh, 1, 1, 0, - doc: /* Return the hyperbolic tangent of ARG. */) - (Lisp_Object arg) -{ - double d = extract_float (arg); - d = tanh (d); - return make_float (d); -} -#endif - DEFUN ("abs", Fabs, Sabs, 1, 1, 0, doc: /* Return the absolute value of ARG. */) (register Lisp_Object arg) @@ -477,16 +303,15 @@ if (f == 0.0) value = MOST_NEGATIVE_FIXNUM; - else + else if (isfinite (f)) { -#ifdef HAVE_LOGB - value = logb (f); -#else int ivalue; frexp (f, &ivalue); value = ivalue - 1; -#endif } + else + value = MOST_POSITIVE_FIXNUM; + XSETINT (val, value); return val; } @@ -719,27 +544,9 @@ defsubr (&Sisnan); #ifdef HAVE_COPYSIGN defsubr (&Scopysign); +#endif defsubr (&Sfrexp); defsubr (&Sldexp); -#endif -#if 0 - defsubr (&Sacosh); - defsubr (&Sasinh); - defsubr (&Satanh); - defsubr (&Scosh); - defsubr (&Ssinh); - defsubr (&Stanh); - defsubr (&Sbessel_y0); - defsubr (&Sbessel_y1); - defsubr (&Sbessel_yn); - defsubr (&Sbessel_j0); - defsubr (&Sbessel_j1); - defsubr (&Sbessel_jn); - defsubr (&Serf); - defsubr (&Serfc); - defsubr (&Slog_gamma); - defsubr (&Scube_root); -#endif defsubr (&Sfceiling); defsubr (&Sffloor); defsubr (&Sfround); === modified file 'src/lisp.h' --- src/lisp.h 2012-09-10 01:17:23 +0000 +++ src/lisp.h 2012-09-11 02:28:27 +0000 @@ -2559,8 +2559,7 @@ extern Lisp_Object Qcdr; -extern Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error; -extern Lisp_Object Qoverflow_error, Qunderflow_error; +extern Lisp_Object Qrange_error, Qoverflow_error; extern Lisp_Object Qfloatp; extern Lisp_Object Qnumberp, Qnumber_or_marker_p; ------------------------------------------------------------ revno: 109973 committer: Paul Eggert branch nick: trunk timestamp: Mon 2012-09-10 18:20:56 -0700 message: * xdisp.c (Qinhibit_debug_on_message): Now static. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-10 21:01:45 +0000 +++ src/ChangeLog 2012-09-11 01:20:56 +0000 @@ -1,3 +1,7 @@ +2012-09-11 Paul Eggert + + * xdisp.c (Qinhibit_debug_on_message): Now static. + 2012-09-10 Jan Djärv * nsterm.m (ns_update_begin): Set clip path to whole view by using === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-05 03:37:32 +0000 +++ src/xdisp.c 2012-09-11 01:20:56 +0000 @@ -364,7 +364,7 @@ Lisp_Object Qcenter; static Lisp_Object Qmargin, Qpointer; static Lisp_Object Qline_height; -Lisp_Object Qinhibit_debug_on_message; +static Lisp_Object Qinhibit_debug_on_message; /* These setters are used only in this file, so they can be private. */ static inline void ------------------------------------------------------------ revno: 109972 fixes bug: http://debbugs.gnu.org/12131 committer: Jan D. branch nick: trunk timestamp: Mon 2012-09-10 23:01:45 +0200 message: * nsterm.m (ns_update_begin): Set clip path to whole view by using NSBezierPath. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-10 03:25:10 +0000 +++ src/ChangeLog 2012-09-10 21:01:45 +0000 @@ -1,3 +1,8 @@ +2012-09-10 Jan Djärv + + * nsterm.m (ns_update_begin): Set clip path to whole view by using + NSBezierPath (Bug#12131). + 2012-09-10 Chong Yidong * fns.c (Fdelq, Fdelete): Doc fix. === modified file 'src/nsterm.m' --- src/nsterm.m 2012-09-09 08:44:22 +0000 +++ src/nsterm.m 2012-09-10 21:01:45 +0000 @@ -627,6 +627,8 @@ -------------------------------------------------------------------------- */ { NSView *view = FRAME_NS_VIEW (f); + NSRect r = [view frame]; + NSBezierPath *bp = [NSBezierPath bezierPath]; NSTRACE (ns_update_begin); ns_update_auto_hide_menu_bar (); @@ -634,6 +636,13 @@ ns_updating_frame = f; [view lockFocus]; + /* drawRect may have been called for say the minibuffer, and then clip path + is for the minibuffer. But the display engine may draw more because + we have set the frame as garbaged. So reset clip path to the whole + view. */ + [bp appendBezierPathWithRect: r]; + [bp setClip]; + #ifdef NS_IMPL_GNUSTEP uRect = NSMakeRect (0, 0, 0, 0); #endif ------------------------------------------------------------ revno: 109971 committer: Michael Mauger branch nick: trunk timestamp: Mon 2012-09-10 15:22:53 -0400 message: * progmodes/sql.el: Version 3.1 (sql-db2-escape-newlines): New variable. (sql-escape-newlines-filter): Use it. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-10 14:33:08 +0000 +++ etc/NEWS 2012-09-10 19:22:53 +0000 @@ -344,6 +344,14 @@ *** Accepts \r and \f as whitespace. +** SQL Mode + +*** DB2 added `sql-db2-escape-newlines' + +If non-nil, newlines sent to the command interpreter will be escaped +by a backslash. The default does not escape the newlines and assumes +that the sql statement will be terminated by a semicolon. + ** Diff mode Faces for changes now use the same diff color scheme as in modern VCSes === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-10 15:52:15 +0000 +++ lisp/ChangeLog 2012-09-10 19:22:53 +0000 @@ -1,3 +1,9 @@ +2012-09-10 Michael R. Mauger + + * progmodes/sql.el: Version 3.1 + (sql-db2-escape-newlines): New variable. + (sql-escape-newlines-filter): Use it. + 2012-09-10 Juanma Barranquero * custom.el (custom-theme-load-confirm): Remove unneeded assignment. === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2012-07-13 14:58:12 +0000 +++ lisp/progmodes/sql.el 2012-09-10 19:22:53 +0000 @@ -4,7 +4,7 @@ ;; Author: Alex Schroeder ;; Maintainer: Michael Mauger -;; Version: 3.0 +;; Version: 3.1 ;; Keywords: comm languages processes ;; URL: http://savannah.gnu.org/projects/emacs/ @@ -218,9 +218,12 @@ ;; Michael Mauger -- improved product support ;; Drew Adams -- Emacs 20 support ;; Harald Maier -- sql-send-string -;; Stefan Monnier -- font-lock corrections; code polish +;; Stefan Monnier -- font-lock corrections; +;; code polish ;; Paul Sleigh -- MySQL keyword enhancement ;; Andrew Schein -- sql-port bug +;; Ian Bjorhovde -- db2 escape newlines +;; incorrectly enabled by default @@ -879,6 +882,16 @@ :type 'boolean :group 'SQL) +(defcustom sql-db2-escape-newlines nil + "Non-nil if newlines should be escaped by a backslash in DB2 SQLi. + +When non-nil, Emacs will automatically insert a space and +backslash prior to every newline in multi-line SQL statements as +they are submitted to an interactive DB2 session." + :version "24.3" + :type 'boolean + :group 'SQL) + ;; Customization for SQLite (defcustom sql-sqlite-program (or (executable-find "sqlite3") @@ -3188,20 +3201,23 @@ ;; Using DB2 interactively, newlines must be escaped with " \". ;; The space before the backslash is relevant. + (defun sql-escape-newlines-filter (string) "Escape newlines in STRING. Every newline in STRING will be preceded with a space and a backslash." - (let ((result "") (start 0) mb me) - (while (string-match "\n" string start) - (setq mb (match-beginning 0) - me (match-end 0) - result (concat result - (substring string start mb) - (if (and (> mb 1) - (string-equal " \\" (substring string (- mb 2) mb))) - "" " \\\n")) - start me)) - (concat result (substring string start)))) + (if (not sql-db2-escape-newlines) + string + (let ((result "") (start 0) mb me) + (while (string-match "\n" string start) + (setq mb (match-beginning 0) + me (match-end 0) + result (concat result + (substring string start mb) + (if (and (> mb 1) + (string-equal " \\" (substring string (- mb 2) mb))) + "" " \\\n")) + start me)) + (concat result (substring string start))))) ------------------------------------------------------------ revno: 109970 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2012-09-10 17:52:15 +0200 message: lisp/custom.el (custom-theme-load-confirm): Remove unneeded assignment. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-10 14:40:13 +0000 +++ lisp/ChangeLog 2012-09-10 15:52:15 +0000 @@ -1,3 +1,7 @@ +2012-09-10 Juanma Barranquero + + * custom.el (custom-theme-load-confirm): Remove unneeded assignment. + 2012-09-10 Dan Nicolaescu * vc/diff-mode.el (diff-mode-menu): Bind === modified file 'lisp/custom.el' --- lisp/custom.el 2012-09-09 06:43:47 +0000 +++ lisp/custom.el 2012-09-10 15:52:15 +0000 @@ -1227,7 +1227,7 @@ (save-window-excursion (rename-buffer "*Custom Theme*" t) (emacs-lisp-mode) - (setq window (pop-to-buffer (current-buffer))) + (pop-to-buffer (current-buffer)) (goto-char (point-min)) (prog1 (when (y-or-n-p "Loading a theme can run Lisp code. Really load? ") ;; Offer to save to `custom-safe-themes'. ------------------------------------------------------------ revno: 109969 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2012-09-10 10:40:13 -0400 message: * vc/diff-mode.el (diff-mode-menu): diff-remove-trailing-whitespace. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-10 01:16:13 +0000 +++ lisp/ChangeLog 2012-09-10 14:40:13 +0000 @@ -1,3 +1,8 @@ +2012-09-10 Dan Nicolaescu + + * vc/diff-mode.el (diff-mode-menu): Bind + diff-remove-trailing-whitespace. + 2012-09-10 Stefan Monnier * emacs-lisp/lisp-mode.el (emacs-list-byte-code-comment-re): New var. === modified file 'lisp/vc/diff-mode.el' --- lisp/vc/diff-mode.el 2012-08-15 16:29:11 +0000 +++ lisp/vc/diff-mode.el 2012-09-10 14:40:13 +0000 @@ -178,6 +178,8 @@ ["Unified -> Context" diff-unified->context :help "Convert unified diffs to context diffs"] ;;["Fixup Headers" diff-fixup-modifs (not buffer-read-only)] + ["Remove trailing whitespace" diff-remove-trailing-whitespace + :help "Remove trailing whitespace problems introduced by the diff"] ["Show trailing whitespace" whitespace-mode :style toggle :selected (bound-and-true-p whitespace-mode) :help "Show trailing whitespace in modified lines"] ------------------------------------------------------------ revno: 109968 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2012-09-10 10:33:08 -0400 message: Mention diff-remove-trailing-whitespace. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-09 08:10:56 +0000 +++ etc/NEWS 2012-09-10 14:33:08 +0000 @@ -355,6 +355,9 @@ the face `diff-changed', or `diff-removed' and `diff-added' to highlight changes in context diffs. +*** The new command `diff-remove-trailing-whitespace' fixes trailing +whitespace problems introduced by the diff. + ** Ediff now uses the same color scheme as Diff mode on high color displays. ------------------------------------------------------------ revno: 109967 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2012-09-10 09:37:53 -0400 message: nt/config.nt: Sync with autogen/config.in. (FLOAT_CHECK_DOMAIN, HAVE_FMOD, HAVE_FREXP) (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-09-08 11:20:32 +0000 +++ nt/ChangeLog 2012-09-10 13:37:53 +0000 @@ -1,3 +1,9 @@ +2012-09-10 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (FLOAT_CHECK_DOMAIN, HAVE_FMOD, HAVE_FREXP) + (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove. + 2012-09-08 Eli Zaretskii * configure.bat : Don't leave it set in the === modified file 'nt/config.nt' --- nt/config.nt 2012-09-07 12:15:08 +0000 +++ nt/config.nt 2012-09-10 13:37:53 +0000 @@ -161,10 +161,6 @@ */ #define FIRST_PTY_LETTER 'a' -/* Define if the float library doesn't handle errors by either setting errno, - or signaling SIGFPE. */ -#undef FLOAT_CHECK_DOMAIN - /* Enable compile-time and run-time bounds-checking, and some warnings, without upsetting glibc 2.15+. */ #if defined __OPTIMIZE__ && __OPTIMIZE__ @@ -377,9 +373,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `fmod' function. */ -#define HAVE_FMOD 1 - /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK @@ -392,9 +385,6 @@ /* Define to 1 if using the freetype and fontconfig libraries. */ #undef HAVE_FREETYPE -/* Define to 1 if you have the `frexp' function. */ -#define HAVE_FREXP 1 - /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO @@ -549,9 +539,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define if you have the functions acosh, asinh, and atanh. */ -#undef HAVE_INVERSE_HYPERBOLIC - /* Define to 1 if you have the jpeg library (-ljpeg). */ #undef HAVE_JPEG @@ -1192,9 +1179,6 @@ /* Define if XEditRes should not be used. */ #undef NO_EDITRES -/* Define to 1 if you don't have struct exception in math.h. */ -#define NO_MATHERR 1 - /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O ------------------------------------------------------------ revno: 109966 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-09-10 06:18:11 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-09-07 10:17:37 +0000 +++ autogen/config.in 2012-09-10 10:18:11 +0000 @@ -157,10 +157,6 @@ */ #undef FIRST_PTY_LETTER -/* Define if the float library doesn't handle errors by either setting errno, - or signaling SIGFPE. */ -#undef FLOAT_CHECK_DOMAIN - /* Enable compile-time and run-time bounds-checking, and some warnings, without upsetting glibc 2.15+. */ #if defined __OPTIMIZE__ && __OPTIMIZE__ @@ -371,9 +367,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `fmod' function. */ -#undef HAVE_FMOD - /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK @@ -386,9 +379,6 @@ /* Define to 1 if using the freetype and fontconfig libraries. */ #undef HAVE_FREETYPE -/* Define to 1 if you have the `frexp' function. */ -#undef HAVE_FREXP - /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO @@ -540,9 +530,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define if you have the functions acosh, asinh, and atanh. */ -#undef HAVE_INVERSE_HYPERBOLIC - /* Define to 1 if you have the jpeg library (-ljpeg). */ #undef HAVE_JPEG @@ -1182,9 +1169,6 @@ /* Define if XEditRes should not be used. */ #undef NO_EDITRES -/* Define to 1 if you don't have struct exception in math.h. */ -#undef NO_MATHERR - /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O === modified file 'autogen/configure' --- autogen/configure 2012-09-07 10:17:37 +0000 +++ autogen/configure 2012-09-10 10:18:11 +0000 @@ -8887,38 +8887,6 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct exception" >&5 -$as_echo_n "checking for struct exception... " >&6; } -if test "${emacs_cv_struct_exception+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - emacs_cv_struct_exception=yes -else - emacs_cv_struct_exception=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_struct_exception" >&5 -$as_echo "$emacs_cv_struct_exception" >&6; } -HAVE_EXCEPTION=$emacs_cv_struct_exception -if test $emacs_cv_struct_exception != yes || test $opsys = darwin; then - -$as_echo "#define NO_MATHERR 1" >>confdefs.h - -fi - @@ -13209,7 +13177,7 @@ for ac_func in gethostname \ closedir getrusage get_current_dir_name \ -lrand48 logb frexp fmod cbrt setsid \ +lrand48 logb cbrt setsid \ fpathconf select euidaccess getpagesize setlocale \ utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ __fpending strsignal setitimer \ @@ -14858,10 +14826,6 @@ $as_echo "#define CLASH_DETECTION 1" >>confdefs.h - - - - ## Note: PTYs are broken on darwin <6. Use at your own risk. $as_echo "#define HAVE_PTYS 1" >>confdefs.h ------------------------------------------------------------ revno: 109965 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-09-10 11:25:10 +0800 message: * fns.c (Fdelq, Fdelete): Doc fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-10 01:17:23 +0000 +++ src/ChangeLog 2012-09-10 03:25:10 +0000 @@ -1,3 +1,7 @@ +2012-09-10 Chong Yidong + + * fns.c (Fdelq, Fdelete): Doc fix. + 2012-09-10 Paul Eggert * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL) === modified file 'src/fns.c' --- src/fns.c 2012-09-05 07:18:46 +0000 +++ src/fns.c 2012-09-10 03:25:10 +0000 @@ -1527,11 +1527,14 @@ } DEFUN ("delq", Fdelq, Sdelq, 2, 2, 0, - doc: /* Delete by side effect any occurrences of ELT as a member of LIST. -The modified LIST is returned. Comparison is done with `eq'. -If the first member of LIST is ELT, there is no way to remove it by side effect; -therefore, write `(setq foo (delq element foo))' -to be sure of changing the value of `foo'. */) + doc: /* Delete members of LIST which are `eq' to ELT, and return the result. +More precisely, this function skips any members `eq' to ELT at the +front of LIST, then removes members `eq' to ELT from the remaining +sublist by modifying its list structure, then returns the resulting +list. + +Write `(setq foo (delq element foo))' to be sure of correctly changing +the value of a list `foo'. */) (register Lisp_Object elt, Lisp_Object list) { register Lisp_Object tail, prev; @@ -1559,13 +1562,19 @@ } DEFUN ("delete", Fdelete, Sdelete, 2, 2, 0, - doc: /* Delete by side effect any occurrences of ELT as a member of SEQ. -SEQ must be a list, a vector, or a string. -The modified SEQ is returned. Comparison is done with `equal'. -If SEQ is not a list, or the first member of SEQ is ELT, deleting it -is not a side effect; it is simply using a different sequence. -Therefore, write `(setq foo (delete element foo))' -to be sure of changing the value of `foo'. */) + doc: /* Delete members of SEQ which are `equal' to ELT, and return the result. +SEQ must be a sequence (i.e. a list, a vector, or a string). +The return value is a sequence of the same type. + +If SEQ is a list, this behaves like `delq', except that it compares +with `equal' instead of `eq'. In particular, it may remove elements +by altering the list structure. + +If SEQ is not a list, deletion is never performed destructively; +instead this function creates and returns a new vector or string. + +Write `(setq foo (delete element foo))' to be sure of correctly +changing the value of a sequence `foo'. */) (Lisp_Object elt, Lisp_Object seq) { if (VECTORP (seq))