1. 01 Jan, 2019 1 commit
  2. 01 Jan, 2018 1 commit
  3. 30 Sep, 2017 1 commit
  4. 08 Sep, 2017 1 commit
  5. 11 Jul, 2017 1 commit
    • NicolasPetton's avatar
      Add an optional testfn parameter to assoc · 0bece6c6
      NicolasPetton authored
      * src/fns.c (assoc): New optional testfn parameter used for comparison
      when provided.
      * test/src/fns-tests.el (test-assoc-testfn): Add tests for the new
      'testfn' parameter.
      * src/buffer.c:
      * src/coding.c:
      * src/dbusbind.c:
      * src/font.c:
      * src/fontset.c:
      * src/gfilenotify.c:
      * src/image.c:
      * src/keymap.c:
      * src/process.c:
      * src/w32fns.c:
      * src/w32font.c:
      * src/w32notify.c:
      * src/w32term.c:
      * src/xdisp.c:
      * src/xfont.c: Add a third argument to Fassoc calls.
      * etc/NEWS:
      * doc/lispref/lists.texi: Document the new 'testfn' parameter.
      0bece6c6
  6. 02 May, 2017 1 commit
    • Eli Zaretskii's avatar
      Avoid compilation warnings · 5f75304f
      Eli Zaretskii authored
      * src/w32fns.c (Fx_file_dialog, w32_parse_and_hook_hot_key):
      * src/w32term.c (x_draw_glyph_string):
      * src/w32fns.c (compute_tip_xy):
      * src/w32font.c (w32font_text_extents):
      * src/w32menu.c (set_frame_menubar):
      * src/search.c (Freplace_match): Avoid compiler warnings in
      optimized builds.
      5f75304f
  7. 12 Apr, 2017 1 commit
    • Martin Rudalics's avatar
      Add new frame parameters and associated functions · 3fdd3bb5
      Martin Rudalics authored
      Add new frame parameters `undecorated', `override-redirect',
      `parent-frame', `skip-taskbar', `no-focus-on-map',
      `no-accept-focus', `z-group', `delete-before', `no-other-frame',
      `mouse-wheel-frame', `min-width', `min-height'.  Add new
      functions `frame-restack' and `frame-list-z-order'.
      
      * lisp/cus-start.el (focus-follows-mouse): Adapt customization
      type.
      * lisp/frame.el (handle-delete-frame): Handle child and
      `delete-before' frames.
      (other-frame): Stop looking for other frame after one round.
      (frame-list-z-order, frame-restack): New functions.
      (delete-other-frames): Handle child frames.
      * lisp/frameset.el (frameset-persistent-filter-alist)
      (frameset--record-relationships): Handle `delete-before',
      `parent-frame' and `mouse-wheel-frame' parameters.  Rename
      latter from `frameset--record-minibuffer-relationships'.
      (frameset--restore-frame): Handle ‘parent-frame’ parameter
      specially.
      (frameset-restore): Handle `delete-before', `parent-frame' and
      `mouse-wheel-frame' parameters.
      * lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
      parameter.
      * lisp/window.el (window--min-size-ignore-p): Fix doc-string.
      (mouse-autoselect-window-select, handle-select-window): Major
      rewrite.  Try to not ignore errors.  Handle auto-selection of
      child frames and different values of `focus-follows-mouse'.
      * src/frame.c (frame_windows_min_size): Handle new `min-width'
      and `min-height' frame parameters.
      (make_frame): Initialize new frame structure members.
      (do_switch_frame): Don't reset internal_last_event_frame for
      descendant frames.
      (Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
      functions.
      (candidate_frame): Don't return `no-other-frame' frame.
      (other_frames): New function replacing other_visible_frames.
      (delete_frame): Rewrite.  Handle child and `delete-before' frames.
      (Fmake_frame_invisible): Call other_frames.
      (store_frame_param): Check `delete-before' and `parent-frame'
      parameters for circular dependencies.
      (frame_parms, syms_of_frame): Add entries for and define new
      frame parameters.
      (focus_follows_mouse): New meaningful value `auto-raise'.
      * src/frame.h (z_group): New enumeration type.
      (frame): New slots parent_frame, undecorated, override_redirect,
      skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
      (fset_parent_frame): New inlined function.
      (FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
      (FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
      (FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
      (FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
      (FRAME_Z_GROUP_BELOW): New macros.
      (frame_ancestor_p): Add declaration.
      * src/gtkutil.c (xg_create_frame_widgets): Handle
      `undecorated' and `override-redirect' frame parameters.
      (x_wm_set_size_hint): None for child frames.
      (xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
      (xg_set_no_focus_on_map, xg_set_no_accept_focus)
      (xg_set_override_redirect): New functions.
      (xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
      Don't let scrollbars obscure child frames.
      * src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
      (xg_set_skip_taskbar, xg_set_no_focus_on_map)
      (xg_set_no_accept_focus, xg_set_override_redirect): Add extern
      declarations.
      * src/nsfns.m (ns_frame_parm_handlers): Add entries for new
      frame parameters.
      (Fx_create_frame): Install `min-width' and `min-height' frame
      parameters.
      * src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
      * src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
      (x_real_positions): Handle child frames.
      (x_set_menu_bar_lines): Don't for child frames.
      (x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
      (x_set_no_focus_on_map, x_set_no_accept_focus)
      (x_set_z_group): New functions.
      (w32_createvscrollbar, w32_createhscrollbar): Don't draw
      scroll bars over child frames.
      (w32_createwindow): Handle new frame parameters and child frames.
      (w32_wnd_proc): Let mouse clicks into a child frame activate
      the frame.  Try to handle the `no-accept-focus' parameter.  Do
      SetFocus when our window is brought to top or becomes the
      foreground window.
      (w32_window): Don't initialize menu bar for child frames.
      (Fx_create_frame): Handle new frame parameters.
      (x_create_tip_frame): Set explicit_parent slot.
      (w32_dialog_in_progress): New function.
      (Fx_file_dialog): Handle `z-group-above' frames.
      (w32_frame_list_z_order, Fw32_frame_list_z_order)
      (w32_frame_restack, Fw32_frame_restack): New functions.
      (w32_frame_parm_handlers): Add entries for new frame
      parameters.
      * src/w32font.c (Fx_select_font): Handle `z-group-above'
      frames during font selection dialogue.
      * src/w32term.c (construct_mouse_wheel): Construct mouse wheel
      event from F's w32 window.
      (w32_mouse_position): Handle child frames.
      (w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
      Don't draw scroll bars over child frames.
      (w32_read_socket): Always erase background of child frames.
      When generating SELECT_WINDOW_EVENTs handle new value of
      `focus-follows-mouse' and handle `no-accept-focus' parameter.
      Handle `mouse-wheel-frame' parameter.
      (x_calc_absolute_position, x_set_offset, x_set_window_size):
      Handle child frames.
      (x_make_frame_visible): Handle child frames specially.  Handle
      `no-focus-on-map' parameter.
      * src/w32term.h (w32_dialog_in_progress): Add external
      declaration.
      * src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
      for child frames.
      * src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
      (PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
      non-Motif, non-GTK case.
      (x_real_pos_and_offsets): Handle child frames.
      (x_set_undecorated, x_set_parent_frame)
      (x_set_no_focus_on_map, x_set_no_accept_focus)
      (x_set_override_redirect): New functions.
      (x_set_menu_bar_lines): Not for child frames.
      (x_window): Handle `undecorated' and `override_redirect' cases.
      (Fx_create_frame): Handle new frame parameters.
      (frame_geometry): Handle child frames and outer border.
      (x_frame_list_z_order, Fx_frame_list_z_order)
      (x_frame_restack, Fx_frame_restack): New functions.
      (Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
      (x_frame_parm_handlers): Add entries for new frame parameters.
      * src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
      frames.
      * src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
      for child frames.
      (XTmouse_position): Handle child frames.
      (x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
      bars obscure child frames.
      (handle_one_xevent): Handle child frame positions.  If necessary
      set `skip-taskbar' and reassign proper `z-group' when we are
      mapped.  When generating SELECT_WINDOW_EVENTs handle new value
      of `focus-follows-mouse'.  Handle `mouse-wheel-frame' parameter.
      Let mouse clicks into a child frame activate the frame.
      (x_calc_absolute_position, x_set_offset): Handle child frames
      specially.
      (x_set_skip_taskbar, x_set_z_group): New functions.
      (x_make_frame_visible): Handle child frames.
      (ATOM_REFS_INIT): Add entries for
      Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
      Xatom_net_wm_state_below.
      * src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
      Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
      (x_set_skip_taskbar, x_set_z_group): Add extern declarations.
      3fdd3bb5
  8. 23 Feb, 2017 1 commit
    • Eli Zaretskii's avatar
      Avoid quitting inside a critical section on MS-Windows · 5114b3a2
      Eli Zaretskii authored
      * src/w32uniscribe.c (uniscribe_list_family):
      * src/w32font.c (w32font_list_family, w32font_text_extents)
      (w32font_list_internal, w32font_match_internal)
      (list_all_matching_fonts): Prevent quitting while these functions
      cons lists of fonts, to avoid leaving the critical section taken
      by the main thread, which will then cause any other thread
      attempting to enter the critical section to hang.  (Bug#25279)
      5114b3a2
  9. 01 Jan, 2017 1 commit
  10. 01 Dec, 2016 1 commit
  11. 21 Jun, 2016 1 commit
    • Ken Brown's avatar
      Fix compiler warnings in Cygwin-w32 build · 560c4ab1
      Ken Brown authored
      * src/conf_post.h (DebPrint) [!EMACSDEBUG]: Add empty do-while
      loop to avoid compiler warnings about empty body of 'if'
      statement.
      
      * src/image.c [HAVE_NTGUI] (DefaultDepthOfScreen): Disable unused
      macro.
      (x_create_bitmap_from_data): Declare 'frame'.
      (x_create_bitmap_from_file): Don't declare unused variable
      'dpyinfo'.
      
      * src/lisp.h (AUTO_STRING_WITH_LEN): Avoid initialization to
      prevent "jump-misses-init" compiler warnings.
      
      * src/w32fns.c (check_w32_winkey_state): Define and use only if
      WINDOWSNT.
      (Fx_show_tip): Declare 'f'.
      (Fx_file_dialog): Declare 'filter_a' only if not NTGUI_UNICODE.
      (w32_strerror): Use format specifier %d for sprintf argument of
      type int.
      (emacs_abort): Cast sprintf argument of type DWORD to unsigned
      int, and use format specifier %x, for compatibility with Cygwin.
      (unicode_append_menu) [NTGUI_UNICODE]:
      * src/w32menu.c [NTGUI_UNICODE] (get_menu_item_info)
      (set_menu_item_info, unicode_append_menu)
      (unicode_message_box):
      * src/menu.c [NTGUI_UNICODE] (unicode_append_menu): Define as
      functions rather than macros to avoid "address will always
      evaluate as true" compiler warnings.
      
      * src/w32font.c (w32_to_x_charset): Use format specifier %d for
      sprintf argument of type int.
      
      * src/w32term.c (x_draw_glyphless_glyph_string_foreground): Cast
      sprintf argument of type int to unsigned int to match %X format
      specifier.
      (w32_scroll_bar_handle_click):
      (w32_horizontal_scroll_bar_handle_click): Declare 'f'.
      
      * src/w32term.h (FRAME_DISPLAY_INFO): Explicitly discard unused
      argument.
      560c4ab1
  12. 21 May, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix compiler warnings in the MinGW build · cb5af792
      Eli Zaretskii authored
      * configure.ac [mingw32]: Don't add -Wpointer-sign, and add
      -Wno-pointer-sign, to keep the noise level down.
      
      * nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
      -Wredundant-decls, as that produces a lot of noise due to
      redeclaration of time-related functions by gnulib.
      * nt/runemacs.c (set_user_model_id): Fix argument type of
      'SetCurrentProcessExplicitAppUserModelID'.
      
      * src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
      declare 'dpyinfo', as it is unused.
      (xpm_load): Fix warnings about pointer signedness.
      * src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
      prototypes.
      (sys_spawnve): Avoid warnings about discarding 'const' qualifier.
      (sys_select): Provide prototype.
      (g_b_init_compare_string_w): Move declaration to file scope.
      * src/w32heap.c (dumped_data_commit): Now static.
      (FREEABLE_P): Avoid warnings about pointer comparison with integer.
      (mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
      * src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
      (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
      Provide prototypes.
      * src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
      redundant prototypes.
      (w32_get_internal_run_time, map_w32_filename): Provide prototype.
      (init_environment, sys_ctime): Avoid warnings about discarding
      'const' qualifier.
      Include utimens.h.
      (sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
      (sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
      (sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
      prototypes.
      (sys_rename_replace): Use %d to avoid compiler warnings.
      (_wsa_errlist): Make the message text 'const char *', to avoid
      compilation warnings.
      (dynlib_reset_last_error): Move prototype to file scope.
      (w32_get_resource): First argument is now 'const char *'.
      * src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
      (otf_features): Second argument is no 'const char *'.
      * src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
      (x_set_window_size): Remove redundant prototypes.
      (XChangeGC, XGetGCValues, w32_draw_underwave)
      (w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
      (x_calc_absolute_position, x_destroy_window): Now static.
      (menubar_selection_callback): Move prototype to file scope.
      * src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
      declaration.
      (w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
      (w32font_full_name): Fix warnings about implicit conversion of
      'float' to 'double'.
      * src/w32reg.c (w32_get_rdb_resource): Fix warnings about
      discarding 'const' qualifier.
      * src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
      (set_frame_menubar): Remove redundant prototypes.
      (menubar_selection_callback, w32_menu_display_help): Provide
      prototypes.
      (simple_dialog_show): Avoid warnings about discarding 'const'
      qualifier.
      * src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
      (free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
      (x_set_tool_bar_lines, x_set_internal_border_width): Remove
      redundant prototypes.
      (current_popup_menu): Remove redundant declaration.
      (colormap_t): Member 'name' is now 'const char *'.
      (add_system_logical_colors_to_map): Fix signed/unsigned warnings.
      (x_decode_color, x_set_border_pixel)
      (x_clear_under_internal_border, x_set_name, hook_w32_key)
      (reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
      static.
      (w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
      (w32_msg_worker, w32_last_error): Provide prototypes.
      (funhook, lookup_vk_code): Avoid warnings about missing
      parentheses.
      (x_default_font_parameter, Fw32_notification_notify): Avoid
      warnings about discarding 'const' qualifier.
      (Fx_create_frame): Avoid warnings about empty body of 'else'.
      (x_screen_planes): Ifdef away unused function.
      (Fx_show_tip): Remove unused variables.
      (Fw32_battery_status): Avoid warnings about implicit promotion
      from float to double.
      (Fw32_notification_notify): Initialize 'timeout'.
      * src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
      define the TIMER_SETTIME_RUNNING value if it will be used.
      * src/w32notify.c (send_notifications): Ifdef away an empty if
      clause.  Remove unused variable.
      (watch_end, watch_completion): Provide prototypes.
      * src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
      * src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
      warning with pointer signedness.
      * src/gnutls.c (gnutls_x509_crt_get_signature)
      (gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
      don't load them from the GnuTLS library, as they are no longer
      used.
      * src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
      define, as it's unused.
      * src/unexw32.c (open_input_file, open_output_file)
      (close_file_data): Remove redundant prototypes.
      (_start): provide prototype.
      (mainCRTStartup): Move prototype to file level.
      (find_section): Use type-cast to shut up compiler warnings.
      (offset_to_section, relocate_offset): Now static.
      (find_section): First argument is now a 'const char *'.
      (offset_to_section): Ifdef away, as it's unused.
      * src/w32heap.h (find_section): Adjust prototype.
      * src/dynlib.c (dynlib_reset_last_error): Provide prototype.
      * src/dired.c (directory_files_internal_w32_unwind): Avoid
      warnings about missing prototypes.
      (is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
      (directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
      signedness.
      * src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
      Fix warnings about pointer signedness.
      * src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
      unused.
      * src/sysdep.c (_getpid): Remove redundant prototype.
      (sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
      [!MSDOS]: Don't define 'st', it's unused.
      (init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
      (str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
      * src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
      n_to_read, as it is not used.
      (MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
      * src/w32font.h (syms_of_w32font): Remove redundant prototype.
      * src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
      * src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
      not used by DOS_NT builds, to avoid compiler warnings.
      * src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
      declaration.
      * src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
      up compiler warnings.
      * src/w32term.h (x_set_window_size, x_get_focus_frame)
      (x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
      (x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
      (x_free_frame_resources, x_real_positions)
      (display_x_get_resource): Remove redundant prototypes.
      
      * lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
      (sys_rename, gettimeofday): Provide prototypes.
      * lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
      declarations.
      * lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
      (xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
      (close_winsock, initialize_sockets, w32_set_user_model_id)
      (w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
      prototypes.
      (w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
      difference.
      (w32_set_user_model_id): Update prototype of
      SetCurrentProcessExplicitAppUserModelID to avoid compiler
      warnings.
      (start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
      shut up compiler warnings.
      * lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
      cb5af792
  13. 24 Mar, 2016 1 commit
    • Eli Zaretskii's avatar
      Improve font selection by family on MS-Windows · 7eba90c1
      Eli Zaretskii authored
      * src/w32font.c (w32font_list_internal): Allow 'ascii-0' charset,
      in addition to 'iso10646-1', 'unicode-bmp', and 'unicode-sip'.
      This avoids rejecting many font families whose members are shown
      by 'font-family-list', in particular 'courier' requested by
      info.el.  Without this change, many values of ':family' attribute
      of a face have no effect on MS-Windows, because they are rejected
      due to bogus mismatch of the charset.
      7eba90c1
  14. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  15. 01 Jan, 2016 1 commit
  16. 22 Oct, 2015 1 commit
    • Eli Zaretskii's avatar
      Include file cleanup for w32 files in src directory · d4352f81
      Eli Zaretskii authored
      * src/w32xfns.c: Don't include keyboard.h, window.h, charset.h,
      fontset.h, blockinput.h.
      * src/w32uniscribe.c: Don't include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/w32term.c: Don't include systty.h, systime.h, charset.h,
      character.h, ccl.h, dispextern.h, disptab.h, intervals.h,
      process.h, atimer.h, keymap.h, w32heap.h.  Include bitmap/gray.xbm
      in an ifdef-ed away block.
      Include fcntl.h for CYGWIN.
      (set_frame_param): Remove unused function.
      * src/w32select.c: Don't include charset.h and composite.h.
      (setup_config, Fw32_get_clipboard_data): Avoid compiler warnings
      due to pointer signedness mismatches.
      * src/w32reg.c (w32_get_string_resource): Avoid compiler warnings
      due to pointer signedness mismatches.
      * src/w32proc.c: Include unistd.h.  Don't include systime.h,
      process.h, dispextern.h.
      (sys_spawnve, Fw32_short_file_name, Fw32_long_file_name)
      (Fw32_application_type): Avoid compiler warnings due to pointer
      signedness mismatches.
      * src/w32menu.c: Don't include keymap.h, termhooks.h, window.h,
      character.h, charset.h, dispextern.h.
      (simple_dialog_show, add_menu_item): Avoid compiler warnings due
      to pointer signedness mismatches.
      * src/w32inevt.c: Don't include dispextern.h, window.h,
      termhooks.h, w32heap.h.
      * src/w32font.c: Don't include dispextern.h, character.h,
      charset.h, fontset.h, font.h.
      (intern_font_name, add_font_entity_to_list)
      (registry_to_w32_charset, w32_to_x_charset, fill_in_logfont)
      (list_all_matching_fonts): Avoid compiler warnings due to pointer
      signedness mismatches.
      * src/w32fns.c: Don't include character.h, intervals.h,
      dispextern.h, epaths.h, charset.h, ccl.h, fontset.h, systime.h,
      termhooks.h, w32heap.h, bitmap/gray.xbm, font.h, w32font.h.
      (w32_color_map_lookup, add_system_logical_colors_to_map)
      (x_decode_color, x_set_name, FPRINTF_WM_CHARS, Fxw_color_defined_p)
      (Fxw_color_values, x_display_info_for_name, Fset_message_beep)
      (x_create_tip_frame, Fx_file_dialog, Fsystem_move_file_to_trash)
      (w32_parse_hot_key, Ffile_system_info, w32_kbd_patch_key): Avoid
      compiler warnings, mainly due to pointer signedness mismatches.
      (unwind_create_frame_1): Remove unused function.
      * src/w32console.c: Don't include character.h, disptab.h, frame.h,
      window.h, termhooks.h, dispextern.h.
      (w32con_write_glyphs, w32con_write_glyphs_with_face): Fix pointer
      signedness mismatch.
      * src/w32.c: Include c-strcase.h and systty.h.  Don't include
      w32heap.h.
      d4352f81
  17. 28 May, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix display of glyphless characters with problematic fonts · c76605fa
      Eli Zaretskii authored
      * src/w32term.c (x_draw_glyph_string_background): Force redraw of
      glyph string background also when the font in use claims
      preposterously large global height value.  Helps to remove
      artifacts left from previous displays when glyphless characters
      are displayed as hex code in a box.
      * src/xterm.c (x_draw_glyph_string_background): Force redraw of
      glyph string background also when the font in use claims
      preposterously large global height value.  Helps to remove
      artifacts left from previous displays when glyphless characters
      are displayed as hex code in a box.
      * src/w32font.c (w32font_draw): Fix background drawing for
      glyphless characters that display as acronyms or hex codes in a
      box.
      * src/xftfont.c (xftfont_draw): Fix background drawing for
      glyphless characters that display as acronyms or hex codes in a
      box.
      * src/xdisp.c (produce_glyphless_glyph): Compute reasonable values
      for it->ascent and it->descent when the font claims preposterously
      large global values.
      (FONT_TOO_HIGH): Move from here...
      * src/dispextern.h (FONT_TOO_HIGH): ...to here.
      c76605fa
  18. 26 May, 2015 1 commit
    • Eli Zaretskii's avatar
      Teach MS-Windows font back-end return per-glyph ascent/descent · 53bedd3a
      Eli Zaretskii authored
      * src/w32font.h (struct w32_metric_cache): Add ascent and descent
      values.
      
      * src/w32font.c (w32font_text_extents): Compute, cache, and
      accumulate per-glyph ascent and descent values, instead of copying
      global values from the font.  If the values are not available from
      the font data, i.e., non-TTF fonts, fall back on font-global values.
      (compute_metrics): Compute and return per-glyph ascent and descent
      values, if returned by GetGlyphOutlineW, falling back on
      font-global values.  (Bug#20628)
      
      * src/w32term.c (w32_draw_rectangle): Add 1 pixel to width and
      height of rectangle to be drawn, to be compatible with
      XDrawRectangle.  Fixes glyphless-char display as hex codes in a
      box, when per-glyph ascent/descent values are used.
      53bedd3a
  19. 12 Mar, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix support of scripts in w32font.c (Bug#19993) · fc10058a
      Eli Zaretskii authored
       src/w32font.c (font_supported_scripts): Add subranges for Latin
       Supplement, Latin Extended-A/B, Vai, Supplemental Punctuation, Tai
       Le, Buginese, Yijing Hexagrams, Ancient Greek Numbers, Tai Xuan
       Jing, Counting Rods, Sundanese, Lepcha, Ol Chiki, Saurashtra,
       Kayah Li, Rejang, Ancient Symbols, Phistos Disc, Carian, Lycian,
       Lydian, Dominoe Tiles, and Mahjong Tiles.  Break the Mathematical
       Alphanumeric Symbols into several "scripts" like fontset.el does.
       (syms_of_w32font): DEFSYM all the new script symbols.
      
       lisp/international/fontset.el (script-representative-chars): Add a
       representative character for 'vai'.
      fc10058a
  20. 21 Feb, 2015 1 commit
  21. 29 Jan, 2015 1 commit
    • Eli Zaretskii's avatar
      Use bool for boolean in w32menu.c, w32font.c, w32uniscribe.c. · 0761ec16
      Eli Zaretskii authored
       src/w32uniscribe.c (uniscribe_list, uniscribe_match): Use bool where
       appropriate.
       src/w32font.c (struct font_callback_data, w32font_list_internal)
       (w32font_driver, w32font_match_internal): Use bool where appropriate.
       src/w32menu.c (x_activate_menubar, set_frame_menubar)
       (w32_dialog_show, initialize_frame_menubar, w32_menu_show)
       (is_simple_dialog): Use bool where appropriate.
      0761ec16
  22. 05 Jan, 2015 2 commits
    • Eli Zaretskii's avatar
      MS-Windows followup to previous commit · 5b5dab12
      Eli Zaretskii authored
       src/w32proc.c, src/w32.h, src/w32fns.c, src/w32font.c, src/w32menu.c:
       src/w32notify.c, src/w32proc.c, src/w32select.c, src/w32term.c:
       src/w32uniscribe.c: Remove declarations of Q* variables that
       represent symbols.
      5b5dab12
    • Paul Eggert's avatar
      Compute C decls for DEFSYMs automatically · 58f2d6ef
      Paul Eggert authored
      Fixes Bug#15880.
      This patch also makes Q constants (e.g., Qnil) constant addresses
      from the C point of view.
      * make-docfile.c: Revamp to generate table of symbols, too.
      Include <stdbool.h>.
      (xstrdup): New function.
      (main): Don't process the same file twice.
      (SYMBOL): New constant in enum global_type.
      (struct symbol): Turn 'value' member into a union, either v.value
      for int or v.svalue for string.  All uses changed.
      (add_global): New arg svalue, which overrides value, so that globals
      can have a string value.
      (close_emacs_global): New arg num_symbols; all uses changed.
      Output lispsym decl.
      (write_globals): Output symbol globals too.  Output more
      ATTRIBUTE_CONST, now that Qnil etc. are C constants.
      Output defsym_name table.
      (scan_c_file): Move most of guts into ...
      (scan_c_stream): ... new function.  Scan for DEFSYMs and
      record symbols found.  Don't read past EOF if file doesn't
      end in newline.
      * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle:
      * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c:
      * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c:
      * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c:
      * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c:
      * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m:
      * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c:
      * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c:
      * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c:
      * xselect.c, xsettings.c, xterm.c:
      Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs).
      These names are now defined automatically by make-docfile.
      * alloc.c (init_symbol): New function.
      (Fmake_symbol): Use it.
      (c_symbol_p): New function.
      (valid_lisp_object_p, purecopy): Use it.
      * alloc.c (marked_pinned_symbols):
      Use make_lisp_symbol instead of make_lisp_ptr.
      (garbage_collect_1): Mark lispsym symbols.
      (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro.
      (mark_object): Use it.
      (sweep_symbols): Sweep lispsym symbols.
      (symbol_uses_obj): New function.
      (which_symbols): Use it.  Work for lispsym symbols, too.
      (init_alloc_once): Initialize Vpurify_flag here; no need to wait,
      since Qt's address is already known now.
      (syms_of_alloc): Add lispsym count to symbols_consed.
      * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0),
      when testing whether storage is all bits zero.
      * dispextern (struct image_type):
      * font.c (font_property_table):
      * frame.c (struct frame_parm_table, frame_parms):
      * keyboard.c (scroll_bar_parts, struct event_head):
      * xdisp.c (struct props):
      Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and
      Lisp_Object *, since Qfoo is no longer an object whose address can be
      taken.  All uses changed.
      * eval.c (run_hook): New function.  Most uses of Frun_hooks changed to
      use it, so that they no longer need to take the address of a Lisp sym.
      (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable.
      * frame.c (syms_of_frame): Add defsyms for the frame_parms table.
      * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here.
      DEFSYM Qdeactivate_mark before the corresponding var.
      * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line
      instead of interning their symbols; this avoids duplicates.
      (LISP_INITIALLY, TAG_PTR)
      (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT):
      New macros.
      (LISP_INITIALLY_ZERO): Use it.
      (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol)
      (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*):
      Move decls up, to avoid forward uses.  Include globals.h earlier, too.
      (make_lisp_symbol): New function.
      (XSETSYMBOL): Use it.
      (DEFSYM): Now just a placeholder for make-docfile.
      * lread.c (DEFINE_SYMBOLS): Define, for globals.h.
      (intern_sym): New function, with body taken from old intern_driver.
      (intern_driver): Use it.  Last arg is now Lisp integer, not ptrdiff_t.
      All uses changed.
      (define_symbol): New function.
      (init_obarray): Define the C symbols taken from lispsym.
      Use plain DEFSYM for Qt and Qnil.
      * syntax.c (init_syntax_once): No need to worry about
      Qchar_table_extra_slots.
      58f2d6ef
  23. 01 Jan, 2015 2 commits
  24. 25 Sep, 2014 1 commit
    • Eli Zaretskii's avatar
      Default to stack objects on DOS_NT platforms as well. · db61bdb1
      Eli Zaretskii authored
       src/w32term.h (ALIGN_STACK) [__GNUC__]: Define to
       __attribute__((force_align_arg_pointer)) for GCC 4.2 and later.
       src/lisp.h (USE_STACK_LISP_OBJECTS): Remove the !DOS_NT condition.
       src/w32proc.c (enum_locale_fn, enum_codepage_fn): Add the
       ALIGN_STACK attribute.
       src/w32fns.c (w32_monitor_enum): Add the ALIGN_STACK attribute.
       src/w32uniscribe.c (add_opentype_font_name_to_list): Add the
       ALIGN_STACK attribute.
       src/w32font.c (add_font_name_to_list, add_font_entity_to_list)
       (add_one_font_entity_to_list): Add the ALIGN_STACK attribute.
      db61bdb1
  25. 22 Sep, 2014 1 commit
  26. 16 Sep, 2014 1 commit
  27. 25 Aug, 2014 1 commit
    • Dmitry Antipov's avatar
      One more minor cleanup of font subsystem. · 8661ebaa
      Dmitry Antipov authored
      * font.h (struct font_driver): Convert text_extents to
      return void because returned value is never actually used.
      * macfont.c (macfont_text_extents):
      * w32font.c (w32font_text_extents):
      * xftfont.c (xftfont_text_extents): Adjust to return void
      and assume that 'metrics' argument is always non-NULL.
      * ftfont.c (ftfont_text_extents):
      * xfont.c (xfont_text_extents): Likewise.  Avoid redundant memset.
      8661ebaa
  28. 09 Jul, 2014 1 commit
    • Dmitry Antipov's avatar
      Next minor cleanup of font subsystem. · 876d043f
      Dmitry Antipov authored
      * font.h (enum font_property_index): Remove FONT_ENTITY_INDEX (no
      users) and FONT_FORMAT_INDEX (set by a few font drivers but never
      really used).
      (FONT_ENTITY_NOT_LOADABLE, FONT_ENTITY_SET_NOT_LOADABLE): Remove;
      unused.
      * ftfont.h (ftfont_font_format): Remove prototype.
      * ftfont.c (ftfont_font_format): Remove; now unused.
      (ftfont_open):
      * nsfont.m (nsfont_open):
      * w32font.c (w32font_open_internal):
      * w32uniscribe.c (uniscribe_open):
      * xfont.c (xfont_open):
      * xftfont.c (xftfont_open): All users changed.
      876d043f
  29. 04 Jul, 2014 1 commit
    • Dmitry Antipov's avatar
      * font.h (struct font_driver): Remove get_outline and free_outline; · 9d7b0167
      Dmitry Antipov authored
      not used by any font driver.
      * ftfont.c (ftfont_driver):
      * macfont.m (macfont_driver):
      * nsfont.m (nsfont_driver):
      * w32font.c (w32font_driver):
      * w32uniscribe.c (uniscribe_font_driver):
      * xfont.c (xfont_driver): Related users changed.
      * xselect.c (x_get_window_property): Use convenient xmalloc.
      Call to xfree only if some data was really allocated.
      9d7b0167
  30. 19 Jan, 2014 1 commit
    • Eli Zaretskii's avatar
      Fix Cygwin w32 build broken by last commit in w32font.c. · 21f95411
      Eli Zaretskii authored
       src/w32font.c (w32_load_unicows_or_gdi32, get_outline_metrics_w)
       (get_text_metrics_w, get_glyph_outline_w, get_char_width_32_w)
       [!WINDOWSNT]: These functions are no longer compiled on Cygwin;
       they are replaced by macros that expand into direct calls to the
       corresponding functions from GDI32.DLL.
       (globals_of_w32font) [WINDOWSNT]: Don't initialize g_b_* static
       variables in the Cygwin build, they are unused.
      21f95411
  31. 18 Jan, 2014 1 commit
    • Eli Zaretskii's avatar
      Fix file name handling on MS-Windows 9X. · 5197f0c2
      Eli Zaretskii authored
       src/w32.c (maybe_load_unicows_dll): New function.
       src/emacs.c (main) [WINDOWSNT]: Call maybe_load_unicows_dll early
       on, to make sure we can convert file names to and from UTF-8 on
       Windows 9X.  This fixes a failure to start up because Emacs cannot
       find term/w32-win.el.  Reported by oslsachem <oslsachem@gmail.com>.
       src/w32font.c [WINDOWSNT]: Include w32.h.
       (w32_load_unicows_or_gdi32): Call maybe_load_unicows_dll, instead
       of implementing the same stuff.
       Remove now unused g_b_init_is_windows_9x.
       src/w32.h (maybe_load_unicows_dll): Add prototype.
      
       nt/runemacs.c (ensure_unicows_dll): Don't tell in the message box
       that "emacs -nw" can do without UNICOWS.DLL on Windows 9X.  See
       w32.c:maybe_load_unicows_dll and its callers for the reason.
      5197f0c2
  32. 01 Jan, 2014 1 commit
  33. 17 Dec, 2013 1 commit
    • Eli Zaretskii's avatar
      Fix some warnings in w32 specific code. · af025ae8
      Eli Zaretskii authored
       src/w32term.c (w32_initialize): Declare the argument of
       set_user_model as const.
       src/w32menu.c <MessageBoxW_Proc>: Fix argument declarations.
       (w32_menu_show): Constify some arguments passed to MessageBox.
       src/w32uniscribe.c (uniscribe_font_driver): Use LISP_INITIALLY_ZERO
       to initialize Lisp objects.
       src/w32font.c (w32font_driver): Use LISP_INITIALLY_ZERO to
       initialize Lisp objects.
       src/frame.c (x_set_frame_parameters) [HAVE_X_WINDOWS]: Declare and
       use variables used only on X under that condition.
       src/fileio.c (Fcopy_file) [!WINDOWSNT]: Don't declare on Windows
       variables not used there.
      af025ae8
  34. 13 Dec, 2013 1 commit
  35. 12 Dec, 2013 1 commit
    • Dmitry Antipov's avatar
      * font.h (struct font_entity) [HAVE_NS]: New field to record · cf86e18b
      Dmitry Antipov authored
      font driver which was used to create this entity.
      (struct font) [HAVE_WINDOW_SYSTEM]: New field to record
      frame where the font was opened.
      (font_close_object): Add prototype.
      * font.c (font_make_entity) [HAVE_NS]: Zero out driver field.
      (font_close_object): Not static any more.  Lost frame arg.
      Adjust comment and users.
      * alloc.c (cleanup_vector): Call font_close_object to adjust
      per-frame font counters correctly.  If HAVE_NS, also call
      driver-specific cleanup for font-entity objects.
      * ftfont.c (ftfont_open):
      * nsfont.m (nsfont_open):
      * w32font.c (w32font_open_internal):
      * xfont.c (xfont_open):
      * xftfont.c (xftfont_open): Save frame pointer in font object.
      * macfont.m (macfont_open): Likewise.
      (macfont_descriptor_entity): Save driver pointer to be able
      to call its free_entity routine when font-entity is swept.
      * ftxfont.c (ftxfont_open): Add eassert because frame
      pointer should be saved by ftfont_driver.open.
      cf86e18b
  36. 04 Dec, 2013 1 commit
  37. 29 Nov, 2013 1 commit
    • Tom Seddon's avatar
      Fix bug #6364 with slow scrolling on MS-Windows with bitmap fonts. · 579ca67b
      Tom Seddon authored
       src/w32font.c (g_b_init_get_char_width_32_w): New static var.
       (globals_of_w32font): Zero it out.
       (GetCharWidth32W_Proc): New function pointer.
       (get_char_width_32_w): New function.
       (compute_metrics): If get_glyph_outline_w returns an error, try
       get_char_width_32_w before declaring a failure.  This avoids
       punishing raster (a.k.a. "bitmap") fonts by slowing down
       redisplay.
      579ca67b
  38. 25 Oct, 2013 1 commit