1. 27 Aug, 2013 2 commits
    • Paul Eggert's avatar
      Simplify EMACS_TIME-related code. · 43aac990
      Paul Eggert authored
      This portability layer is no longer needed, since Emacs has been
      using struct timespec as a portability layer for some time.
      Merge from gnulib, incorporating:
      2013-08-27 timespec: new convenience constants and function
      * src/atimer.h, src/buffer.h, src/dispextern.h, src/xgselect.h:
      Include <time.h> rather than "systime.h"; that's all that's needed now.
      * src/dispnew.c: Include <timespec.h> rather than "systime.h";
      that's all that's needed now.
      * src/systime.h (EMACS_TIME): Remove.  All uses changed to struct timespec.
      (EMACS_TIME_RESOLUTION): Remove.  All uses changed to
      TIMESPEC_RESOLUTION.
      (LOG10_EMACS_TIME_RESOLUTION): Remove.  All uses changed to
      LOG10_TIMESPEC_RESOLUTION.
      (EMACS_SECS, emacs_secs_addr): Remove.  All uses changed to tv_sec.
      (EMACS_NSECS): Remove.  All uses changed to tv_nsec.
      (make_emacs_time): Remove.  All used changed to make_timespec.
      (invalid_timespec): Rename from invalid_emacs_time.  All uses changed.
      (current_timespec): Rename from current_emacs_time.  All uses changed.
      (add_emacs_time): Remove.  All uses changed to timespec_add.
      (sub_emacs_time): Remove.  All uses change dot timespec_sub.
      (EMACS_TIME_SIGN): Remove.  All uses changed to timespec_sign.
      (timespec_valid_p): Rename from EMACS_TIME_VALID_P.  All uses changed.
      (EMACS_TIME_FROM_DOUBLE): Remove.  All uses changed to dtotimespec.
      (EMACS_TIME_TO_DOUBLE): Remove.  All uses changed to timespectod.
      (current_timespec): Rename from current_emacs_time.  All uses changed.
      (EMACS_TIME_EQ, EMACS_TIME_LT, EMACS_TIME_LE): Remove.  All uses
      changed to timespec_cmp.
      * src/xgselect.c: Include <timespec.h>, since our .h files don't.
      43aac990
    • Dmitry Antipov's avatar
      * lisp.h (Mouse_HLInfo): Move from here... · 9fed9729
      Dmitry Antipov authored
      * dispextern.h (Mouse_HLInfo): ...to here and offload lisp.h.
      (reset_mouse_highlight): New function.
      * msdos.c (dos_set_window_size, IT_update_begin)
      (internal_terminal_init):
      * nsterm.m (ns_update_window_end, x_free_frame_resources)
      (ns_initialize_display_info):
      * w32console.c (initialize_w32_display):
      * w32term.c (x_update_window_end, x_free_frame_resources)
      (w32_initialize_display_info):
      * xterm.c (x_update_window_end, x_free_frame_resources, x_term_init):
      * window.c (Fdelete_other_windows_internal):
      * xdisp.c (clear_mouse_face, cancel_mouse_face): Use it.
      * termchar.h (toplevel):
      * xterm.h (toplevel): Include dispextern.h.
      9fed9729
  2. 23 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Minor cleanup for redisplay interface and few related functions. · 9997ec56
      Dmitry Antipov authored
      * frame.h (enum text_cursor_kinds): Move from here...
      * dispextern.h (enum text_cursor_kinds): ...to here.
      (toplevel): Drop unnecessary declarations.
      (struct redisplay_interface): Use bool and enum text_cursor_kinds
      in update_window_end_hook and draw_window_cursor functions.
      (display_and_set_cursor, x_update_cursor): Adjust prototypes.
      * nsterm.m (ns_update_window_end, ns_draw_window_cursor):
      * w32term.c (x_update_window_end,w32_draw_window_cursor):
      * xterm.c (x_update_window_end, x_draw_window_cursor):
      * xdisp.c (display_and_set_cursor, update_window_cursor)
      (update_cursor_in_window_tree, x_update_cursor): Use bool and
      enum text_cursor_kinds where appropriate.
      9997ec56
  3. 15 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      * term.c (get_named_tty, create_tty_output, tty_free_frame_resources) · 9c253307
      Dmitry Antipov authored
      (tty_free_frame_resources, delete_tty): Prefer eassert to emacs_abort.
      * image.c (make_image_cache): For struct image_cache, prefer xmalloc
      to xzalloc and so avoid redundant call to memset.
      * xterm.c (x_term_init): Avoid unnecessary initializations of dpyinfo
      members because it is allocated with xzalloc and so already zeroed.
      9c253307
  4. 14 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Utility function and macro to copy Lisp string to C string. · 5b71542d
      Dmitry Antipov authored
      * lisp.h (xlispstrdupa): New macro.
      (xlispstrdup): New prototype.
      * alloc.c (xlispstrdup): New function.
      * callint.c (Fcall_interactively):
      * fileio.c (Ffile_name_directory, Fexpand_file_name)
      (Fsubstitute_in_file_name):
      * frame.c (Fmake_terminal_frame): Use xlispstrdupa.
      * image.c (x_create_bitmap_from_file):
      * w32term.c (w32_term_init):
      * xterm.c (x_term_init): Use xlispstrdup.
      5b71542d
  5. 13 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      * window.h (WINDOW_FRINGE_EXTENDED_P): New macro. · c8ae93b0
      Dmitry Antipov authored
      * nsterm.m (ns_set_vertical_scroll_bar): Use it.  Use convenient
      bool instead of BOOL.
      * w32term.h (struct scroll_bar): Convert fringe_extended_p
      from Lisp_Object to bitfield.  Adjust comment.
      * w32term.c (x_scroll_bar_create): Adjust user.
      Use WINDOW_FRINGE_EXTENDED_P and bool for boolean.
      * xterm.c (XTset_vertical_scroll_bar): Likewise.
      Use bool for boolean.
      * xterm.h (struct scroll_bar): Prefer commonly used `unsigned'
      to `unsigned int' when defining a bitfield.
      c8ae93b0
  6. 11 Aug, 2013 1 commit
    • Paul Eggert's avatar
      Omit some unnecessary casts. · 7d652d97
      Paul Eggert authored
      Many of these go back to the old pre-C89 days, when they may have
      been needed, but we've been assuming C89 or later for a while now.
      * alloc.c (live_string_p, live_cons_p, live_symbol_p)
      (live_float_p, live_misc_p, live_vector_p):
      * buffer.c (compare_overlays, cmp_for_strings, mmap_find)
      (mmap_alloc, alloc_buffer_text, enlarge_buffer_text)
      (defvar_per_buffer):
      * callint.c (Fcall_interactively):
      * doc.c (Fsubstitute_command_keys):
      * filelock.c (get_boot_time):
      * frame.c (xrdb_get_resource):
      * gtkutil.c (hierarchy_ch_cb, qttip_cb, style_changed_cb)
      (delete_cb, xg_dialog_response_cb, xg_maybe_add_timer)
      (xg_get_file_name_from_selector, menuitem_destroy_callback)
      (menuitem_highlight_callback, menu_destroy_callback)
      (xg_update_menu_item, xg_modify_menubar_widgets, menubar_map_cb)
      (xg_tool_bar_callback, xg_get_tool_bar_widgets)
      (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
      (xg_tool_bar_help_callback, tb_size_cb):
      * image.c (xpm_alloc_color, png_read_from_memory)
      (png_read_from_file, png_load_body, our_memory_skip_input_data)
      (jpeg_memory_src, jpeg_file_src, imagemagick_load_image)
      (syms_of_image):
      * keymap.c (describe_map):
      * nsfns.m (Fns_display_monitor_attributes_list):
      * nsmenu.m (process_dialog:):
      * nsterm.m (hold_event):
      * process.c (wait_reading_process_output):
      * regex.c (REGEX_REALLOCATE, re_set_registers, re_exec, regexec):
      * scroll.c (do_direct_scrolling, scrolling_1):
      * termcap.c (tgetent):
      * window.c (check_window_containing, add_window_to_list)
      (freeze_window_starts):
      * xdisp.c (compare_overlay_entries, vmessage):
      * xfns.c (x_window, x_get_monitor_attributes_xinerama)
      (x_get_monitor_attributes_xrandr)
      (Fx_display_monitor_attributes_list, x_display_info_for_name)
      (Fx_open_connection, file_dialog_cb, file_dialog_unmap_cb):
      * xfont.c (xfont_match, xfont_open):
      * xmenu.c (x_menu_wait_for_event, menu_highlight_callback)
      (menubar_selection_callback, menu_position_func)
      (popup_selection_callback, create_and_show_popup_menu)
      (dialog_selection_callback, create_and_show_dialog):
      * xrdb.c (x_get_string_resource):
      (main) [TESTRM]:
      * xsmfns.c (x_session_check_input):
      * xterm.c (x_draw_glyphless_glyph_string_foreground)
      (xm_scroll_callback, xg_scroll_callback, xg_end_scroll_callback)
      (xaw_jump_callback, xaw_scroll_callback):
      Omit unnecessary casts.
      7d652d97
  7. 10 Aug, 2013 1 commit
  8. 09 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Use xstrdup and build_unibyte_string where applicable. · 309f24d1
      Dmitry Antipov authored
      * alloc.c (xstrdup): Tiny cleanup.  Add eassert.
      * xfns.c (x_window):
      * xrdb.c (x_get_customization_string):
      * xterm.c (xim_initialize):
      * w32fns.c (w32_window): Use xstrdup.
      (w32_display_monitor_attributes_list):
      * emacs.c (init_cmdargs):
      * keyboard.c (PUSH_C_STR):
      * nsfont.m (nsfont_open):
      * sysdep.c (system_process_attributes):
      * w32.c (system_process_attributes):
      * xdisp.c (message1, message1_nolog): Use build_unibyte_string.
      309f24d1
  9. 08 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Redesign redisplay interface to drop global variable updated_window. · 65620264
      Dmitry Antipov authored
      Always pass currently updated window as a parameter to update routines.
      * dispextern.h (updated_window): Remove declaration.
      (struct redisplay_interface): Pass window parameter to
      write_glyphs, insert_glyphs, clear_end_of_line, cursor_to
      and after_update_window_hook.
      (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line, x_cursor_to):
      Adjust prototypes.
      * dispnew.c (updated_window): Remove.
      (redraw_overlapped_rows, update_marginal_area, update_text_area)
      (update_window_line): Adjust to match redisplay interface changes.
      * nsterm.m (ns_update_window_begin, ns_update_window_end)
      (ns_scroll_run, ns_after_update_window_line):
      * w32term.c (x_update_window_begin, x_update_window_end)
      (x_after_update_window_line, x_scroll_run):
      * xterm.c (x_update_window_begin, x_update_window_end)
      (x_after_update_window_line, x_scroll_run):
      * xdisp.c (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
      Likewise.  Adjust comments where appropriate.
      (x_cursor_to): Simplify because this is always called during window
      update (but install debugging check anyway).
      (expose_window): Check must_be_updated_p flag to see whether this
      function is called during window update.
      65620264
  10. 03 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Drop FRAME_PTR typedef. · a10c8269
      Dmitry Antipov authored
      * composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h:
      * ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c:
      * menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h:
      * nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h:
      * w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h:
      * w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c:
      * xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c:
      All related users changed.
      a10c8269
  11. 02 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Fix X GC leak in GTK and raw (no toolkit) X ports. · 4b5c9326
      Dmitry Antipov authored
      * xterm.c (x_free_frame_resources): If white and black relief
      GCs are allocated, always free them here.
      * xfns.c (x_make_gc): Omit redundant initialization.
      * widget.c (create_frame_gcs): Remove the leftover.
      (EmacsFrameDestroy): Do nothing because all GCs are now freed
      in x_free_frame_resources.
      4b5c9326
  12. 01 Aug, 2013 3 commits
  13. 30 Jul, 2013 1 commit
    • Dmitry Antipov's avatar
      * fringe.c (draw_window_fringes, update_window_fringes) · d7e6881a
      Dmitry Antipov authored
      (compute_fringe_widths):
      * w32term.c (x_draw_glyph_string):
      * window.c (candidate_window_p, Frecenter):
      * xfaces.c (realize_basic_faces, realize_default_face)
      (Fbitmap_space_p, Finternal_set_lisp_face_attribute)
      (x_update_menu_appearance, face_attr_equal_p, lface_equal_p):
      * xfns.c (x_set_cursor_color, xic_free_xfontset):
      * xmenu.c (Fx_menu_bar_open_internal):
      * xselect.c (x_reply_selection_request, Fx_get_atom_name):
      * xsettings.c (xft_settings_event):
      * xterm.c (x_draw_glyph_string, x_had_errors_p):
      Use bool for booleans.  Adjust style and comments where
      appropriate.
      * dispextern.h (draw_window_fringes, update_window_fringes)
      (compute_fringe_widths):
      * xterm.h (x_had_errors_p): Adjust prototype.
      d7e6881a
  14. 26 Jul, 2013 1 commit
    • Stefan Monnier's avatar
      Add support for lexical variables to the debugger's `e' command. · 56ea7291
      Stefan Monnier authored
      * lisp/emacs-lisp/debug.el (debug): Don't let-bind the debugger-outer-*
      vars, except for debugger-outer-match-data.
      (debugger-frame-number): Move check for "on a function call" from
      callers into it.  Add `skip-base' argument.
      (debugger-frame, debugger-frame-clear): Simplify accordingly.
      (debugger-env-macro): Only reset the state stored in non-variables,
      i.e. current-buffer and match-data.
      (debugger-eval-expression): Rewrite using backtrace-eval.
      * lisp/subr.el (internal--called-interactively-p--get-frame): Remove.
      (called-interactively-p):
      * lisp/emacs-lisp/edebug.el (edebug--called-interactively-skip): Use the new
      `base' arg of backtrace-frame instead.
      * src/eval.c (set_specpdl_old_value): New function.
      (unbind_to): Minor simplification.
      (get_backtrace_frame): New function.
      (Fbacktrace_frame): Use it.  Add `base' argument.
      (backtrace_eval_unrewind, Fbacktrace_eval): New functions.
      (syms_of_eval): Export backtrace-eval.
      * src/xterm.c (x_focus_changed): Simplify.
      56ea7291
  15. 16 Jul, 2013 2 commits
    • Jan Djärv's avatar
      Stop cursor blink after blink-cursor-blinks (10), stop timers when not blinking. · 18c26d81
      Jan Djärv authored
      * etc/NEWS: Document blink-cursor-blinks and blink timers stopped.
      
      * lisp/frame.el (blink-cursor-blinks): New defcustom.
      (blink-cursor-blinks-done): New defvar.
      (blink-cursor-start): Set blink-cursor-blinks-done to 1.
      (blink-cursor-timer-function): Check if number of blinks has been
      done on X and NS.
      (blink-cursor-suspend, blink-cursor-check): New defuns.
      
      * src/frame.c (Fhandle_focus_in, Fhandle_focus_out): New functions.
      (Fhandle_switch_frame): Call Fhandle_focus_in.
      (syms_of_frame): defsubr handle-focus-in/out.
      
      * src/keyboard.c (Qfocus_in, Qfocus_out): New static objects.
      (make_lispy_focus_in, make_lispy_focus_out): Declare and define.
      (kbd_buffer_get_event): For FOCUS_IN, make a focus_in event if no
      switch frame event is made.  Check ! NILP (event->arg) if X11 (moved
      from xterm.c). Make focus_out event for FOCUS_OUT_EVENT if NS or X11
      and there is a focused frame.
      (head_table): Add focus-in and focus-out.
      (keys_of_keyboard): Add focus-in and focus-out to Vspecial_event_map,
      bind to handle-focus-in/out.
      
      * src/nsterm.m (windowDidResignKey): If this is the focused frame, generate
      FOCUS_OUT_EVENT.
      
      * src/termhooks.h (enum event_kind): Add FOCUS_OUT_EVENT.
      
      * src/xterm.c (x_focus_changed): Always generate FOCUS_IN_EVENT.
      Set event->arg to Qt if switch-event shall be generated.
      Generate FOCUS_OUT_EVENT for FocusOut if this is the focused frame.
      18c26d81
    • Paul Eggert's avatar
      Prefer list1 (X) to Fcons (X, Qnil) when building lists. · 6c6f1994
      Paul Eggert authored
      This makes the code easier to read and the executable a bit smaller.
      Do not replace all calls to Fcons that happen to create lists,
      just calls that are intended to create lists.  For example, when
      creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil))
      rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil).
      Similarly for list2 through list5.
      * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
      * bytecode.c (exec_byte_code):
      * callint.c (quotify_arg, Fcall_interactively):
      * callproc.c (Fcall_process, create_temp_file):
      * charset.c (load_charset_map_from_file)
      (Fdefine_charset_internal, init_charset):
      * coding.c (get_translation_table, detect_coding_system)
      (Fcheck_coding_systems_region)
      (Fset_terminal_coding_system_internal)
      (Fdefine_coding_system_internal, Fdefine_coding_system_alias):
      * composite.c (update_compositions, Ffind_composition_internal):
      * dired.c (directory_files_internal, file_name_completion)
      (Fsystem_users):
      * dispnew.c (Fopen_termscript, bitch_at_user, init_display):
      * doc.c (Fsnarf_documentation):
      * editfns.c (Fmessage_box):
      * emacs.c (main):
      * eval.c (do_debug_on_call, signal_error, maybe_call_debugger)
      (Feval, eval_sub, Ffuncall, apply_lambda):
      * fileio.c (make_temp_name, Fcopy_file, Faccess_file)
      (Fset_file_selinux_context, Fset_file_acl, Fset_file_modes)
      (Fset_file_times, Finsert_file_contents)
      (Fchoose_write_coding_system, Fwrite_region):
      * fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns):
      * font.c (font_registry_charsets, font_parse_fcname)
      (font_prepare_cache, font_update_drivers, Flist_fonts):
      * fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset):
      * frame.c (make_frame, Fmake_terminal_frame)
      (x_set_frame_parameters, x_report_frame_params)
      (x_default_parameter, Fx_parse_geometry):
      * ftfont.c (syms_of_ftfont):
      * image.c (gif_load):
      * keyboard.c (command_loop_1):
      * keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1)
      (Fcopy_keymap, append_key, Fcurrent_active_maps)
      (Fminor_mode_key_binding, accessible_keymaps_1)
      (Faccessible_keymaps, Fwhere_is_internal):
      * lread.c (read_emacs_mule_char):
      * menu.c (find_and_return_menu_selection):
      * minibuf.c (get_minibuffer):
      * nsfns.m (Fns_perform_service):
      * nsfont.m (ns_script_to_charset):
      * nsmenu.m (ns_popup_dialog):
      * nsselect.m (ns_get_local_selection, ns_string_from_pasteboard)
      (Fx_own_selection_internal):
      * nsterm.m (append2):
      * print.c (Fredirect_debugging_output)
      (print_prune_string_charset):
      * process.c (Fdelete_process, Fprocess_contact)
      (Fformat_network_address, set_socket_option)
      (read_and_dispose_of_process_output, write_queue_push)
      (send_process, exec_sentinel):
      * sound.c (Fplay_sound_internal):
      * textprop.c (validate_plist, add_properties)
      (Fput_text_property, Fadd_face_text_property)
      (copy_text_properties, text_property_list, syms_of_textprop):
      * unexaix.c (report_error):
      * unexcoff.c (report_error):
      * unexsol.c (unexec):
      * xdisp.c (redisplay_tool_bar, store_mode_line_string)
      (Fformat_mode_line, syms_of_xdisp):
      * xfaces.c (set_font_frame_param)
      (Finternal_lisp_face_attribute_values)
      (Finternal_merge_in_global_face, syms_of_xfaces):
      * xfns.c (x_default_scroll_bar_color_parameter)
      (x_default_font_parameter, x_create_tip_frame):
      * xfont.c (xfont_supported_scripts):
      * xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show)
      (menu_help_callback, xmenu_show):
      * xml.c (make_dom):
      * xterm.c (set_wm_state):
      Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list,
      and similarly for list2 through list5.
      6c6f1994
  16. 10 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Port to C89. · 29abe551
      Paul Eggert authored
      * lib-src/ebrowse.c (USAGE): Remove macro with too-long string literal ...
      (usage_message): ... and replace it with this new static constant
      containing multiple literals.  All uses changed.
      * lib-src/emacsclient.c (print_help_and_exit):
      Rewrite to avoid string literals longer than the C89 limits.
      (start_daemon_and_retry_set_socket):
      Rewrite to avoid non-constant array initializer.
      * lib-src/make-docfile.c (enum global_type): Omit trailing comma.
      * src/bytecode.c (BYTE_CODE_THREADED): Do not define if __STRICT_ANSI__.
      (B__dummy__): New dummy symbol, to pacify C89.
      * src/dbusbind.c (XD_DEBUG_MESSAGE): Omit debugging on C89 hosts, since
      they can't grok varargs macros.
      * src/dispnew.c (add_window_display_history)
      (add_frame_display_history):
      * src/print.c (print_object):
      * src/xdisp.c (debug_method_add):
      Use %p printf format only for void pointers.
      * src/emacs.c (usage_message): New constant, replacing ...
      (USAGE1, USAGE2, USAGE3): Remove; they were too long for C89.
      (main): Adjust to usage reorg.
      * src/fns.c (syms_of_fns):
      * src/profiler.c (syms_of_profiler):
      Don't use non-constant struct initializers.
      * src/gnutls.h (gnutls_initstage_t):
      * src/lisp.h (enum Lisp_Fwd_Type):
      * src/lread.c (lisp_file_lexically_bound_p):
      * src/xsettings.c (anonymous enum):
      Remove trailing comma.
      * src/xsettings.c (apply_xft_settings): Use %f, not %lf; %lf is a C99ism.
      * src/lisp.h (ENUM_BF): Use unsigned if pedantic.
      (DEFUN_FUNCTION_INIT): New macro, that falls back on a cast if pre-C99.
      (DEFUN): Use it.
      * src/regex.c (const_re_char): New type, to pacify strict C89.
      All uses of 'const re_char' replaced to use it.
      * src/regex.h (_Restrict_): Rename from __restrict, to avoid clash
      with glibc when strict C89.  This change is imported from gnulib.
      All uses changed.
      (_Restrict_arr_): Rename from __restrict_arr, similarly.
      * src/sysdep.c (time_from_jiffies) [!HAVE_LONG_LONG_INT]:
      Omit GNU_LINUX implementation, since it requires long long.
      * src/xterm.c (x_draw_underwave):
      Do not assume the traditional order of struct's members.
      (x_term_init): Rewrite to avoid the need for non-constant structure
      initializers.
      29abe551
  17. 05 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Remove duplicate #include directives. · 47ba6d43
      Paul Eggert authored
      * alloc.c [GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES]:
      * xfaces.c:
      Don't include stdio.h twice.
      * buffer.c [USE_MMAP_FOR_BUFFERS]:
      Don't include sys/types.h or stdio.h twice.
      * fileio.c [WINDOWSNT | MSDOS]: Don't include fcntl.h twice.
      * lread.c: Don't include coding.h twice.
      * nsfont.m: Don't include frame.h twice.
      * process.c [HAVE_RES_INIT]: Don't include <netinet/in.h> twice.
      * ralloc.c: Don't include <unistd.h> twice.
      * xdisp.c: Don't include font.h twice.
      * xterm.c: Don't include fontset.h twice.
      * xterm.h [USE_X_TOOLKIT]: Don't include X11/StringDefs.h twice.
      47ba6d43
  18. 30 Jun, 2013 1 commit
  19. 05 Jun, 2013 1 commit
    • Paul Eggert's avatar
      Chain glib's SIGCHLD handler from Emacs's (Bug#14474). · f019a684
      Paul Eggert authored
      * process.c (dummy_handler): New function.
      (lib_child_handler): New static var.
      (handle_child_signal): Invoke it.
      (catch_child_signal): If a library has set up a signal handler,
      save it into lib_child_handler.
      (init_process_emacs): If using glib and not on Windows, tickle glib's
      child-handling code so that it initializes its private SIGCHLD handler.
      * syssignal.h (SA_SIGINFO): Default to 0.
      * xterm.c (x_term_init): Remove D-bus hack that I installed on May
      31; it should no longer be needed now.
      f019a684
  20. 31 May, 2013 1 commit
  21. 09 May, 2013 1 commit
  22. 08 May, 2013 1 commit
  23. 07 May, 2013 1 commit
  24. 25 Mar, 2013 1 commit
  25. 24 Mar, 2013 1 commit
    • Andreas Schwab's avatar
      Reorder conditions that are written backwards · 908589fd
      Andreas Schwab authored
      * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
      written backwards.
      * blockinput.h (input_blocked_p): Likewise.
      * bytecode.c (exec_byte_code): Likewise.
      * callproc.c (call_process_kill, call_process_cleanup)
      (Fcall_process): Likewise.
      * ccl.c (ccl_driver, resolve_symbol_ccl_program)
      (Fccl_execute_on_string): Likewise.
      * character.c (string_escape_byte8): Likewise.
      * charset.c (read_hex): Likewise.
      * cm.c (calccost): Likewise.
      * data.c (cons_to_unsigned): Likewise.
      * dired.c (directory_files_internal, file_name_completion):
      Likewise.
      * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
      (sit_for): Likewise.
      * doc.c (Fsubstitute_command_keys): Likewise.
      * doprnt.c (doprnt): Likewise.
      * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
      * emacsgtkfixed.c: Likewise.
      * fileio.c (file_offset, Fwrite_region): Likewise.
      * floatfns.c (Fexpt, fmod_float): Likewise.
      * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
      Likewise.
      * font.c (font_intern_prop): Likewise.
      * frame.c (x_set_alpha): Likewise.
      * gtkutil.c (get_utf8_string): Likewise.
      * indent.c (check_display_width): Likewise.
      * intervals.c (create_root_interval, rotate_right, rotate_left)
      (split_interval_right, split_interval_left)
      (adjust_intervals_for_insertion, delete_node)
      (interval_deletion_adjustment, adjust_intervals_for_deletion)
      (merge_interval_right, merge_interval_left, copy_intervals)
      (set_intervals_multibyte_1): Likewise.
      * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
      * keymap.c (Fkey_description): Likewise.
      * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
      * lread.c (openp, read_integer, read1, string_to_number):
      Likewise.
      * menu.c (ensure_menu_items): Likewise.
      * minibuf.c (read_minibuf_noninteractive): Likewise.
      * print.c (printchar, strout): Likewise.
      * process.c (create_process, Faccept_process_output)
      (wait_reading_process_output, read_process_output, send_process)
      (wait_reading_process_output): Likewise.
      * profiler.c (make_log, handle_profiler_signal): Likewise.
      * regex.c (re_exec): Likewise.
      * regex.h: Likewise.
      * search.c (looking_at_1, Freplace_match): Likewise.
      * sysdep.c (get_child_status, procfs_ttyname)
      (procfs_get_total_memory): Likewise.
      * systime.h (EMACS_TIME_VALID_P): Likewise.
      * term.c (dissociate_if_controlling_tty): Likewise.
      * window.c (get_phys_cursor_glyph): Likewise.
      * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
      (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
      Likewise.
      * xfns.c (Fx_window_property): Likewise.
      * xmenu.c (set_frame_menubar): Likewise.
      * xselect.c (x_get_window_property, x_handle_dnd_message):
      Likewise.
      * xsmfns.c (smc_save_yourself_CB): Likewise.
      * xterm.c (x_scroll_bar_set_handle): Likewise.
      908589fd
  26. 07 Mar, 2013 1 commit
    • Dmitry Antipov's avatar
      * lisp.h (list2i, list3i): New functions. · 3de717bd
      Dmitry Antipov authored
      (list4i): Move from window.c and make LISP_INLINE.
      * editfns.c (make_lisp_time):
      * fns.c (Flocale_info):
      * keyboard.c (parse_modifiers):
      * xterm.c (x_ewmh_activate_frame): Use list2i.
      * instel.c (signal_after_change):
      * nsfns.m (Fx_server_version, Fxw_color_values):
      * w32fns.c (Fxw_color_values, Fx_server_version):
      * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
      * fileio.c (Fvisited_file_modtime):
      * nsfns.m (Fns_display_usable_bounds):
      * w32.c (ltime): Use list4i.
      3de717bd
  27. 17 Feb, 2013 1 commit
  28. 24 Jan, 2013 1 commit
    • Dmitry Antipov's avatar
      Drop async_visible and async_iconified fields of struct frame. · edfa7fa0
      Dmitry Antipov authored
      This is possible because async input is gone; for details, see
      http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
      * frame.h (struct frame): Remove async_visible and async_iconified
      members, convert garbaged to unsigned bitfield.  Adjust comments.
      (FRAME_SAMPLE_VISIBILITY): Remove.  Adjust all users.
      (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
      * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
      Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
      FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
      * w32term.c: Ditto.
      (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
      properly.  Likewise for obscured.
      * xterm.c: Ditto.
      (handle_one_xevent): Save visible state go generate ICONIFY_EVENT
      properly.
      * nsterm.m: Ditto.
      (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
      edfa7fa0
  29. 11 Jan, 2013 2 commits
  30. 04 Jan, 2013 2 commits
  31. 02 Jan, 2013 1 commit
    • Paul Eggert's avatar
      Simplify via eabs. · 71376d4b
      Paul Eggert authored
      * dired.c (file_name_completion):
      * doc.c (get_doc_string):
      * floatfns.c (round2):
      * font.c (font_score, font_delete_unmatched):
      * fringe.c (compute_fringe_widths):
      * lread.c (read_list):
      * minibuf.c (Ftry_completion):
      * term.c (tty_ins_del_lines):
      * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
      Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
      71376d4b
  32. 01 Jan, 2013 1 commit
  33. 12 Dec, 2012 1 commit
  34. 08 Dec, 2012 1 commit
    • Paul Eggert's avatar
      Use putenv+unsetenv instead of modifying environ directly. · 5745a7df
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add putenv, unsetenv.
      * lib/putenv.c, lib/unsetenv.c, m4/putenv.m4, m4/setenv.m4:
      New files, copied automatically from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * src/alloc.c (xputenv): New function.
      * src/dbusbind.c (Fdbus_init_bus):
      * src/emacs.c (main):
      * src/xterm.c (x_term_init):
      Use xputenv instead of setenv or putenv, to detect memory exhaustion.
      * src/editfns.c (initial_tz): Move static var decl up.
      (tzvalbuf_in_environ): New static var.
      (init_editfns):	Initialize these two static vars.
      (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
      Save old TZ value on stack, if it's small.
      (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
      instead, use xputenv+unsetenv to set and restore TZ.
      (environbuf): Remove static var.  All uses removed.
      (Fset_time_zone_rule): Do not save TZ and environ;
      no longer needed here.
      (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
      Move to inside set_time_zone_rule; they don't need file scope any more.
      (set_time_zone_rule): Maintain the TZ=value string separately.
      (syms_of_editfns): Don't initialize initial_tz;
      init_editfns now does it.
      * src/emacs.c (dump_tz) [HAVE_TZSET]: Now const.
      * src/lisp.h (xputenv): New decl.
      
      Fixes: debbugs:13070
      5745a7df