1. 20 Oct, 2012 1 commit
  2. 19 Oct, 2012 2 commits
    • Paul Eggert's avatar
      Undo faccessat change. · f0a80175
      Paul Eggert authored
      f0a80175
    • Paul Eggert's avatar
      Use faccessat, not access, when checking file permissions. · e752e0b0
      Paul Eggert authored
      * .bzrignore: Add lib/fcntl.h.
      * configure.ac (euidaccess): Remove check; gnulib does this for us now.
      (gl_FCNTL_O_FLAGS): Define a dummy version.
      * lib/at-func.c, lib/euidaccess.c, lib/faccessat.c, lib/fcntl.in.h:
      * lib/getgroups.c, lib/group-member.c, lib/root-uid.h:
      * lib/xalloc-oversized.h, m4/euidaccess.m4, m4/faccessat.m4:
      * m4/fcntl_h.m4, m4/getgroups.m4, m4/group-member.m4:
      New files, from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * admin/merge-gnulib (GNULIB_MODULES): Add faccessat.
      (GNULIB_TOOL_FLAGS): Avoid at-internal, fchdir, malloc-posix,
      openat-die, openat-h, save-cwd.  Do not avoid fcntl-h.
      Omit gnulib's m4/fcntl-o.m4.
      * nt/inc/ms-w32.h (AT_FDCWD, AT_EACCESS): New symbols.
      (access): Remove.
      (faccessat): New macro.
      * src/Makefile.in (LIB_EACCESS): New macro.
      (LIBES): Use it.
      * src/callproc.c (init_callproc):
      * src/charset.c (init_charset):
      * src/fileio.c (check_existing, check_executable):
      * src/lread.c (openp, load_path_check):
      * src/process.c (allocate_pty):
      * src/xrdb.c (file_p):
      Use faccessat, not access or euidaccess.  Use symbolic names
      instead of integers for the flags, as they're portable now.
      * src/charset.c, src/xrdb.c: Include <fcntl.h>, for the new flags used.
      * src/fileio.c (Ffile_readable_p):
      Use faccessat, not stat + open + close.
      (file_directory_p): New function, which uses 'stat' on most places
      but 'access' (for efficiency) if WINDOWSNT.
      * src/fileio.c (Ffile_directory_p, Fset_file_times):
      * src/xrdb.c (file_p): Use file_directory_p.
      * src/lisp.h (file_directory_p): New decl.
      * src/lread.c (openp): When opening a file, use fstat rather than
      stat, as that avoids a permissions race.  When not opening a file,
      use file_directory_p rather than stat.
      * src/process.c, src/sysdep.c, src/term.c: All uses of '#ifdef O_NONBLOCK'
      changed to '#if O_NONBLOCK', to accommodate gnulib O_* tyle.
      * src/w32.c (sys_faccessat): Rename from sys_access and switch to
      faccessat's API.  All uses changed.
      
      Fixes: debbugs:12632
      e752e0b0
  3. 16 Oct, 2012 1 commit
    • Dmitry Antipov's avatar
      * editfns.c (get_system_name): Remove. · 61655b89
      Dmitry Antipov authored
      * lisp.h (get_system_name): Remove prototype.
      * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
      (get_environ_db): Use Vsystem_name.  Avoid call to strlen.
      61655b89
  4. 12 Oct, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix bug #12587 with slow startup on MS-Windows with Netlogon service. · bb385a92
      Eli Zaretskii authored
       src/fileio.c (check_existing): New function.
       (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
       instead of calling 'stat', when what's needed is to check whether
       a file exists.  This avoids expensive system calls on MS-Windows.
       src/w32.c (init_environment): Call 'check_existing' instead of 'stat'.
       src/lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
       determine whether a file exists and is not a directory.
       src/lisp.h (check_existing): Add prototype.
      bb385a92
  5. 11 Oct, 2012 1 commit
    • Paul Eggert's avatar
      lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans. · 7cded46f
      Paul Eggert authored
      * lread.c (load_each_byte, new_backquote_flag, readchar)
      (read_filtered_event, lisp_file_lexically_bound_p)
      (safe_to_load_version, Fload, complete_filename_p, openp)
      (build_load_history, readevalloop, read_escape, read1)
      (string_to_number, read_vector, read_list):
      * macros.c (Fstart_kbd_macro):
      * marker.c (CONSIDER):
      * menu.c (parse_single_submenu, digest_single_submenu)
      (find_and_return_menu_selection, Fx_popup_menu):
      * minibuf.c (read_minibuf_noninteractive, read_minibuf)
      (Ftry_completion):
      * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
      (ns_menu_show):
      * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
      (xmenu_show, xdialog_show):
      Use bool for booleans.
      * lread.c (safe_to_load_version): Rename from safe_to_load_p,
      as it's not a predicate.  All uses changed.  Omit unnecessary
      buffer termination.
      7cded46f
  6. 10 Oct, 2012 2 commits
    • Paul Eggert's avatar
      keyboard.c, keymap.c: Use bool for booleans. · 9fa1de30
      Paul Eggert authored
      * dispnew.c (sit_for): Distinguish between 3-way display_option
      and boolean do_display.
      * keyboard.c (single_kboard, this_command_key_count_reset)
      (waiting_for_input, echoing, immediate_quit, input_pending)
      (interrupt_input, interrupts_deferred, pop_kboard)
      (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
      (command_loop_1, adjust_point_for_property)
      (safe_run_hooks_error, input_polling_used, read_char):
      (help_char_p, readable_events, kbd_buffer_events_waiting)
      (kbd_buffer_get_event, timer_check_2, make_lispy_event)
      (lucid_event_type_list_p, get_input_pending):
      (gobble_input, menu_separator_name_p, menu_bar_item)
      (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
      (read_char_minibuf_menu_prompt, access_keymap_keyremap)
      (keyremap_step, test_undefined, read_key_sequence)
      (detect_input_pending, detect_input_pending_ignore_squeezables)
      (detect_input_pending_run_timers, requeued_events_pending_p)
      (quit_throw_to_read_char, Fset_input_interrupt_mode):
      * keymap.c (get_keymap, keymap_parent, keymap_memberp)
      (access_keymap_1, access_keymap, map_keymap, get_keyelt)
      (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
      (accessible_keymaps_1, Fkey_description, push_key_description):
      (shadow_lookup, struct where_is_internal_data)
      (where_is_internal, Fwhere_is_internal, where_is_internal_1)
      (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
      (describe_map, describe_vector):
      * menu.c (single_menu_item):
      * nsmenu.m (ns_update_menubar):
      * process.c (wait_reading_process_output):
      * search.c (scan_buffer, scan_newline):
      Use bool for boolean.
      * keyboard.c (timers_run, swallow_events)
      (detect_input_pending_run_timers):
      * process.c (wait_reading_process_output):
      Use unsigned for counter where wraparound-on-overflow is desired,
      since unsigned is guaranteed to have that behavior and signed is not.
      (read_char): Use ptrdiff_t for string length.
      (get_input_pending): Remove first argument, since it was always
      the same pointer-to-int (now pointer-to-boolean) &input_pending,
      and behave as if it had that value.  Return new value of
      input_pending.  All callers changed.
      * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
      immediate_echo.  Use ptrdiff_t for echo_after_prompt, since it's
      a string length.
      * keymap.c (push_key_description): Omit last arg, which was always 1.
      All callers changed.
      9fa1de30
    • Dmitry Antipov's avatar
      * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR. · 6aea7528
      Dmitry Antipov authored
      * lisp.h (enum pvec_type): Adjust comments and omit explicit
      initializer for PVEC_NORMAL_VECTOR.
      6aea7528
  7. 04 Oct, 2012 1 commit
  8. 01 Oct, 2012 1 commit
  9. 30 Sep, 2012 1 commit
    • Paul Eggert's avatar
      file-attributes has a new optional arg FOLLOW-SYMLINKS. · e7a2937b
      Paul Eggert authored
      * doc/lispref/files.texi (File Attributes): Describe it.
      (Magic File Names): Use it.
      * etc/NEWS: Document the change.
      * lisp/files.el (remote-file-name-inhibit-cache):
      * lisp/time.el (display-time-file-nonempty-p): Use it.
      * lisp/files.el (after-find-file): Don't chase links before calling
      file-exists-p, as file-exists-p already does the right thing.
      * src/dired.c (directory_files_internal, Ffile_attributes):
      New arg follow_symlinks.  All uses changed.
      e7a2937b
  10. 29 Sep, 2012 1 commit
  11. 25 Sep, 2012 2 commits
    • Juanma Barranquero's avatar
      Move Vlibrary_cache to emacs.c and reset before dumping. · aa15c6bb
      Juanma Barranquero authored
      * src/lisp.h (reset_image_types): Declare.
      [WINDOWSNT] (Vlibrary_cache): Declare.
      
      * src/image.c (reset_image_types): New function.
      
      * src/emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
      (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
      (Fdump_emacs): Reset Vlibrary_cache and image_types.
      
      * src/w32.c (Vlibrary_cache): Do not define; moved to emacs.c
      (globals_of_w32) <Vlibrary_cache>: Do not initialize.
      
      * src/w32.h (Vlibrary_cache): Do not declare.
      aa15c6bb
    • Stefan Monnier's avatar
      * src/profiler.c: Rename sample_profiler_* to profiler_cpu_* and · 6521894d
      Stefan Monnier authored
      memory_profiler_* to profiler_memory_*.  Move sigprof_handler before
      its first use, inside the PROFILER_CPU_SUPPORT conditional.
      6521894d
  12. 24 Sep, 2012 3 commits
    • Paul Eggert's avatar
      image.c, indent.c: Use bool for booleans. · 578098f3
      Paul Eggert authored
      * dispextern.h (struct image_type): Members valid_p, load, init
      now return bool, not int.  All uses changed.
      * image.c: Omit unnecessary static decls.
      (x_create_bitmap_mask, x_build_heuristic_mask):
      Return void, not int, since callers don't care about the return value.
      (x_create_bitmap_mask, define_image_type, valid_image_p)
      (struct image_keyword, parse_image_spec, image_spec_value)
      (check_image_size, image_background)
      (image_background_transparent, x_clear_image_1)
      (postprocess_image, lookup_image, x_check_image_size)
      (x_create_x_image_and_pixmap, xbm_image_p)
      (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
      (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
      (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
      (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
      (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
      (png_image_p, init_png_functions, png_load_body, png_load)
      (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
      (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
      (init_gif_functions, gif_load, imagemagick_image_p)
      (imagemagick_load_image, imagemagick_load, svg_image_p)
      (init_svg_functions, svg_load, svg_load_image, gs_image_p)
      (gs_load):
      * nsimage.m (ns_load_image):
      * nsterm.m (ns_defined_color):
      * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
      * xfns.c (x_defined_color):
      * xterm.c (x_alloc_lighter_color_for_widget)
      (x_alloc_nearest_color_1, x_alloc_nearest_color)
      (x_alloc_lighter_color):
      * indent.c (disptab_matches_widthtab, current_column)
      (scan_for_column, string_display_width, indented_beyond_p)
      (compute_motion, vmotion, Fvertical_motion):
      Use bool for booleans.
      578098f3
    • Stefan Monnier's avatar
      Try to let it compile on other platforms · ad942b63
      Stefan Monnier authored
      * src/profiler.c (evict_lower_half): Fix typo.
      (PROFILER_CPU_SUPPORT): Check and define if cpu-profiler is supported.
      Don't compile the cpu-profiler code, if not supported.
      (malloc_probe): Presume memory_log is non-nil.
      (syms_of_profiler): Don't defsubr functions when they aren't defined.
      * src/lisp.h (sample_profiler_running, gc_probe): Don't declare.
      ad942b63
    • Stefan Monnier's avatar
      Rewrite sampler to use Elisp hash-tables. · 3d80c99f
      Stefan Monnier authored
      * src/profiler.c: Remove filtering functionality.
      (is_in_trace, Qgc): Remove vars.
      (make_log, record_backtrace, Fsample_profiler_log):
      Rewrite, using Elisp hash-tables.
      (approximate_median, evict_lower_half): New functions.
      (cpu_log): Rename from sample_log.
      (cpu_gc_count): New var.
      (Fsample_profiler_reset, Fmemory_profiler_reset): Remove.
      (sigprof_handler): Add count to cpu_gc_count during GC, detected via
      backtrace_list.
      (block_sigprof, unblock_sigprof): Remove.
      (gc_probe, mark_profiler): Remove functions.
      (syms_of_profiler): Staticpro cpu_log and memory_log.
      
      * lisp/profiler.el (profiler-sample-interval): Move before first use.
      Change default to 1ms.
      (profiler-entry=, profiler-backtrace-reverse, profiler-log-fixup-slot)
      (profiler-calltree-elapsed<, profiler-calltree-elapsed>): Remove functions.
      (profiler-entry-format): Don't use type-of.
      (profiler-slot, profiler-log): Remove structs.
      (profiler-log-timestamp, profiler-log-type, profiler-log-diff-p):
      Redefine for new log representation.
      (profiler-log-diff, profiler-log-fixup, profiler-calltree-build-1):
      Rewrite for new log representation.
      (profiler-calltree): Remove `elapsed' fields.
      (profiler-calltree-count<, profiler-report-make-entry-part):
      Remove gc special case.
      (profiler-calltree-find): Use equal.
      (profiler-calltree-walk): Remove `args'; rely on closures instead.
      (profiler-calltree-compute-percentages-1): Remove; inlined.
      (profiler-calltree-compute-percentages): Simplify.
      (profiler-report-log, profiler-report-reversed)
      (profiler-report-order): Use defvar-local.
      (profiler-report-line-format): Remove `elapsed', do a bit of CSE.
      (profiler-report-mode-map): Remove up/down bindings.
      (profiler-report-make-buffer-name): Simplify by CSE.
      (profiler-report-mode): Remove redundant code.
      (profiler-report-expand-entry, profiler-report-collapse-entry):
      Use inhibit-read-only.
      (profiler-report-render-calltree-1): Simplify by CSE.
      (profiler-reset): Rewrite for new subroutines.
      (profiler--report-cpu): Rename from sample-profiler-report.
      (profiler--report-memory): Rename from memory-profiler-report.
      
      * src/alloc.c (Fgarbage_collect): Record itself in backtrace_list.
      Don't set is_in_trace any more.  Don't call mark_profiler.
      Only call gc_probe for the memory profiler.
      (syms_of_alloc): Define Qautomatic_gc.
      
      * src/lisp.h (SXHASH_COMBINE): Move back to...
      * src/fns.c (SXHASH_COMBINE): ...here.
      
      * src/xdisp.c (Qautomatic_redisplay): New constant.
      (redisplay_internal): Record itself in backtrace_list.
      (syms_of_xdisp): Define Qautomatic_redisplay.
      
      * .dir-locals.el (indent-tabs-mode): Remove personal preference.
      3d80c99f
  13. 23 Sep, 2012 2 commits
    • Paul Eggert's avatar
      Move pid_t related decls out of lisp.h. · afea8a8a
      Paul Eggert authored
      * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
      (interruptible_wait_for_termination):
      Move these decls from lisp.h to syswait.h, since they use pid_t.
      Needed on FreeBSD; see Herbert J. Skuhra in
      <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
      * callproc.c: Include syswait.h.
      afea8a8a
    • Paul Eggert's avatar
      Simplify and avoid signal-handling races. · 4d7e6e51
      Paul Eggert authored
      * nt/inc/ms-w32.h (emacs_raise): New macro.
      * src/alloc.c (die):
      * src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
      Avoid recursive loop if there's a fatal error in the function itself.
      * src/atimer.c (pending_atimers):
      * src/blockinput.h: Don't include "atimer.h"; no longer needed.
      (interrupt_input_pending): Remove.  All uses removed.
      pending_signals now counts both atimers and ordinary interrupts.
      This is less racy than having three separate pending-signal flags.
      (block_input, unblock_input, totally_unblock_input, unblock_input_to)
      (input_blocked_p):
      Rename from their upper-case counterparts BLOCK_INPUT,
      UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
      INPUT_BLOCKED_P, and turn into functions.  All uses changed.
      This makes it easier to access volatile variables more accurately.
      (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
      (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
      that's more reliable if the code is buggy and sets
      interrupt_input_blocked to a negative value.  All uses changed.
      * src/atimer.c (deliver_alarm_signal):
      Remove.  No need to deliver this to the parent; any thread can
      handle this signal now.  All uses replaced by underlying handler.
      * src/atimer.c (turn_on_atimers):
      * src/dispnew.c (handle_window_change_signal):
      * src/emacs.c (handle_danger_signal):
      * src/keyboard.c (kbd_buffer_get_event):
      Don't reestablish signal handler; not needed with sigaction.
      * src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
      (UNBLOCK_INPUT_TO):
      Rework to avoid unnecessary accesses to volatile variables.
      (UNBLOCK_INPUT_TO): Now a function.
      (totally_unblock_input, unblock_input): New decls.
      * src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
      (init_data): Remove.  Necessary stuff now done in init_signal.
      * src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
      * src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
      (fatal_error_code): Remove; no longer needed.
      (terminate_due_to_signal): Rename from fatal_error_backtrace, since
      it doesn't always backtrace.  All uses changed.  No need to reset
      signal to default, since sigaction and/or die does that for us now.
      Use emacs_raise (FOO), not kill (getpid (), FOO).
      (main): Check more-accurately whether we're dumping.
      Move fatal-error setup to sysdep.c
      * src/floatfns.c: Do not include "syssignal.h"; no longer needed.
      * src/gtkutil.c (xg_get_file_name, xg_get_font):
      Remove no-longer-needed signal-mask manipulation.
      * src/keyboard.c, src/process.c (POLL_FOR_INPUT):
      Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
      * src/keyboard.c (read_avail_input): Remove.
      All uses replaced by gobble_input.
      (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
      (kbd_buffer_store_event_hold, gobble_input):
      (record_asynch_buffer_change) [USABLE_SIGIO]:
      (store_user_signal_events):
      No need to mess with signal mask.
      (gobble_input): If blocking input and there are terminals, simply
      set pending_signals to 1 and return.  All hooks changed to not
      worry about whether input is blocked.
      (process_pending_signals): Clear pending_signals before processing
      them, in case a signal comes in while we're processing.
      By convention callers now test pending_signals before calling us.
      (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
      New functions, to support changes to blockinput.h.
      (handle_input_available_signal): Now extern.
      (reinvoke_input_signal): Remove.  All uses replaced by
      handle_async_input.
      (quit_count): Now volatile, since a signal handler uses it.
      (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.  All
      callers changed.  Block SIGINT only if not already blocked.
      Clear sigmask reliably, even if Fsignal returns, which it can.
      Omit unnecessary accesses to volatile var.
      (quit_throw_to_read_char): No need to restore sigmask.
      * src/keyboard.c (gobble_input, handle_user_signal):
      * src/process.c (wait_reading_process_output):
      Call signal-handling code rather than killing ourselves.
      * src/lisp.h: Include <float.h>, for...
      (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
      (pending_signals): Now volatile.
      (syms_of_data): Now const if IEEE floating point.
      (handle_input_available_signal) [USABLE_SIGIO]:
      (terminate_due_to_signal, record_child_status_change): New decls.
      * src/process.c (create_process): Avoid disaster if memory is exhausted
      while we're processing a vfork, by tightening the critical section
      around the vfork.
      (send_process_frame, process_sent_to, handle_pipe_signal)
      (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
      ignores SIGPIPE.
      (send_process): No need for setjmp/longjmp any more, since the
      SIGPIPE stuff is now gone.  Instead, report an error if errno
      is EPIPE.
      (record_child_status_change): Now extern.  PID and W are now args.
      Return void, not bool.  All callers changed.
      * src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
      Remove.  All uses removed.  This bug should be fixed now in a
      different way.
      (wait_for_termination_1): Use waitpid rather than sigsuspend,
      and record the child status change directly.  This avoids the
      need to futz with the signal mask.
      (process_fatal_action): Move here from emacs.c.
      (emacs_sigaction_flags): New function, containing
      much of what used to be in emacs_sigaction_init.
      (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
      caught by emacs, to make races less likely.
      (deliver_process_signal): Rename from handle_on_main_thread.
      All uses changed.
      (BACKTRACE_LIMIT_MAX): Now at top level.
      (thread_backtrace_buffer, threadback_backtrace_pointers):
      New static vars.
      (deliver_thread_signal, deliver_fatal_thread_signal):
      New functions, for more-accurate delivery of thread-specific signals.
      (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
      (deliver_arith_signal): Handle in this thread, not
      in the main thread, since it's triggered by this thread.
      (maybe_fatal_sig): New function.
      (init_signals): New arg DUMPING so that we can be more accurate
      about whether we're dumping.  Caller changed.
      Treat thread-specific signals differently from process-general signals.
      Block all signals while handling fatal error; that's safer.
      xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
      on IEEE hosts.
      When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
      Ignore SIGPIPE unless batch.
      (emacs_backtrace): Output backtrace for the appropriate thread,
      which is not necessarily the main thread.
      * src/syssignal.h: Include <stdbool.h>.
      (emacs_raise): New macro.
      * src/xterm.c (x_connection_signal): Remove; no longer needed
      now that we use sigaction.
      (x_connection_closed): No need to mess with sigmask now.
      (x_initialize): No need to reset SIGPIPE handler here, since
      init_signals does this for us now.
      
      Fixes: debbugs:12471
      4d7e6e51
  14. 16 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Remove configure's --without-sync-input option. · 0caaedb1
      Paul Eggert authored
      When auditing signal-handling in preparation for cleaning it up,
      I found that SYNC_INPUT has race conditions and would be a real
      pain to fix.  Since it's an undocumented and deprecated
      configure-time option, now seems like a good time to remove it.
      Also see <http://bugs.gnu.org/11080#16>.
      * configure.ac (SYNC_INPUT, BROKEN_SA_RESTART): Remove.
      * admin/CPP-DEFINES (BROKEN_SA_RESTART, SA_RESTART): Remove.
      * etc/TODO (Make SYNC_INPUT the default): Remove, as the code now
      behaves as if SYNC_INPUT is always true.
      * src/alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
      (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
      (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
      (malloc_hysteresis):
      (check_depth) [XMALLOC_OVERRUN_CHECK]:
      (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
      (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
      (dont_register_blocks, bytes_used_when_reconsidered)
      (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
      (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
      [!SYSTEM_MALLOC && !SYNC_INPUT]:
      Remove. All uses removed.
      (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
      implementation, one that depends on whether the new macro
      XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
      is defined.
      * src/atimer.c (run_timers, handle_alarm_signal):
      * src/keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
      (handle_async_input, process_pending_signals)
      (handle_input_available_signal, init_keyboard):
      * src/nsterm.m (ns_read_socket):
      * src/process.c (wait_reading_process_output):
      * src/regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
      * src/sysdep.c (emacs_sigaction_init) [SA_RESTART]:
      (emacs_write):
      * src/xterm.c (XTread_socket):
      Assume SYNC_INPUT.
      * src/conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
      * src/eval.c (handling_signal): Remove.  All uses removed.
      * src/lisp.h (ELSE_PENDING_SIGNALS): Remove.
      All uses replaced with the SYNC_INPUT version.
      (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
      Remove decls.
      * src/sysdep.c, src/syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
      Now static.
      
      Fixes: debbugs:12450
      0caaedb1
  15. 15 Sep, 2012 2 commits
    • Eli Zaretskii's avatar
      Fix MS-Windows build broken by 2012-09-15T07:06:56Z!eggert@cs.ucla.edu,... · 7105c8cb
      Eli Zaretskii authored
      Fix MS-Windows build broken by 2012-09-15T07:06:56Z!eggert@cs.ucla.edu, completing fix for bug #12446.
      
       src/w32xfns.c:
       src/w32uniscribe.c:
       src/w32term.c:
       src/w32select.c:
       src/w32reg.c:
       src/w32proc.c:
       src/w32menu.c:
       src/w32inevt.c:
       src/w32heap.c:
       src/w32font.c:
       src/w32fns.c:
       src/w32console.c:
       src/w32.c:
       src/w16select.c: Remove inclusion of setjmp.h, as it is now included
       by lisp.h.  This completes removal of setjmp.h inclusion
       erroneously announced in the previous commit.
       src/lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
       more accurate.
       src/image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
       not defined as a macro.  The latter happens on MS-Windows.
      7105c8cb
    • Paul Eggert's avatar
      Port better to POSIX hosts lacking _setjmp. · 0328b6de
      Paul Eggert authored
      * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
      (_setjmp, _longjmp): Remove.
      * src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
      All instances of '#include <setjmp.h>' removed, if the
      only reason for the instance was because "lisp.h" was included.
      (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
      Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
      and _longjmp with the new symbols.  Emacs already uses _setjmp if
      available, so this change affects only POSIXish hosts that have
      sigsetjmp but not _setjmp, such as some versions of Solaris and
      Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
      * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
      (png_load_body) [HAVE_PNG]:
      (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
      (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
      Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
      since PNG requires jmp_buf.  This is the only exception to the
      general rule that we now use sys_setjmp and sys_longjmp.
      This exception is OK since this code does not change the signal
      mask or longjmp out of a signal handler.
      
      Fixes: debbugs:12446
      0328b6de
  16. 11 Sep, 2012 2 commits
    • Paul Eggert's avatar
      Avoid _setjmp/_longjmp problems with local nonvolatile variables. · 50f2e553
      Paul Eggert authored
      If a nonvolatile local variable is written before a _longjmp to
      the frame containing the variable, and is read after the _longjmp,
      the value read is indeterminate.  Some local variables of type
      'struct handler' and 'struct catchtag' are used in this way, so
      mark each of their slots as volatile if the slot can be set before
      _longjmp and read afterwards.
      * lisp.h (struct handler): var and chosen_clause are now volatile.
      (struct catchtag): val, next, and pdlcount are now volatile.
      50f2e553
    • Paul Eggert's avatar
      Simplify, document, and port floating-point. · c990426a
      Paul Eggert authored
      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.
      c990426a
  17. 10 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Parenthesize macro bodies. · ff55dfe8
      Paul Eggert authored
      * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
      (XSETFLOAT, XSETMISC): Parenthesize.
      ff55dfe8
  18. 09 Sep, 2012 2 commits
    • Stefan Monnier's avatar
      * src/lisp.h (make_lisp_ptr): New macro to replace XSET. · e7032e7c
      Stefan Monnier authored
      (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
      Use it.
      e7032e7c
    • Paul Eggert's avatar
      Assume C89 or later for math functions. · f6196b87
      Paul Eggert authored
      This simplifies the code, and makes it a bit smaller and faster,
      and (most important) makes it easier to clean up signal handling
      since we can stop worring about floating-point exceptions in
      library code.  That was a problem before C89, but the problem
      went away many years ago on all practical Emacs targets.
      * configure.ac (frexp, fmod): Remove checks for these functions,
      as we now assume them.
      (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC, NO_MATHERR)
      (HAVE_EXCEPTION):
      Remove; no longer needed.
      * admin/CPP-DEFINES (HAVE_FMOD, HAVE_FREXP, FLOAT_CHECK_DOMAIN)
      (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove.
      * src/data.c, src/image.c, src/lread.c, src/print.c:
      Don't include <math.h>; no longer needed.
      * src/data.c, src/floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
      might be autoconfigured, as that never happens.
      * src/data.c (fmod):
      * src/doprnt.c (DBL_MAX_10_EXP):
      * src/print.c (DBL_DIG):
      Remove.  C89 or later always defines these.
      * src/floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
      (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
      (arith_error, domain_error, domain_error2):
      Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
      no longer needed -- we simply return what C returns.  All uses removed.
      (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
      the wrapped code.
      (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
      Remove.  All uses expanded, as these macros are no longer used
      more than once and are now more trouble than they're worth.
      (Ftan): Use tan, not sin / cos.
      (Flogb): Assume C89 frexp.
      (fmod_float): Assume C89 fmod.
      (matherr) [HAVE_MATHERR]: Remove; no longer needed.
      (init_floatfns): Remove.  All uses removed.
      f6196b87
  19. 07 Sep, 2012 1 commit
    • Paul Eggert's avatar
      More signal-handler cleanup. · 1a4f1e9b
      Paul Eggert authored
      * configure.ac (FLOAT_CHECK_DOMAIN): Comment fix (Bug#12327).
      * src/floatfns.c: Comment fix.
      * src/lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
      SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
      and anyway the declaration is harmless even if SIGDANGER is not defined.
      * src/syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
      defined BROKEN_FIONREAD).  systty.h formerly did this, but other
      source files not surprisingly expected syssignal.h to define, or
      not define, SIGIO, and it's cleaner to do it that way, for consistency.
      Include <sys/ioctl.h>, for FIONREAD.
      * src/systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
      This eliminates a problem whereby other files mysteriously had
      to include "syssignal.h" before including "systty.h" if they
      wanted to use "#ifdef SIGIO".
      1a4f1e9b
  20. 05 Sep, 2012 3 commits
    • Paul Eggert's avatar
      Fix race conditions with signal handlers and errno. · 20ef56db
      Paul Eggert authored
      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.
      20ef56db
    • Dmitry Antipov's avatar
      Remove redundant or unused things here and there. · e3ccf108
      Dmitry Antipov authored
      * 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.
      e3ccf108
    • Paul Eggert's avatar
      * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean. · f75d7a91
      Paul Eggert authored
      * 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.
      f75d7a91
  21. 04 Sep, 2012 3 commits
    • Lars Ingebrigtsen's avatar
      Implement `debug-on-message'. · 7f7e0167
      Lars Ingebrigtsen authored
      This allows tracking down what piece of code is outputting stuff in
      the echo area.
      
      * 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'.
      7f7e0167
    • Paul Eggert's avatar
      Give more-useful info on a fatal error (Bug#12328). · cf29dd84
      Paul Eggert authored
      * doc/emacs/trouble.texi (Crashing): New section, documenting this.
      * etc/NEWS: Document the change.
      * src/alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
      (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
      of doing the work ourselves.
      * src/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.
      * src/lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
      * src/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.
      cf29dd84
    • Paul Eggert's avatar
      Simplify redefinition of 'abort' (Bug#12316). · 1088b922
      Paul Eggert authored
      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.
      * configure.ac (NO_ABRT): Remove.
      * admin/CPP-DEFINES (NO_ABORT): Remove.
      * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove.
      * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
      * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]:
      Remove; sysdep.c's emacs_abort now takes its place.
      * src/lisp.h (emacs_abort): New decl.  All calls from Emacs code to
      'abort' changed to use 'emacs_abort'.
      * src/msdos.c (dos_abort) [defined abort]: Remove; not used.
      (abort) [!defined abort]: Rename to ...
      (emacs_abort): ... new name.
      * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
      the place of the old 'abort' in emacs.c.
      * src/w32.c, src/w32fns.c (abort): Do not #undef.
      * src/w32.c (emacs_abort): Rename from w32_abort.
      1088b922
  22. 02 Sep, 2012 3 commits
    • Paul Eggert's avatar
      * emacs.c, eval.c: Use bool for boolean. · 1882aa38
      Paul Eggert authored
      * 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.
      1882aa38
    • Paul Eggert's avatar
      Clean up some extern decls. · a411ac43
      Paul Eggert authored
      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.
      a411ac43
    • Paul Eggert's avatar
      * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean. · a08d4ba7
      Paul Eggert authored
      * 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.
      a08d4ba7
  23. 01 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Better seed support for (random). · 0e23ef9d
      Paul Eggert authored
      * doc/lispref/numbers.texi (Random Numbers): Document new behavior of
      the calls (random) and (random STRING).
      * etc/NEWS: Document new behavior of (random), (random "string").
      * lisp/play/5x5.el, lisp/play/animate.el, lisp/play/cookie1.el:
      * lisp/play/dissociate.el, lisp/play/doctor.el, lisp/play/dunnet.el:
      * lisp/play/gomoku.el, lisp/play/landmark.el, lisp/play/mpuz.el:
      * lisp/play/tetris.el, lisp/play/zone.el:
      * lisp/calc/calc-comb.el (math-init-random-base):
      * lisp/play/blackbox.el (bb-init-board):
      * lisp/play/life.el (life):
      * lisp/server.el (server-use-tcp):
      * lisp/type-break.el (type-break):
      Remove unnecessary call to (random t).
      * lisp/net/sasl.el (sasl-unique-id-function):
      Change (random t) to (random), now that the latter is more random.
      * lisp/play/life.el (life-initialized): Remove no-longer-needed var.
      * lisp/gnus/gnus-sync.el (gnus-sync-lesync-setup):
      * lisp/gnus/message.el (message-canlock-generate, message-unique-id):
      Change (random t) to (random), now that the latter is more random.
      * lisp/org/org-id.el (org-id-uuid):
      Change (random t) to (random), now that the latter is more random.
      * src/emacs.c (main): Call init_random.
      * src/fns.c (Frandom): Set the seed from a string argument, if given.
      Remove long-obsolete Gentzel cruft.
      * src/lisp.h, src/sysdep.c (seed_random): Now takes address and size, not long.
      (init_random): New function.
      0e23ef9d
  24. 31 Aug, 2012 1 commit
    • Dmitry Antipov's avatar
      Remove mark_ttys function and fix tty_display_info initialization. · c650a5de
      Dmitry Antipov authored
      * lisp.h (mark_ttys): Remove prototype.
      * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
      to mark_ttys because all possible values of 'top_frame' slot are
      the frames which are reachable from Vframe_list.
      * term.c (mark_ttys): Remove.
      (init_tty): Safely initialize 'top_frame' slot with Qnil.
      c650a5de
  25. 28 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * dispnew.c: Use bool for boolean. · 59ea14cd
      Paul Eggert authored
      (frame_garbaged, display_completed, delayed_size_change)
      (fonts_changed_p, add_window_display_history)
      (add_frame_display_history, verify_row_hash)
      (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
      (row_equal_p, realloc_glyph_pool)
      (allocate_matrices_for_frame_redisplay)
      (showing_window_margins_p)
      (adjust_frame_glyphs_for_frame_redisplay)
      (build_frame_matrix_from_leaf_window, make_current)
      (mirrored_line_dance, mirror_line_dance, update_frame)
      (update_window_tree, update_single_window)
      (check_current_matrix_flags, update_window, update_text_area)
      (update_window_line, set_window_update_flags, scrolling_window)
      (update_frame_1, scrolling, buffer_posn_from_coords)
      (do_pending_window_change, change_frame_size)
      (change_frame_size_1, sit_for):
      Use bool for boolean.
      (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
      and remove last int (actually boolean) argument, which was always 0.
      All callers changed.
      * dispextern.h, frame.h, lisp.h: Reflect above API changes.
      * dispextern.h (struct composition_it): Use bool for boolean.
      (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
      (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
      * dired.c (file_name_completion):
      Use bool for boolean.  (This was missed in an earlier change.)
      59ea14cd