summaryrefslogtreecommitdiff
path: root/src/xfaces.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * dispextern.h (struct face): Use bitfields for 'underline_type'Dmitry Antipov2013-10-281-5/+8
| | | | | | | | | | and 'box' members. Remove set-but-unused members 'pixmap_w' and 'pixmap_h'. If not HAVE_WINDOW_SYSTEM, also remove dummy 'stipple' member. Move 'lface' member up to help... * xfaces.c (make_realized_face): ...this function to find and clear just the members that need clearing. (load_face_colors, realize_x_face): * xdisp.c (extend_face_to_end_of_line): Adjust user.
* Make some functions static in non-Microsoft builds.Paul Eggert2013-10-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On my platform (Fedora 19 x86-64), this shrinks the Emacs executable (text+data) by 0.25%. * dispextern.h (erase_phys_cursor) [!WINDOWSNT]: (load_color) [!MSDOS]: * gnutls.h (emacs_gnutls_transport_set_errno) [!WINDOWSNT]: * keyboard.h (make_ctrl_char) [!WINDOWSNT]: * lisp.h (check_existing): * process.h (conv_sockaddr_to_lisp, network_interface_list) (network_interface_info) [!WINDOWSNT]: * termhooks.h (encode_terminal_code) [!WINDOWSNT]: Remove extern decls. * fileio.c (check_existing): * keyboard.c (make_ctrl_char) [!WINDOWSNT]: * process.c (conv_sockaddr_to_lisp, network_interface_list) (network_interface_info) [!WINDOWSNT]: * term.c (encode_terminal_code) [!WINDOWSNT]: * xdisp.c (erase_phys_cursor) [!WINDOWSNT]: * xfaces.c (load_color) [!MSDOS]: Now static. * fileio.c (check_existing, check_executable, check_writable): * process.c (network_interface_list, network_interface_info): Move earlier, so that we don't need forward decls. * gnutls.c (fn_gnutls_transport_set_errno) (emacs_gnutls_transport_set_errno) [!WINDOWNT]: Remove; unused. * w32.c (init_environment): Use faccessat rather than check_existing, partly for consistency with the rest of the code in this file, partly so that check_existing can be static.
* * xfaces.c (PT_PER_INCH): Remove unused macro.Dmitry Antipov2013-10-141-5/+0
| | | | | | | | | | * termhooks.h (struct terminal): Remove set-but-unused member fast_clear_end_of_line. (FRAME_FAST_CLEAR_END_OF_LINE): Remove. * nsterm.m (ns_create_terminal): * term.c (init_tty): * w32term.c (w32_create_terminal): * xterm.c (x_create_terminal): Adjust users.
* Fix bug #15565 with assertion violations in x_free_gc.Eli Zaretskii2013-10-091-2/+2
| | | | | src/xfaces.c (x_free_gc) [HAVE_X_WINDOWS, HAVE_NTGUI]: Don't pass expressions with side effects to eassert.
* Use union for the payload of struct Lisp_Vector.Dmitry Antipov2013-09-241-15/+15
| | | | | | | | | | | | This helps to avoid a few glitches dictated by C's aliasing rules. * lisp.h (struct Lisp_Vector): Use union for next and contents member. Adjust comment. Change related users. * alloc.c (next_in_free_list, set_next_in_free_list): Remove. Related users changed. * buffer.c, bytecode.c, ccl.c, character.h, chartab.c, composite.c: * composite.h, disptab.h, fns.c, fontset.c, indent.c, keyboard.c: * lread.c, msdos.c, process.c, w32menu.c, window.c, xdisp.c: * xfaces.c, xfont.c, xmenu.c: Related users changed.
* Unify FRAME_window_system_DISPLAY_INFO macros between all ports.Dmitry Antipov2013-09-131-8/+4
| | | | | | | | | | | | | | | | All of them are replaced with FRAME_DISPLAY_INFO, defined in each port to reference the port-specific window system data. * msdos.h (FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. * w32term.h (FRAME_W32_DISPLAY_INFO, FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. Adjust users. * xterm.h (FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. Adjust users. * frame.h (FRAME_RES_X, FRAME_RES_Y): Unify. * font.c, frame.c, gtkutil.c, image.c, menu.c, msdos.c, nsfns.m: * nsfont.m, nsterm.m, w32fns.c, w32font.c, w32menu.c, w32term.c: * w32xfns.c, widget.c, xdisp.c, xfaces.c, xfns.c, xfont.c, xmenu.c: * xselect.c, xterm.c: All related users changed.
* * fontset.c, window.c, xdisp.c (toplevel): Use TERM_HEADER.Dmitry Antipov2013-09-051-3/+0
| | | | * xfaces.c (toplevel) [HAVE_X_WINDOWS]: Do not include xterm.h twice.
* Make --without-x compatible with --enable-gcc-warnings.Dmitry Antipov2013-09-051-16/+20
| | | | | | | | | | | | | | | | | | | | | | | * configure.ac: If both --without-x and --enable-gcc-warnings are specified, use -Wno-unused-variable, -Wno-unused-but-set-variable and -Wno-unused-but-set-parameter. * src/font.c (register_font_driver): Move check under HAVE_WINDOW_SYSTEM. * src/font.h (struct font_driver): Move draw, get_bitmap and free_bitmap members under HAVE_WINDOW_SYSTEM. * src/keyboard.c (make_lispy_focus_out): Likewise. (record_menu_key): Move under HAVE_MENUS. * src/xdisp.c (toplevel): Move hourglass_shown_p, hourglass_atimer and THIN_SPACE_WIDTH under HAVE_WINDOW_SYSTEM. (syms_of_xdisp): Adjust user. (window_box_edges): Define only if HAVE_WINDOW_SYSTEM. (start_hourglass, cancel_hourglass): * src/xfaces.c (toplevel): Likewise with PT_PER_INCH, clear_font_table_count, CLEAR_FONT_TABLE_COUNT and CLEAR_FONT_TABLE_NFONTS. (set_font_frame_param, clear_face_gcs, realize_non_ascii_face): Declare only if HAVE_WINDOW_SYSTEM. (lface_same_font_attributes_p, clear_face_gcs): Define only if HAVE_WINDOW_SYSTEM.
* Fix minor problems found by static checking.Paul Eggert2013-08-261-1/+0
| | | | | | | | | | | | | | | * image.c (XGetPixel, XPutPixel) [HAVE_NS]: Now static. (expect): Avoid nested-if warning. (x_build_heuristic_mask) [HAVE_NS]: Avoid unused-var warning. * nsmenu.m (fillWithWidgetValue:): Avoid type warning. * nsterm.h, nsterm.m (ns_select): * xgselect.c, xgselect.h (xg_select): Adjust signature to better match pselect's. * nsterm.m (ns_select): Don't set *TIMEOUT, since pselect doesn't. * regex.c (whitespace_regexp): Now const_re_char *, to avoid diagnostic about assigning const char * to it. * xfaces.c (x_display_info) [HAVE_NS]: Remove; unused.
* * font.c (clear_font_cache): New function, stripped from...Dmitry Antipov2013-08-131-6/+4
| | | | | | | (Fclear_font_cache): ...here, which now uses the function above. Adjust comment. * font.h (clear_font_cache): Add prototype. * xfaces.c (clear_face_cache): Use clear_font_cache.
* Drop FRAME_PTR typedef.Dmitry Antipov2013-08-031-2/+2
| | | | | | | | | | | * 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.
* Avoid redundant Lisp_Object <-> struct frame conversions in font API.Dmitry Antipov2013-08-011-6/+3
| | | | | | | | | | | | | | | | | | * font.h (struct font_driver): Change list, match, and list_family functions to accept struct frame * as first arg. * font.c (font_score, font_compare, font_sort_entities): Remove prototypes. (font_sort_entities, font_list_entities, font_select_entity): (font_find_for_lface, Flist_fonts, Ffont_family_list): Adjust to match font API change. * xfont.c (xfont_list, xfont_match, xfont_list_family): * ftfont.c (ftfont_list, ftfont_match, ftfont_list_family): * ftxfont.c (ftxfont_list, ftxfont_match): * xftfont.c (xftfont_list, xftfont_match): * nsfont.m (nsfont_list, nsfont_match, nsfont_list_family): * w32font.c (w32font_list, w32font_match, w32font_list): (w32font_list_internal, w32_font_match_internal): Likewise. * xfaces.c (Fx_family_fonts): Adjust user.
* * xfaces.c (make_face_cache): For struct face_cache, preferDmitry Antipov2013-07-301-9/+6
| | | | | xmalloc to xzalloc and so avoid redundant call to memset. (Finternal_set_lisp_face_attribute): Fix comment typo and style.
* * fringe.c (draw_window_fringes, update_window_fringes)Dmitry Antipov2013-07-301-12/+13
| | | | | | | | | | | | | | | | | | | (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.
* Fix some minor file descriptor leaks and related glitches.Paul Eggert2013-07-191-12/+8
| | | | | | | | | | | | | | * filelock.c (create_lock_file) [!O_CLOEXEC]: Use fcntl with FD_CLOEXEC. (create_lock_file): Use write, not emacs_write. * image.c (slurp_file, png_load_body): * process.c (Fnetwork_interface_list, Fnetwork_interface_info) (server_accept_connection): Don't leak an fd on memory allocation failure. * image.c (slurp_file): Add a cheap heuristic for growing files. * xfaces.c (Fx_load_color_file): Block input around the fopen too, as that's what the other routines do. Maybe input need not be blocked at all, but it's better to be consistent. Avoid undefined behavior when strlen is zero.
* Prefer list1 (X) to Fcons (X, Qnil) when building lists.Paul Eggert2013-07-151-18/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Use emacs_open more consistently when opening files.Paul Eggert2013-07-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This handles EINTR more consistently now, and makes it easier to introduce other uniform changes to file descriptor handling. * src/systdio.h: New file. * src/buffer.c (mmap_init): * cygw32.c (chdir_to_default_directory): * dispnew.c (Fopen_termscript): * emacs.c (Fdaemon_initialized): * fileio.c (Fdo_auto_save): * image.c (slurp_file, png_load_body, jpeg_load_body): * keyboard.c (Fopen_dribble_file): * lread.c (Fload): * print.c (Fredirect_debugging_output): * sysdep.c (get_up_time, procfs_ttyname, procfs_get_total_memory): * termcap.c (tgetent): * unexaix.c, unexcoff.c (unexec, adjust_lnnoptrs): * unexcw.c, unexelf.c, unexhp9k800.c, unexmacosx.c (unexec): * w32term.c (w32_initialize) [CYGWIN]: * xfaces.c (Fx_load_color_file): Use emacs_open instead of plain open, and emacs_fopen instead of plain fopen. * dispnew.c, fileio.c, image.c, keyboard.c, lread.c, print.c, sysdep.c: * xfaces.c: Include sysstdio.h rather than stdio.h, for emacs_fopen. * callproc.c (default_output_mode): New constant. (Fcall_process): Use it to call emacs_open instead of plain creat. * dispnew.c (Fopen_termscript): Fix minor race in opening termscript. * sysdep.c (emacs_open): Add commentary and don't call file name "path". (emacs_fopen): New function. * unexaix.c, unexcoff.c, unexelf.c, unexhp9k800.c, unexmacosx.c: Include <lisp.h>, for emacs_open. * unexelf.c (fatal): Remove decl; not needed with <lisp.h> included.
* Remove duplicate #include directives.Paul Eggert2013-07-051-1/+0
| | | | | | | | | | | | | | | | * 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.
* Get rid of some platform-specific functions examining windowDmitry Antipov2013-04-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system and its capabilities. This is a partial rework of the 2013-04-05 change. * lisp.h (have_menus_p): Remove prototype. This function is replaced with platform-independent window_system_available. (check_window_system): Move to... * frame.h (decode_window_system_frame, window_system_available): ...here, add new prototypes. * frame.c (window_system_available, decode_window_system_frame): New functions. (check_window_system): Platform-independent now. * xterm.h (x_in_use): Remove declaration. (check_x_frame): * w32term.h (check_x_frame): * nsterm.h (check_x_frame): Remove prototypes. This function is replaced with platform-independent decode_window_system_frame. * msdos.c (have_menus_p): Remove. * nsfns.m (check_window_system, have_menus_p, check_ns_frame): Remove platform-specific functions. Use check_window_system, decode_window_system_frame and check_ns_display_info where appropriate. Minor style and comment tweaks. * w32fns.c (w32_in_use, check_window_system, have_menus_p) (check_x_frame): Likewise. * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame): Likewise. * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m: * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c: * xmenu.c, xselect.c: All related users changed.
* Consistently use platform-specific function to detect window system.Dmitry Antipov2013-04-051-3/+1
| | | | | | | | | | | | | | | | | | * lisp.h (check_window_system): New prototype. This function is going to replace check_x, check_w32 and check_ns. (have_menus_p): Mention msdos.c in comment. * fontset.c (check_window_system_func): Remove. Adjust all users. * fontset.h (check_window_system_func): Remove prototype. * nsterm.h (check_ns): * xterm.h (check_x): * w32term.h (check_w32): Likewise. * menu.c (Fx_popup_menu): Use check_window_system. * msdos.c (check_window_system): Define for MS-DOS. * nsfns.m (check_window_system): Define for NS. Adjust all users. * w32fns.c (check_window_system): Likewise for MS-Windows. * xfns.c (check_window_system): Likewise for X. * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c: * xfaces.c, xmenu.c: Use check_window_system where appropriate.
* * window.h (struct window): Replace hchild, vchild and buffer slotsDmitry Antipov2013-03-281-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the only contents slot. This is possible because each valid window may have either the child window (in vertical or horizontal combination) or buffer to display (for the leaf window). Using that, a lof of operations to traverse and/or change window hierarchies may be simplified. New member horizontal is used to distinguish between horizontal and vertical combinations of internal windows. (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P) (WINDOW_VERTICAL_COMBINATION_P): New macros. (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes. * window.c (wset_hchild, wset_vchild): Remove. Adjust all users. Use contents slot, not buffer, where appropriate. (wset_combination): New function. (wset_buffer): Add eassert. (Fframe_first_window): Simplify the loop reaching first window. (Fwindow_buffer): Use WINDOW_LEAF_P. (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P. (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P. (unshow_buffer): Convert initial debugging check to eassert. (replace_window, recombine_windows, Fdelete_other_windows_internal) (make_parent_window, window_resize_check, window_resize_apply) (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal) (Fset_window_configuration, delete_all_child_windows, save_window_save): Adjust to match struct window changes. (window_loop): Check for broken markers in CHECK_ALL_WINDOWS. (mark_window_cursors_off, count_windows, get_leaf_windows) (foreach_window_1): Simplify the loop. * alloc.c (mark_object): Do not check for the leaf window because internal windows has no glyph matrices anyway. * dispnew.c (clear_window_matrices, showing_window_margins_p) (allocate_matrices_for_window_redisplay, fake_current_matrices) (allocate_matrices_for_frame_redisplay, free_window_matrices) (build_frame_matrix_from_window_tree, mirror_make_current) (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers) (update_window_tree, set_window_update_flags): Simplify the loop. (sync_window_with_frame_matrix_rows): Enforce live window. Use contents slot, not buffer, where appropriate. * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P and WINDOW_HORIZONTAL_COMBINATION_P. (make_frame_visible_1): Simplify the loop. Use contents slot, not buffer, where appropriate. * xdisp.c (hscroll_window_tree, mark_window_display_accurate) (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree) (expose_window_tree): Likewise. Use contents slot, not buffer, where appropriate. * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW to avoid deleted windows. Use contents slot instead of buffer. * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c: * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c: * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c: * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
* * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argumentDmitry Antipov2013-03-241-8/+9
| | | | | | to be optional or nil. Adjust comment and convert it to docstring. * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message. * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
* * frame.h (struct frame): Drop resx and resy because the same data isDmitry Antipov2013-03-201-2/+2
| | | | | | | | | | | | | | | available from window system-specific output context. Adjust users. (default_pixesls_per_inch_x, default_pixesls_per_inch_y): New functions to provide defaults when no window system available. (FRAME_RES_X, FRAME_RES_Y): New macros. (NUMVAL): Moved from xdisp.c. * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface) (Ffont_face_attributes, Fopen_font): * image.c (gs_load): * w32font.c (fill_in_logfont): * xdisp.c (calc_pixel_width_or_height): * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them. * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
* Spelling fixes.Paul Eggert2013-03-181-1/+1
|
* * composite.c (fill_gstring_header): Remove useless prototype.Dmitry Antipov2013-02-151-1/+1
| | | | | | | | | | | | | Break long line. * lisp.h (message_dolog, compile_pattern): Adjust prototype. * print.c (PRINTDECLARE, print_object): * search.c (compile_pattern, fast_looking_at, search_buffer): (simple_search, boyer_moore, Freplace_match): * xdisp.c (c_string_pos, number_of_chars, message_dolog): (get_overlay_arrow_glyph_row, display_mode_element): (decode_mode_spec_coding, message3): * xfaces.c (face_at_string_position): Use bool for booleans. Adjust comments.
* * lisp.h (make_uninit_vector): New function.Dmitry Antipov2013-02-081-1/+1
| | | | | | | | | | | | | | | | | | * alloc.c (Fvector, Fmake_byte_code): * ccl.c (Fregister_ccl_program): * charset.c (Fdefine_charset_internal, define_charset_internal): * coding.c (make_subsidiaries, Fdefine_coding_system_internal): * composite.c (syms_of_composite): * font.c (Fquery_font, Ffont_info, syms_of_font): * fontset.c (FONT_DEF_NEW, Fset_fontset_font): * ftfont.c (ftfont_shape_by_flt): * indent.c (recompute_width_table): * nsselect.m (clean_local_selection_data): * syntax.c (init_syntax_once): * w32unsubscribe.c (uniscribe_shape): * window.c (Fcurrent_window_configuration): * xfaces.c (Fx_family_fonts): * xselect.c (selection_data_to_lisp_data): Use it.
* * lisp/textmodes/flyspell.el (flyspell-incorrect, flyspell-duplicate):Juri Linkov2013-01-091-0/+2
| | | | | | | | | | * lisp/progmodes/flymake.el (flymake-errline, flymake-warnline): Use underline style wave on terminals that support it. * src/xfaces.c (tty_supports_face_attributes_p): Return 0 for the case of (supports :underline (:style wave)). Fixes: debbugs:13000
* Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.caPaul Eggert2013-01-021-1/+1
|\
| * Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
| |
* | Merge from emacs-24; up to 2012-11-13T18:57:26Z!dgutov@yandex.ruGlenn Morris2012-11-161-0/+8
|\ \ | |/
| * Fixes related to face underliningGlenn Morris2012-11-141-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/faces.el (face-underline-p): Doc fix. Handle :underline being things other than `t' (a string, a list). (face-inverse-video-p): Doc fix. (set-face-underline): Rename it back from set-face-underline-p. Doc fix. Allow interactive input of values other than t. (read-face-attribute): Apply formatting to :underline, since like :box and :stipple it can take list values. * doc/lispref/display.texi (Face Attributes): Fix :underline COLOR description. (Attribute Functions): Update for set-face-underline rename. Tweak descriptions of face-underline-p, face-inverse-video-p. * etc/NEWS: Related edit.
* | Simplify by using FOR_EACH_FRAME here and there.Dmitry Antipov2012-11-121-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.c (next_frame, prev_frame, other_visible_frames) (delete_frame, visible-frame-list): Use FOR_EACH_FRAME. * w32term.c (x_window_to_scroll_bar): Likewise. * window.c (window_list): Likewise. * xdisp.c (x_consider_frame_title): Likewise. * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise. * xfns.c (x_window_to_frame, x_any_window_to_frame) (x_menubar_window_to_frame, x_top_window_to_frame): Likewise. * xmenu.c (menubar_id_to_frame): Likewise. * xselect.c (frame_for_x_selection): Likewise. * xterm.c (x_frame_of_widget, x_window_to_scroll_bar) (x_window_to_menu_bar): Likewise. * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
* | * src/xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)Stefan Monnier2012-11-081-17/+0
| | | | | | | | | | | | (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed) (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded): Remove unused vars.
* | Widely used frame validity and checking functions.Dmitry Antipov2012-11-061-78/+20
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * frame.h (decode_live_frame, decode_any_frame): Add prototypes. * frame.c (decode_live_frame, decode_any_frame): New functions. (delete_frame, Fredirect_frame_focus, Fframe_parameters) (Fframe_parameter, Fframe_char_height, Fframe_char_width) (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width) (Fframe_pointer_visible_p): Use decode_any_frame. (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame) (Fraise_frame, Flower_frame, Fmodify_frame_parameters) (Fset_frame_height, Fset_frame_width): Use decode_live_frame. (Fframe_focus): Likewise. Allow zero number of arguments. Adjust docstring. (frame_buffer_list, frame_buffer_predicate): Remove. * lisp.h (frame_buffer_predicate): Remove prototype. * buffer.c (Fother_buffer): Use decode_any_frame. * xdisp.c (Ftool_bar_lines_needed): Likewise. * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise. * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font) (Fclose_font, Ffont_info): Use decode_live_frame. * fontset.c (check_fontset_name): Likewise. * terminal.c (Fframe_terminal): Likewise. * w32fns.c (check_x_frame): Likewise. * window.c (Fminibuffer_window, Fwindow_at) (Fcurrent_window_configuration): Likewise. (Frun_window_configuration_change_hook, Fwindow_resize_apply): Likewise. Allow zero number of arguments. Adjust docstring. * dispnew.c (Fredraw_frame): Likewise. * xfaces.c (frame_or_selected_frame): Remove. (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font) (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p) (Fframe_face_alist): Use decode_live_frame. * xfns.c (check_x_frame): Likewise.
* Make unused variable font-list-limit obsolete, and move it out of C.Chong Yidong2012-10-231-8/+0
| | | | | | | | | | | * display.texi (Font Lookup): Remove font-list-limit. * lisp/startup.el (command-line): * lisp/cus-start.el: Don't refer to font-list-limit. * lisp/faces.el (font-list-limit): Define as an obsolete variable. * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
* Port to OpenBSD 5.1.Paul Eggert2012-10-201-11/+17
| | | | | | | | | | | | | | | | | | | | | * frame.c (Fmouse_position, Fmouse_pixel_position): * xdisp.c (produce_stretch_glyph): Declare local vars only when they're needed. This is clearer and avoids a warning on OpenBSD about unused vars. * frame.h (FRAME_WINDOW_P): Always evaluate its argument. This is safer, and avoids OpenBSD warnings about unused vars. * keyboard.c (record_menu_key): Remove unnecessary decl. (poll_timer): Define only if POLL_FOR_INPUT is defined. * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined, as our definition clashes with OpenBSD's. * xfaces.c (load_face_colors, check_lface_attrs) (get_lface_attributes_no_remap, get_lface_attributes) (lface_fully_specified_p, x_supports_face_attributes_p) (tty_supports_face_attributes_p, face_fontset, realize_face) (realize_x_face, realize_tty_face): Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not merely Lisp_Object *. This is more informative and avoids a warning on OpenBSD about accessing beyond an object's size.
* Merge from trunkDaniel Colascione2012-10-071-51/+51
|\
| * Prefer plain 'static' to 'static inline'.Paul Eggert2012-09-301-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With static functions, modern compilers inline pretty well by themselves; advice from programmers often hurts as much as it helps. On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'), this change shrinks the text size of the Emacs executable by 1.1% without affecting CPU significantly in my benchmark. * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p) (live_float_p, live_misc_p, live_vector_p, live_buffer_p) (mark_maybe_object, mark_maybe_pointer, bounded_number): * buffer.c (bset_abbrev_mode, bset_abbrev_table) (bset_auto_fill_function, bset_auto_save_file_format) (bset_auto_save_file_name, bset_backed_up, bset_begv_marker) (bset_bidi_display_reordering, bset_buffer_file_coding_system) (bset_cache_long_line_scans, bset_case_fold_search) (bset_ctl_arrow, bset_cursor_in_non_selected_windows) (bset_cursor_type, bset_display_table, bset_extra_line_spacing) (bset_file_format, bset_file_truename, bset_fringe_cursor_alist) (bset_fringe_indicator_alist, bset_fringes_outside_margins) (bset_header_line_format, bset_indicate_buffer_boundaries) (bset_indicate_empty_lines, bset_invisibility_spec) (bset_left_fringe_width, bset_major_mode, bset_mark) (bset_minor_modes, bset_mode_line_format, bset_mode_name) (bset_name, bset_overwrite_mode, bset_pt_marker) (bset_right_fringe_width, bset_save_length) (bset_scroll_bar_width, bset_scroll_down_aggressively) (bset_scroll_up_aggressively, bset_selective_display) (bset_selective_display_ellipses, bset_vertical_scroll_bar_type) (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before) (set_buffer_overlays_after): * category.c (bset_category_table): * charset.c (read_hex): * coding.c (produce_composition, produce_charset) (handle_composition_annotation, handle_charset_annotation) (char_encodable_p): * dispnew.c (swap_glyph_pointers, copy_row_except_pointers) (assign_row, set_frame_matrix_frame, make_current) (add_row_entry): * eval.c (set_specpdl_symbol, set_specpdl_old_value): * fns.c (maybe_resize_hash_table): * frame.c (fset_buffer_predicate, fset_minibuffer_window): * gmalloc.c (register_heapinfo): * image.c (lookup_image_type): * intervals.c (set_interval_object, set_interval_left) (set_interval_right, copy_interval_parent, rotate_right) (rotate_left, balance_possible_root_interval): * keyboard.c (kset_echo_string, kset_kbd_queue) (kset_keyboard_translate_table, kset_last_prefix_arg) (kset_last_repeatable_command, kset_local_function_key_map) (kset_overriding_terminal_local_map, kset_real_last_command) (kset_system_key_syms, clear_event, set_prop): * lread.c (digit_to_number): * marker.c (attach_marker, live_buffer, set_marker_internal): * nsterm.m (ns_compute_glyph_string_overhangs): * process.c (pset_buffer, pset_command) (pset_decode_coding_system, pset_decoding_buf) (pset_encode_coding_system, pset_encoding_buf, pset_filter) (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel) (pset_status, pset_tty_name, pset_type, pset_write_queue): * syntax.c (bset_syntax_table, dec_bytepos): * terminal.c (tset_param_alist): * textprop.c (interval_has_some_properties) (interval_has_some_properties_list): * window.c (wset_combination_limit, wset_dedicated) (wset_display_table, wset_hchild, wset_left_fringe_width) (wset_left_margin_cols, wset_new_normal, wset_new_total) (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm) (wset_right_fringe_width, wset_right_margin_cols) (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild) (wset_vertical_scroll_bar_type, wset_window_parameters): * xdisp.c (wset_base_line_number, wset_base_line_pos) (wset_column_number_displayed, wset_region_showing) (window_box_edges, run_window_scroll_functions) (append_glyph_string_lists, prepend_glyph_string_lists) (append_glyph_string, set_glyph_string_background_width) (append_glyph, append_composite_glyph) (take_vertical_position_into_account): * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors) (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive) (lface_hash, lface_same_font_attributes_p, lookup_face): * xml.c (libxml2_loaded_p): * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc) (x_set_glyph_string_clipping, x_clear_glyph_string_rect): Now 'static', not 'static inline'. Fixes: debbugs:12541
| * image.c, indent.c: Use bool for booleans.Paul Eggert2012-09-241-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| * Simplify and avoid signal-handling races.Paul Eggert2012-09-231-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Merge from trunkDaniel Colascione2012-09-171-55/+17
|\ \ | |/
| * Port better to POSIX hosts lacking _setjmp.Paul Eggert2012-09-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * Prefer assignment to memcpy when either will do.Paul Eggert2012-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * lib-src/pop.c (socket_connection) [HAVE_GETADDRINFO]: * src/bidi.c (bidi_push_it, bidi_pop_it): * src/fns.c (copy_hash_table): * src/image.c (define_image_type): * src/keyboard.c (kbd_buffer_store_event_hold): * src/process.c (Fprocess_send_eof): * src/xfaces.c (x_create_gc) [HAVE_NS]: * src/xgselect.c (xg_select): Use assignment, not memcpy, as either will do here, and assignment is more likely to catch type errors.
| * Simplify redefinition of 'abort' (Bug#12316).Paul Eggert2012-09-041-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Clean up some extern decls.Paul Eggert2012-09-021-40/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Implement cygw32Daniel Colascione2012-09-171-9/+9
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Here, we use the generic window-system configuration system we just implemented to support the w32 window-system in the mainline build under Cygwin. (Previously, the w32 window system could only be compiled as part of the NT-native Emacs build process.) The changes in this patch need to be applied atomically in order to avoid breaking Emacs. The changes include: - Changes throughout the Lisp and C code to not assume that NT Emacs and the w32 window system are synonymous. - Wiring up the regular select(2) event loop to Windows messages - Cleaning up the w32 drag-and-drop receiving code. - Exposing Cygwin path conversion functions to elisp. - Unicode file dialog support when compiling for Cygwin. - Splitting the w32 term lisp initialization code into code applicable to any w32 window-system and code specific to system-type windows-nt. - Integrating the old and new w32 code into the build system.
* Refactor window-system configurationDaniel Colascione2012-08-311-12/+8
| | | | | | | | | | This change streamlines the window system selection code in configure.in and moves many common function declarations from window-specific headers to frame.h. It introduces a new TERM_HEADER macro in config.h: we set this macro to the right header to use for the window system for which we're compiling Emacs and have source files include it indirectly. This way, we don't have to teach every file about every window system.
* Avoid direct writes to contents member of struct Lisp_Vector.Dmitry Antipov2012-08-211-5/+4
| | | | | | | | | | | | | * lisp.h (vcopy): New function to copy data into vector. * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET. * fns.c (Ffillarray): Use ASET. * keyboard.c (timer_check_2): Use AREF and ASET. (append_tool_bar_item, Frecent_keys): Use vcopy. * lread.c (read_vector): Use ASET. * msdos.c (Frecent_doskeys): Use vcopy. * xface.c (Finternal_copy_lisp_face): Use vcopy. (Finternal_merge_in_global_face): Use ASET and vcopy. * xfont.c (xfont_list_pattern): Likewise.
* * frame.h (FSET): Remove (Bug#12215).Paul Eggert2012-08-171-1/+1
| | | | | | | | | | | | | | | | | Replace all uses with calls to new setter functions. Use INLINE_HEADER_BEGIN, INLINE_HEADER_END. (FRAME_INLINE): New macro. (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars) (fset_current_tool_bar_string, fset_desired_tool_bar_string) (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items) (fset_menu_bar_vector, fset_menu_bar_window, fset_name) (fset_param_alist, fset_root_window, fset_scroll_bars) (fset_selected_window, fset_title, fset_tool_bar_items) (fset_tool_bar_position, fset_tool_bar_window): New functions. * frame.c (FRAME_INLINE): Define to EXTERN_INLINE, so that the corresponding functions are compiled into code. (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
* Allow face-remapping using :font, and use it in mouse-appearance-menu.Chong Yidong2012-08-171-18/+33
| | | | | | | | | | | | * mouse.el (mouse-appearance-menu): If x-select-font returns a font spec, set the font directly. * xfaces.c (merge_face_vectors): If the target font specfies a font spec, make the font's attributes take precedence over directly-specified attributes. (merge_face_ref): Recognize :font. Fixes: debbugs:3228