Fix compilation failure under ENABLE_CHECKING.
[bpt/emacs.git] / src / ChangeLog
index e186b8a..1ff5823 100644 (file)
@@ -1,3 +1,430 @@
+2012-09-07  Eli Zaretskii  <eliz@gnu.org>
+
+       * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
+
+2012-09-07  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (mark_buffer): Revert unsafe marking optimization.
+       (mark_object): Likewise for frame objects.
+
+2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * syssignal.h (handle_on_main_thread): Always declare,
+       even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
+       This ports to platforms without HAVE_PTHREAD.
+
+2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Signal-handler cleanup (Bug#12327).
+       Emacs's signal handlers were written in the old 4.2BSD style with
+       sigblock and sigmask and so forth, and this led to some
+       inefficiencies and confusion.  Rewrite these to use
+       pthread_sigmask etc. without copying signal sets around.  Also,
+       get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
+       'signal', and instead use functions that do not attempt to take
+       over the system name space.  This patch causes Emacs's text
+       segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
+       * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
+       Do not include <signal.h> or "syssignal.h", as these
+       modules do not use signals.
+       * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
+       * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
+       Do not include <signal.h>, as "syssignal.h" does that for us now.
+       * atimer.c (sigmask_atimers): New function.
+       (block_atimers, unblock_atimers): New functions,
+       replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
+       All uses replaced.
+       * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
+       no longer needed here.
+       * emacs.c (main): Inspect existing signal handler with sigaction,
+       so that there's no need to block and unblock SIGHUP.
+       * sysdep.c (struct save_signal): New member 'action', replacing
+       old member 'handler'.
+       (save_signal_handlers, restore_signal_handlers):
+       Use sigaction instead of 'signal' to save and restore.
+       (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
+       New function.  All users of 'signal' modified to use set_sighandler
+       if they're writeonly, and to use sys_signal if they're read+write.
+       (emacs_sigaction_init, forwarded_signal): New functions.
+       (sys_signal): Remove.  All uses replaced by calls to sigaction
+       and emacs_sigaction_init, or by direct calls to 'signal'.
+       (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
+       (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
+       all uses replaced by pthread_sigmask etc. calls.
+       * syssignal.h: Include <signal.h>.
+       (emacs_sigaction_init, forwarded_signal): New decls.
+       (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
+       (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
+       (sigmask, sys_sigmask): Remove; no longer needed.
+       (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
+       (sigblock, sigunblock, sigfree):
+       (sigsetmask) [!defined sigsetmask]:
+       Remove.  All uses replaced by pthread_sigmask.
+       (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
+       no longer need to be replaced, and its typical old uses
+       are now done via emacs_sigaction_init and sigaction.
+       (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
+       (sys_sigdel): Remove; unused.
+       (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
+
+2012-09-06  Eli Zaretskii  <eliz@gnu.org>
+
+       * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
+       SIGCHLD handling on systems that don't have WNOHANG.  (Bug#12327)
+
+2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Explicitly mark buffer_defaults and buffer_local_symbols.
+       * alloc.c (Fgarbage_collect): Mark buffer_defaults and
+       mark_local_symbols here.
+       (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
+       since special buffers aren't marked here any more.
+       (allocate_buffer): Chain new buffer with all_buffers here...
+       * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
+       not here.
+       (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
+       (syms_of_buffer): Remove staticpro of the above.
+       (init_buffer_once): Set names for buffer_defaults and
+       buffer_local_symbols.
+
+2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Use bool for booleans in font-related modules.
+       * font.c (font_intern_prop, font_style_to_value)
+       (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
+       (generate_otf_features, font_check_otf_features, font_check_otf)
+       (font_match_p, font_list_entities, font_at):
+       * fontset.c (fontset_id_valid_p, reorder_font_vector
+       (fontset_find_font, Fset_fontset_font)
+       (face_suitable_for_char_p) [0]:
+       * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
+       (ftfont_open, ftfont_text_extents, ftfont_check_otf):
+       (m17n_flt_initialized, ftfont_shape_by_flt):
+       * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
+       * nsfont.m (nsfont_draw):
+       * w32font.c (w32font_draw):
+       * w32term.c (x_draw_glyphless_glyph_string_foreground):
+       Use bool for booleans.
+       * font.h: Adjust to above API changes.
+       (struct font, struct font_driver, struct font_driver_list):
+       Use bool for booleans.
+       (struct font): Remove useless member encoding_type.
+       All users removed.
+       * fontset.c, xftfont.c: Omit unnecessary static decls.
+
+2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (mark_object): Revert window marking code
+       since it's unsafe for the Fset_window_configuration.
+
+2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix race conditions with signal handlers and errno (Bug#12327).
+       Be more systematic about preserving errno whenever a signal
+       handler returns, even if it's not in the main thread.  Do this by
+       renaming signal handlers to distinguish between signal delivery
+       and signal handling.  All uses changed.
+       * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
+       * data.c (deliver_arith_signal): Rename from arith_error.
+       * dispnew.c (deliver_window_change_signal): Rename from
+       window_change_signal.
+       * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
+       (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
+       * keyboard.c (deliver_input_available_signal): Rename from
+       input_available_signal.
+       (deliver_user_signal): Rename from handle_user_signal.
+       (deliver_interrupt_signal): Rename from interrupt_signal.
+       * process.c (deliver_pipe_signal): Rename from send_process_trap.
+       (deliver_child_signal): Rename from sigchld_handler.
+       * atimer.c (handle_alarm_signal):
+       * data.c (handle_arith_signal):
+       * dispnew.c (handle_window_change_signal):
+       * emacs.c (handle_fatal_signal, handle_danger_signal):
+       * keyboard.c (handle_input_available_signal):
+       * keyboard.c (handle_user_signal, handle_interrupt_signal):
+       * process.c (handle_pipe_signal, handle_child_signal):
+       New functions, with the actual signal-handling code taken from the
+       original respective signal handlers, sans the sporadic attempts to
+       preserve errno, since that's now done by handle_on_main_thread.
+       * atimer.c (alarm_signal_handler): Remove unnecessary decl.
+       * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
+       * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
+       Move to sysdep.c.
+       (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
+       Move initialization of main_thread to sysdep.c's init_signals.
+       * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
+       our usage, and simplifies the mainline code.
+       (record_child_status_change): New static function, as a helper
+       for handle_child_signal, and with most of the old child handler's
+       contents.
+       (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
+       (handle_child_signal): Use the above.
+       * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
+       Moved here from emacs.c.
+       (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
+       code moved here from emacs.c's main function.
+       * sysdep.c, syssignal.h (handle_on_main_thread): New function,
+       replacing the old SIGNAL_THREAD_CHECK.  All uses changed.  This
+       lets callers save and restore errno properly.
+
+2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Remove redundant or unused things here and there.
+       * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
+       * conf_post.h (RE_TRANSLATE): Use char_table_translate.
+       * editfns.c (Fcompare_buffer_substrings): Likewise.
+       * frame.h (struct terminal, struct font_driver_list):
+       Remove redundant declarations.
+       * window.h (Qleft, Qright): Likewise.
+
+2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Do not mark objects from deleted buffers, windows and frames.
+       * alloc.c (mark_buffer): Mark just the buffer if it is dead.
+       (mark_object): Likewise for windows and frames.
+
+2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (valid_lisp_object_p): Treat killed buffers,
+       buffer_defaults and buffer_local_symbols as valid objects.
+       Return special value to denote them.
+
+2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
+       * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
+       (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
+       (file_name_absolute_p, Fsubstitute_in_file_name):
+       (check_executable, check_writable, Ffile_accessible_directory_p)
+       (Fset_file_selinux_context, Fdefault_file_modes)
+       (Finsert_file_contents, choose_write_coding_system)
+       (Fwrite_region, build_annotations, a_write, e_write)
+       (Fdo_auto_save):
+       * filelock.c (boot_time_initialized, get_boot_time)
+       (get_boot_time_1, lock_file_1, within_one_second):
+       * floatfns.c (in_float):
+       * fns.c (concat, internal_equal, Frequire, base64_encode_1)
+       (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
+       (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
+       * lisp.h (struct Lisp_Hash_Table.cmpfn):
+       * window.c (compare_window_configurations):
+       Use bool for booleans.
+       * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
+       (Fdefault_file_modes): Now mode_t, not int, for modes.
+       (Fdo_auto_save): Set a boolean to 1 rather than using ++.
+       (internal_delete_file): Now returns void, not a (boolean) int,
+       since nobody was looking at the return value.
+       * lisp.h, window.h: Adjust to above API changes.
+
+       * xdisp.c (set_message): Simplify and reindent last change.
+
+2012-09-05  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
+
+2012-09-04  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * eval.c (call_debugger): Make the function non-static so that we
+       can call it from set_message.
+
+       * xdisp.c (set_message): Implement the new variable `debug-on-message'.
+       (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
+
+2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Give more-useful info on a fatal error (Bug#12328).
+       * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
+       (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
+       of doing the work ourselves.
+       * emacs.c (fatal_error_signal): Let fatal_error_backtrace
+       do most of the work.
+       (fatal_error_backtrace): New function, taken from the guts
+       of the old fatal_error_signal, but with a new option to output
+       a backtrace.
+       (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
+       info about the signal than just its number.
+       * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
+       * sysdep.c: Include <execinfo.h>
+       (emacs_backtrace): New function, taken partly from the previous
+       code of the 'die' function.
+       (emacs_abort): Call fatal_error_backtrace rather than abort.
+
+2012-09-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
+       eager (load-time) macro-expansion.
+       * lisp.mk (lisp): Add macroexp.
+
+2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Simplify redefinition of 'abort' (Bug#12316).
+       Do not try to redefine the 'abort' function.  Instead, redo
+       the code so that it calls 'emacs_abort' rather than 'abort'.
+       This removes the need for the NO_ABORT configure-time macro
+       and makes it easier to change the abort code to do a backtrace.
+       * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
+       * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
+       Remove; sysdep.c's emacs_abort now takes its place.
+       * lisp.h (emacs_abort): New decl.  All calls from Emacs code to
+       'abort' changed to use 'emacs_abort'.
+       * msdos.c (dos_abort) [defined abort]: Remove; not used.
+       (abort) [!defined abort]: Rename to ...
+       (emacs_abort): ... new name.
+       * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
+       the place of the old 'abort' in emacs.c.
+       * w32.c, w32fns.c (abort): Do not #undef.
+       * w32.c (emacs_abort): Rename from w32_abort.
+
+2012-09-04  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32uniscribe.c (uniscribe_shape): Reverse the sign of
+       offsets[j].dv, since the y axis of the screen coordinates points
+       down, while the y axis of the font definition coordinates points
+       up.  This fixes display of Arabic diacritics such as KASRA and
+       KASRATAN.  (Bug#11860)
+
+2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Be more systematic about _setjmp vs setjmp.
+       * alloc.c (test_setjmp, mark_stack):
+       * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
+       (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
+       (png_load, my_error_exit, jpeg_load):
+       * process.c (send_process_trap, send_process):
+       Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
+       The underscored versions are up to 30x faster on some hosts.
+       Formerly, the code used setjmp+longjmp sometimes and
+       _setjmp+_longjmp at other times, with no particular reason to
+       prefer setjmp+longjmp.
+
+2012-09-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix minor problem found by static checking.
+       * buffer.c (Fdelete_all_overlays): Return nil.
+
+2012-09-03  Martin Rudalics  <rudalics@gmx.at>
+
+       * buffer.c (Fdelete_all_overlays): New function.
+
+2012-09-03  Chong Yidong  <cyd@gnu.org>
+
+       * gtkutil.c: Add extern decl for Qxft.
+
+2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * emacs.c, eval.c: Use bool for boolean.
+       * emacs.c (initialized, inhibit_window_system, running_asynch_code):
+       (malloc_using_checking) [DOUG_LEA_MALLOC]:
+       (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
+       (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
+       (main, decode_env_path, Fdaemon_initialized):
+       * eval.c (call_debugger, Finteractive_p, interactive_p):
+       (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
+       (maybe_call_debugger, Fbacktrace):
+       * process.c (read_process_output, exec_sentinel):
+       Use bool for booleans.
+       * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
+       All callers changed.
+       * eval.c (interactive_p): Omit always-true boolean argument
+       EXCLUDE_SUBRS_P.  All callers changed.
+       * dispextern.h, lisp.h: Reflect above API changes.
+       * firstfile.c (dummy): Use the address of 'main', whose signature
+       won't change, instead of the address of 'initialize', whose
+       signature just changed from int to bool.
+       * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
+       * msdos.c (fatal_error_in_progress): ... from here.
+       * xdisp.c (redisplaying_p): Now a boolean.  Set it to 1 instead
+       of incrementing it.
+       (redisplay_internal, unwind_redisplay): Simply clear
+       REDISPLAYING_P when unwinding, instead of saving its previous,
+       always-false value and then restoring it.
+
+       Clean up some extern decls.
+       Mostly, this hoists extern decls out of .c files and into .h files.
+       That way, we're more likely to catch errors if the interfaces change.
+       * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
+       declare xg_mark_data.
+       * dispextern.h (x_frame_parm_handlers):
+       * font.h (Qxft):
+       * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
+       (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
+       (Qultra_bold, Qoblique, Qitalic):
+       Move extern decl here from .c file.
+       * alloc.c (xg_mark_data) [USE_GTK]:
+       * doc.c (Qclosure):
+       * eval.c (Qlexical_binding):
+       * fns.c (time) [!HAVE_UNISTD_H]:
+       * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
+       (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
+       * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
+       * lread.c (Qinternal_interpreter_environment):
+       * minibuf.c (Qbuffer):
+       * process.c (QCfamily, QCfilter):
+       * widget.c (free_frame_faces):
+       * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
+       * xfont.c (x_clear_errors):
+       * xterm.c (x_frame_parm_handlers):
+       Remove now-redundant extern decls.
+       * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
+       * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
+       Now static.
+       * xfaces.c: Remove unnecessary static decls.
+       * xterm.c (updating_frame): Remove decl of nonexistent object.
+
+       * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
+       when building globals.h, as the objects that are not built on
+       this host are not needed to compile C files on this host.
+
+2012-09-02  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * gtkutil.h: Remove prototype for x_wm_set_size_hint.
+
+       * frame.h: Add missing prototype for x_wm_set_size_hint.
+
+2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
+       * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
+       (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
+       (Fsubstitute_command_keys):
+       * editfns.c (region_limit, find_field, Fconstrain_to_field)
+       (save_excursion_save, save_excursion_restore)
+       (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
+       (format_time_string, general_insert_function)
+       (make_buffer_string, make_buffer_string_both)
+       (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
+       * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
+       (copy_text, insert_1, insert_1_both, insert_from_string)
+       (insert_from_string_before_markers, insert_from_string_1)
+       (insert_from_buffer, insert_from_buffer_1, replace_range)
+       (replace_range_2, del_range_1, del_range_byte, del_range_both)
+       (del_range_2, modify_region):
+       * intervals.c (intervals_equal, balance_possible_root_interval)
+       (adjust_intervals_for_insertion, merge_properties_sticky)
+       (graft_intervals_into_buffer, lookup_char_property)
+       (adjust_for_invis_intang, set_point_both)
+       (get_property_and_range, compare_string_intervals)
+       (set_intervals_multibyte_1, set_intervals_multibyte):
+       * keyboard.c (decode_timer):
+       Use bool for boolean.
+       * intervals.h, lisp.h, systime.h: Reflect above API changes.
+       * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
+
+2012-09-02  Chong Yidong  <cyd@gnu.org>
+
+       * keymap.c (push_key_description): Print M-TAB as C-M-i
+       (Bug#11758).
+
+2012-09-02  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in (CCL_H, W32FONT_H): New macros.
+       (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
+       ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
+       ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
+       ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
+       ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
+       ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
+
 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
 
        * w32uniscribe.c (uniscribe_shape): Handle correctly the case of