* src/callproc.c: Indentation fixup.
[bpt/emacs.git] / src / ChangeLog
index f109718..625dfb0 100644 (file)
@@ -1,4 +1,239 @@
-2011-04-19  Paul Eggert  <eggert@cs.ucla.edu>
+2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * callproc.c: Indentation fixup.
+
+       * sysdep.c (wait_for_termination_1): Make static.
+       (wait_for_termination, interruptible_wait_for_termination): Move
+       after wait_for_termination_1.
+
+2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * sysdep.c (interruptible_wait_for_termination): New function
+       which is like wait_for_termination, but allows keyboard
+       interruptions.
+
+       * callproc.c (Fcall_process): Add (:file "file") as an option for
+       the STDOUT buffer.
+       (Fcall_process_region): Ditto.
+
+2011-04-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
+       rather than `XVECTOR (FOO)->size'.
+
+       * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
+       inttypes.h, as a gnulib replacement is used if it not available in
+       system headers.
+
+2011-04-21  Eli Zaretskii  <eliz@gnu.org>
+
+       Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
+       * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
+       of MOST_POSITIVE_FIXNUM.  (Bug#8528)
+
+       * coding.c (coding_alloc_by_realloc): Error out if destination
+       will grow beyond MOST_POSITIVE_FIXNUM.
+       (decode_coding_emacs_mule): Abort if there isn't enough place in
+       charbuf for the composition carryover bytes.  Reserve an extra
+       space for up to 2 characters produced in a loop.
+       (decode_coding_iso_2022): Abort if there isn't enough place in
+       charbuf for the composition carryover bytes.
+
+2011-04-21  Eli Zaretskii  <eliz@gnu.org>
+
+       * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
+       aborting when %lld or %lll format is passed.
+       [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
+       %llo or %llx format is passed.  (Bug#8545)
+
+       * window.c (window_scroll_line_based): Use a marker instead of
+       simple variables to record original value of point.  (Bug#7952)
+
+       * doprnt.c (doprnt): Fix the case where a multibyte sequence
+       produced by %s or %c overflows available buffer space.  (Bug#8545)
+
+2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
+       (SIZE_MAX): Move defn after all includes, as they might #define it.
+
+2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
+
+       * w32.c (init_environment): Warn about defaulting HOME to C:\.
+
+2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
+
+       * keyboard.c (Qdelayed_warnings_hook): Define.
+       (command_loop_1): Run `delayed-warnings-hook'
+       if Vdelayed_warnings_list is non-nil.
+       (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
+       (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
+
+2011-04-28  Eli Zaretskii  <eliz@gnu.org>
+
+       * doprnt.c (doprnt): Don't return value smaller than the buffer
+       size if the message was truncated.  (Bug#8545).
+
+2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
+
+       * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
+       (Fx_window_property): #if-0 the whole functions, not just the bodies.
+
+2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * doprnt.c (doprnt): Support "ll" length modifier, for long long.
+
+2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in: Update dependencies.
+
+2011-04-27  Eli Zaretskii  <eliz@gnu.org>
+
+       Improve `doprnt' and its usage.  (Bug#8545)
+       * doprnt.c (doprnt): Make sure `format' is never accessed beyond
+       `format_end'.  Remove support for %l as a conversion specifier.
+       Don't use xrealloc.  Improve diagnostics when the %l size modifier
+       is used.  Update the commentary.
+
+       * eval.c (verror): Simplify calculation of size_t.
+
+       * coding.c (Ffind_operation_coding_system): Fix diagnostic error
+       messages.
+
+2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
+
+       * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
+       change.
+
+2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
+       This makes this file independent of the recent pseudovector change.
+
+2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * keyboard.c (handle_user_signal): Fix pointer signedness problem.
+
+       * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
+       (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
+       Remove unused local.
+       (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
+
+       * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
+       GCC 4.6.0 optimizes based on type-based alias analysis.  For
+       example, if b is of type struct buffer * and v of type struct
+       Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
+       != &v->size, and therefore "v->size = 1; b->size = 2; return
+       v->size;" must therefore return 1.  This assumption is incorrect
+       for Emacs, since it type-puns struct Lisp_Vector * with many other
+       types.  To fix this problem, this patch adds a new type struct
+       vectorlike_header that documents the constraints on layout of vectors
+       and pseudovectors, and helps optimizing compilers not get fooled
+       by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
+       XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
+       * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
+       the size member.
+       (XSETPVECTYPE): Rewrite in terms of new macro.
+       (XSETPVECTYPESIZE): New macro, specifying both type and size.
+       This is a bit clearer, and further avoids the possibility of
+       undesirable aliasing.
+       (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
+       (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
+       (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
+       since Lisp_Subr is a special case (no "next" field).
+       (ASIZE): Now uses header.size rather than size.  All
+       previous uses of XVECTOR (foo)->size replaced to use this macro,
+       to avoid the hassle of writing XVECTOR (foo)->header.size.
+       (struct vectorlike_header): New type.
+       (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
+       object, to help avoid aliasing.
+       (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
+       (SUBRP): Likewise, since Lisp_Subr is a special case.
+       * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
+       (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
+       (struct Lisp_Hash_Table): Combine first two members into a single
+       struct vectorlike_header member.  All uses of "size" and "next" members
+       changed to be "header.size" and "header.next".
+       * buffer.h (struct buffer): Likewise.
+       * font.h (struct font_spec, struct font_entity, struct font): Likewise.
+       * frame.h (struct frame): Likewise.
+       * process.h (struct Lisp_Process): Likewise.
+       * termhooks.h (struct terminal): Likewise.
+       * window.c (struct save_window_data, struct saved_window): Likewise.
+       * window.h (struct window): Likewise.
+       * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
+       Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
+       * buffer.c (init_buffer_once): Likewise.
+       * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
+       special case.
+       * process.c (Fformat_network_address): Use local var for size,
+       for brevity.
+
+       * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
+
+       Make the Lisp reader and string-to-float more consistent (Bug#8525)
+       * data.c (atof): Remove decl; no longer used or needed.
+       (digit_to_number): Move to lread.c.
+       (Fstring_to_number): Use new string_to_number function, to be
+       consistent with how the Lisp reader treats infinities and NaNs.
+       Do not assume that floating-point numbers represent EMACS_INT
+       without losing information; this is not true on most 64-bit hosts.
+       Avoid double-rounding errors, by insisting on integers when
+       parsing non-base-10 numbers, as the documentation specifies.
+       * lisp.h (string_to_number): New decl, replacing ...
+       (isfloat_string): Remove.
+       * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
+       (read1): Do not accept +. and -. as integers; this
+       appears to have been a coding error.  Similarly, do not accept
+       strings like +-1e0 as floating point numbers.  Do not report
+       overflow for integer overflows unless the base is not 10 which
+       means we have no simple and reliable way to continue.
+       Break out the floating-point parsing into a new
+       function string_to_number, so that Fstring_to_number parses
+       floating point numbers consistently with the Lisp reader.
+       (digit_to_number): Moved here from data.c.  Make it static inline.
+       (E_CHAR, EXP_INT): Remove, replacing with ...
+       (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
+       (string_to_number): New function, replacing isfloat_string.
+       This function checks for valid syntax and produces the resulting
+       Lisp float number too.  Rework it so that string-to-number
+       no longer mishandles examples like "1.0e+".  Use strtoumax,
+       so that overflow for non-base-10 numbers is reported only when
+       there's no portable and simple way to convert to floating point.
+
+       * textprop.c (set_text_properties_1): Rewrite for clarity,
+       and to avoid GCC warning about integer overflow.
+
+       * intervals.h (struct interval): Use EMACS_INT for members
+       where EMACS_UINT might cause problems.  See
+       <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
+       (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
+       * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
+       All uses changed.
+       (offset_intervals): Tell GCC not to worry about length overflow
+       when negating a negative length.
+
+       * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
+       (overrun_check_free): Likewise.
+
+       * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
+       in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
+       word size.
+
+       * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
+       (gnutls_make_error): Rename local to avoid shadowing.
+       (gnutls_emacs_global_deinit): ifdef out; not used.
+       (Fgnutls_boot): Use const for pointer to readonly storage.
+       Comment out unused local.  Fix pointer signedness problems.
+
+       * lread.c (openp): Don't stuff size_t into an 'int'.
+       Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
+       about possible signed overflow.
+
+       * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
+       (GDK_KEY_g): Don't define if already defined.
+       (xg_prepare_tooltip): Avoid pointer signedness problem.
+       (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
 
        * process.c (Fnetwork_interface_info): Avoid left-shift undefined
        behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
        * print.c (safe_debug_print, print_object): Likewise.
        (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
        to int.
-       Use pI instead of if-then-else-abort.  Use %p to avoid casts.
+       Use pI instead of if-then-else-abort.  Use %p to avoid casts,
+       avoiding the 0 flag, which is not portable.
        * process.c (Fmake_network_process): Use pI to avoid cast.
        * region-cache.c (pp_cache): Likewise.
        * xdisp.c (decode_mode_spec): Likewise.
        * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
        behavior on 64-bit hosts with printf arg.
-       * xselect.c (x_queue_event): Use %p to avoid casts.
+       * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
        (x_stop_queuing_selection_requests): Likewise.
        (x_get_window_property): Don't truncate byte count to an 'int'
        when tracing.
        alignof(EMACS_INT) < sizeof (EMACS_INT).
        (check_sblock, check_string_bytes, check_string_free_list): Protoize.
 
+2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
+
+       * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
+
+2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
+       supposed to be handshaking.  (Bug#8556)
+       Reported by Paul Eggert <eggert@cs.ucla.edu>.
+
+2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
+
+       * lisp.h (Qdebug): List symbol.
+       * eval.c (Qdebug): Restore global linkage.
+       * keyboard.c (debug-on-event): New variable.
+       (handle_user_signal): Break into debugger when debug-on-event
+       matches the current signal symbol.
+
+2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * alloc.c (check_sblock, check_string_bytes)
+       (check_string_free_list): Convert to standard C.
+
+2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * w32.c (emacs_gnutls_push): Fix typo.
+
+2011-04-25  Eli Zaretskii  <eliz@gnu.org>
+
+       * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
+       "cast to pointer from integer of different size".
+
+       Improve doprnt and its use in verror.  (Bug#8545)
+       * doprnt.c (doprnt): Document the set of format control sequences
+       supported by the function.  Use SAFE_ALLOCA instead of always
+       using `alloca'.
+
+       * eval.c (verror): Don't limit the buffer size at size_max-1, that
+       is one byte too soon.  Don't use xrealloc; instead xfree and
+       xmalloc anew.
+
+2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
+       callbacks stage.
+
+       * gnutls.c: Renamed global_initialized to
+       gnutls_global_initialized.  Added internals for the
+       :verify-hostname-error, :verify-error, and :verify-flags
+       parameters of `gnutls-boot' and documented those parameters in the
+       docstring.  Start callback support.
+       (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
+       unless a fatal error occured. Call gnutls_alert_send_appropriate
+       on error. Return error code.
+       (emacs_gnutls_write): Call emacs_gnutls_handle_error.
+       (emacs_gnutls_read): Likewise.
+       (Fgnutls_boot): Return handshake error code.
+       (emacs_gnutls_handle_error): New function.
+       (wsaerror_to_errno): Likewise.
+
+       * w32.h (emacs_gnutls_pull): Add prototype.
+       (emacs_gnutls_push): Likewise.
+
+       * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
+       (emacs_gnutls_push): Likewise.
+
+2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
+
+       * process.c (wait_reading_process_output): Check if GnuTLS
+       buffered some data internally if no FDs are set for TLS
+       connections.
+
+       * makefile.w32-in (OBJ2): Add gnutls.$(O).
+       (LIBS): Link to USER_LIBS.
+       ($(BLD)/gnutls.$(0)): New target.
+
+2011-04-24  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (handle_single_display_spec): Rename the
+       display_replaced_before_p argument into display_replaced_p, to
+       make it consistent with the commentary.  Fix typos in the
+       commentary.
+
+       * textprop.c (syms_of_textprop): Remove dead code.
+       (copy_text_properties): Delete obsolete commentary about an
+       interface that was deleted long ago.  Fix typos in the description
+       of arguments.
+
+       * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
+       to changes in oldXMenu/XMenu.h from 2011-04-16.
+       <menu_help_message, prev_menu_help_message>: Constify.
+       (IT_menu_make_room): menu->help_text is now `const char **';
+       adjust.
+
+       * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
+       to changes in oldXMenu/XMenu.h from 2011-04-16.
+       (struct XMenu): Declare `help_text' `const char **'.
+
+       * xfaces.c <Qunspecified>: Make extern again.
+
+       * syntax.c: Include sys/types.h before including regex.h, as
+       required by Posix.
+
+       * doc.c (get_doc_string): Improve the format passed to `error'.
+
+       * doprnt.c (doprnt): Improve commentary.
+
+       * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
+
+       * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
+       them with etags.
+
+       * makefile.w32-in (globals.h): Add a dummy recipe, to make any
+       changes in globals.h immediately force recompilation.
+       (TAGS): Depend on $(CURDIR)/m/intel386.h and
+       $(CURDIR)/s/ms-w32.h.
+       (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
+
+       * character.c (Fchar_direction): Function deleted.
+       (syms_of_character): Don't defsubr it.
+       <char-direction-table>: Deleted.
+
+2011-04-23  Eli Zaretskii  <eliz@gnu.org>
+
+       Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
+       * doprnt.c: Include limits.h.
+       (SIZE_MAX): New macro.
+       (doprnt): Return a size_t value.  2nd arg is now size_t.  Many
+       local variables are now size_t instead of int or unsigned.
+       Improve overflow protection.  Support `l' modifier for integer
+       conversions.  Support %l conversion.  Don't assume an EMACS_INT
+       argument for integer conversions and for %c.
+
+       * lisp.h (doprnt): Restore prototype.
+
+       * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
+       $(SRC)/character.h.
+
+       * Makefile.in (base_obj): Add back doprnt.o.
+
+       * deps.mk (doprnt.o): Add back prerequisites.
+       (callint.o): Depend on character.h.
+
+       * eval.c (internal_lisp_condition_case): Include the handler
+       representation in the error message.
+       (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
+       when breaking from the loop.
+
+       * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
+
+       * callint.c (Fcall_interactively): When displaying error message
+       about invalid control letter, pass the character's codepoint, not
+       a pointer to its multibyte form.  Improve display of the character
+       in octal and display also its hex code.
+
+       * character.c (char_string): Use %x to display the (unsigned)
+       codepoint of an invalid character, to avoid displaying a bogus
+       negative value.
+
+       * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
+       `error', not SYMBOL_NAME itself.
+
+       * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
+       character arguments to `error'.
+
+       * charset.c (check_iso_charset_parameter): Fix incorrect argument
+       to `error' in error message about FINAL_CHAR argument.  Make sure
+       FINAL_CHAR is a character, and use %c when it is passed as
+       argument to `error'.
+
+2011-04-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * s/ms-w32.h (localtime): Redirect to sys_localtime.
+
+       * w32.c: Include <time.h>.
+       (sys_localtime): New function.
+
+2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
+
+       * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
+
+       * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
+
+2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
+
+       * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
+       zombies (Bug#8467).
+
+2011-04-19  Eli Zaretskii  <eliz@gnu.org>
+
+       * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
+       gl_state.e_property when gl_state.object is Qt.
+
+       * insdel.c (make_gap_larger): Remove limitation of buffer size
+       to <= INT_MAX.
+
+2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
+
+       * xdisp.c (lookup_glyphless_char_display)
+       (produce_glyphless_glyph): Handle cons cell entry in
+       glyphless-char-display.
+       (Vglyphless_char_display): Document it.
+
+       * term.c (produce_glyphless_glyph): Handle cons cell entry in
+       glyphless-char-display.
+
 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
 
        * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
        define if USE_GTK || USE_X_TOOLKIT.
        (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
        * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
-       * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only if
-       defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
+       * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
+       if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
 
        * xmenu.c (menu_help_callback): Pointer type fixes.
        Use const pointers when pointing at readonly data.  Avoid pointer
        Call gdk_x11_window_lookup_for_display.
        (xg_set_widget_bg): New function.
        (delete_cb): New function.
-       (xg_create_frame_widgets): connect delete-event to delete_cb.
+       (xg_create_frame_widgets): Connect delete-event to delete_cb.
        Call xg_set_widget_bg.  Only set backgrund pixmap for ! HAVE_GTK3
        (xg_set_background_color): Call xg_set_widget_bg.
        (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.