1. 25 Apr, 2020 1 commit
    • Eli Zaretskii's avatar
      Fix two fringe bitmaps · 9dd4ff6e
      Eli Zaretskii authored
      * src/fringe.c (question_mark_bits, exclamation_mark_bits): Fix
      the numerical values.  (Bug#40805)
      9dd4ff6e
  2. 27 Mar, 2020 1 commit
    • Paul Eggert's avatar
      Treat out-of-range positions consistently · de00a933
      Paul Eggert authored
      If a position argument to get-byte etc. is an out-of-range integer,
      treat it the same regardless of whether it is a fixnum or a bignum.
      * src/buffer.c (fix_position): New function.
      * src/buffer.c (validate_region):
      * src/character.c (Fget_byte):
      * src/coding.c (Ffind_coding_systems_region_internal)
      (Fcheck_coding_systems_region):
      * src/composite.c (Ffind_composition_internal):
      * src/editfns.c (Fposition_bytes, Fchar_after, Fchar_before)
      (Finsert_buffer_substring, Fcompare_buffer_substrings)
      (Fnarrow_to_region):
      * src/fns.c (Fsecure_hash_algorithms):
      * src/font.c (Finternal_char_font, Ffont_at):
      * src/fringe.c (Ffringe_bitmaps_at_pos):
      * src/search.c (search_command):
      * src/textprop.c (get_char_property_and_overlay):
      * src/window.c (Fpos_visible_in_window_p):
      * src/xdisp.c (Fwindow_text_pixel_size):
      Use it instead of CHECK_FIXNUM_COERCE_MARKER, so that
      the code is simpler and treats bignums consistently with fixnums.
      * src/buffer.h (CHECK_FIXNUM_COERCE_MARKER): Define here
      rather than in lisp.h, and reimplement in terms of fix_position
      so that it treats bignums consistently with fixnums.
      * src/lisp.h (CHECK_FIXNUM_COERCE_MARKER): Move to buffer.h.
      * src/textprop.c (validate_interval_range): Signal with original
      bounds rather than modified ones.
      de00a933
  3. 26 Feb, 2020 1 commit
  4. 01 Jan, 2020 1 commit
  5. 04 Nov, 2019 1 commit
  6. 26 Oct, 2019 1 commit
  7. 01 Oct, 2019 1 commit
  8. 31 Aug, 2019 1 commit
    • Juri Linkov's avatar
      Frame-local tab-bar and window-local tab-line. · 3e0ad29a
      Juri Linkov authored
      * etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
      
      * etc/TODO: Remove tab-related items.
      
      * lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
      
      * lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
      
      * lisp/loadup.el: Load "tab-bar".
      
      * lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
      (menu-bar-showhide-menu): Define showhide-tab-bar.
      
      * lisp/startup.el (tab-bar-images-pixel-height): New defconst.
      (command-line): Reset tab-bar-mode.
      (x-apply-session-resources): Add "tabBar", "TabBar".
      
      * lisp/subr.el (read-key): Add tab-bar.
      
      * lisp/tab-bar.el: New file.
      * lisp/tab-line.el: New file.
      
      * lisp/window.el (window--dump-frame): Add tab-bar-height.
      
      * src/dispextern.h (enum window_part): Add ON_TAB_LINE.
      (struct glyph_matrix): Add tab_line_p.
      (struct glyph_row): Add tab_line_p.
      (MATRIX_TAB_LINE_ROW): New macro.
      (MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
      (MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
      (MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
      (DESIRED_TAB_LINE_HEIGHT): New macros.
      (enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
      (struct it): Add tab_line_p.
      (tab_bar_item_idx, tab_bar_item_image): New enums.
      (DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
      (DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
      New constants.
      
      * src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
      (shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
      (clear_current_matrices, clear_desired_matrices):
      Call clear_glyph_matrix on tab_bar_window.
      (blank_row): Add WINDOW_TAB_LINE_HEIGHT.
      (required_matrix_height): Change 2 to 3.
      (fake_current_matrices): Reset tab_line_p.
      (adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
      Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
      (free_glyphs): Handle tab_bar_window.
      (update_frame): Handle tab_bar_window.
      (update_window): Handle row->tab_line_p.
      (scrolling_window): Change arg type from bool to int.
      Change header_line_p to tab_line_p.
      (buffer_posn_from_coords): Add window_wants_tab_line.
      (mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
      
      * src/frame.c (frame_default_tab_bar_height): New internal variable.
      (adjust_frame_size): Handle tab_bar_window.
      (make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
      last_tab_bar_item.
      (Ftab_bar_pixel_width): New function.
      (frame_parms): Add tab-bar-lines.
      (gui_figure_window_size): Add new arg tabbar_p.
      (syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
      Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
      Add Qtab_bar_lines to frame_inhibit_implied_resize.
      (tab-bar-mode): New variable.
      
      * src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
      desired_tab_bar_string, current_tab_bar_string.
      (GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
      minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
      tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
      (fset_tab_bar_items, fset_tab_bar_window)
      (fset_current_tab_bar_string, fset_desired_tab_bar_string):
      New inlines.
      (FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
      (FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
      Use FRAME_TAB_BAR_LINES.
      
      * src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
      Add WINDOW_TAB_LINE_HEIGHT.
      
      * src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
      (x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
      
      * src/keyboard.c (read_char): Handle Qtab_bar.
      (kbd_buffer_get_event): Handle TAB_BAR_EVENT.
      (make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
      Handle TAB_BAR_EVENT.
      (tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
      New internal variables.
      (tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
      (parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
      New functions.
      (read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
      (tab-bar-separator-image-expression): New variable.
      
      * src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
      
      * src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
      
      * src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
      (GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
      
      * src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
      
      * src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
      
      * src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
      (Fwindow_tab_line_height): New function.
      (coordinates_in_window): Use window_wants_tab_line with
      CURRENT_TAB_LINE_HEIGHT.
      (window_relative_x_coord): Add ON_TAB_LINE.
      (Fcoordinates_in_window_p): Add ON_TAB_LINE.
      (window_from_coordinates): Add new arg tab_bar_p.
      (Fwindow_line_height): Use window_wants_tab_line with
      WINDOW_TAB_LINE_HEIGHT.
      (Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
      (make_window): Set tab_line_height to -1.
      (window_wants_tab_line): New function.
      (window_internal_height): Use window_wants_tab_line.
      (window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
      (Frecenter): Set minimize_tab_bar_window_p to 1.
      (GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
      (Fcurrent_window_configuration): Set frame_tab_bar_lines and
      frame_tab_bar_height.
      (set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
      (syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
      
      * src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
      (WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
      New macros.
      (WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
      Add WINDOW_TAB_BAR_P.
      
      * src/xdisp.c (window_box_height): Add window_wants_tab_line with
      MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
      (pos_visible_p): Use window_wants_tab_line.
      Add WINDOW_TAB_LINE_HEIGHT.
      (get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
      (get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
      (remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
      ON_TAB_LINE.
      (init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
      Add WINDOW_TAB_LINE_HEIGHT.  Add window_wants_tab_line.
      (Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
      (prepare_menu_bars): Call update_tab_bar.
      (update_tab_bar, build_desired_tab_bar_string)
      (display_tab_bar_line, tab_bar_height, Ftab_bar_height)
      (redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
      (handle_tab_bar_click, note_tab_bar_highlight): New functions.
      (compute_window_start_on_continuation_line): Use window_wants_tab_line.
      (try_cursor_movement): Use window_wants_tab_line with
      CURRENT_TAB_LINE_HEIGHT.
      (redisplay_window): Use window_wants_tab_line with
      CURRENT_TAB_LINE_HEIGHT.
      (try_window_reusing_current_matrix): Use window_wants_tab_line
      with WINDOW_TAB_LINE_HEIGHT.
      (Fdump_tab_bar_row): New function.
      (compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
      (display_line): Use window_wants_tab_line.
      (display_mode_line): Set tab_line_p to true if face_id is
      TAB_LINE_FACE_ID.
      (Fformat_mode_line): Handle Qtab_line and Qtab_bar.
      (gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
      (erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
      (show_mouse_face): Use tab_bar_window.
      (note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
      area ON_TAB_LINE.
      (note_mouse_highlight): Call note_tab_bar_highlight,
      (expose_frame): Handle tab_bar_window.
      (syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
      (auto-resize-tab-bars, auto-raise-tab-bar-buttons)
      (tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
      (tab-bar-max-label-size): New variables.
      
      * src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
      TAB_BAR_FACE_ID.
      (syms_of_xfaces): Define Qtab_bar and Qtab_line.
      
      * src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
      New functions.
      (xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
      (frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
      
      * src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
      (x_draw_image_relief): Use TAB_BAR_FACE_ID.
      (handle_one_xevent): Handle tab_bar_window.
      (x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
      (x_create_terminal): Set change_tab_bar_height_hook.
      
      * src/xterm.h (struct x_output): Add tabbar_top_height,
      tabbar_bottom_height, tabbar_left_width, tabbar_right_width
      tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
      (FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
      FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
      FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
      FRAME_TABBAR_WIDTH.
      3e0ad29a
  9. 13 Aug, 2019 1 commit
    • Eli Zaretskii's avatar
      Fix initialization of user-defined fringe bitmaps in daemon mode · c90975f9
      Eli Zaretskii authored
      * src/fringe.c (gui_init_fringe): Rename from w32_init_fringe
      or x_cr_init_fringe, and make unconditionally compiled; all
      callers changed.  Do nothing if the frame's
      redisplay_interface doesn't implement the define_fringe_bitmap
      method.  Set up any user-defined fringe bitmaps in addition to
      the standard bitmaps.
      Suggested by Liam Quinlan <liamkquinlan@gmail.com> in
      https://lists.gnu.org/archive/html/emacs-devel/2019-08/msg00259.html.
      
      (w32_reset_fringes) [HAVE_NTGUI]: Do nothing if the frame's
      redisplay_interface doesn't implement the
      destroy_fringe_bitmap method.
      
      * src/w32fns.c (Fx_create_frame): Call gui_init_fringe when
      the first GUI frame is created for this session.
      * src/dispextern.h (w32_init_fringe): Rename to
      gui_init_fringe and make unconditional.
      (x_cr_init_fringe): Remove prototype.
      c90975f9
  10. 09 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Avoid some unnecessary stdio.h includes · cebea291
      Paul Eggert authored
      * src/atimer.c, src/callproc.c, src/coding.c, src/dired.c, src/eval.c:
      * src/fringe.c, src/ftcrfont.c, src/ftfont.c, src/ftxfont.c:
      * src/gfilenotify.c, src/indent.c, src/kqueue.c, src/menu.c:
      * src/scroll.c, src/terminal.c, src/unexcoff.c, src/window.c:
      * src/xfont.c, src/xftfont.c:
      Do not include stdio.h since it is unused.
      cebea291
  11. 15 Jan, 2019 1 commit
    • Daniel Colascione's avatar
      Add portable dumper · d12e5d00
      Daniel Colascione authored
      Add a new portable dumper as an alternative to unexec.  Use it by default.
      
      * src/dmpstruct.awk: New file.
      * src/doc.c (get_doc_string): use will_dump_p().
      * src/editfns.c (styled_format): silence compiler warning
      with UNINIT.
      * src/emacs-module.c (syms_of_module): staticpro ltv_mark.
      * src/emacs.c (gflags): new variable.
      (init_cmdargs): unwrap
      (string_starts_with_p, find_argument, dump_error_to_string)
      (load_pdump): new functions.
      (main): detect pdumper and --temacs invocation; actually load
      portable dump when detected; set gflags as appropriate; changes to
      init functions throughout to avoid passing explicit
      'initialized' argument.
      * src/eval.c (inhibit_lisp_code): remove unused variable.
      (init_eval_once_for_pdumper): new function.
      (init_eval_once): call it.
      * src/filelock.c: CANNOT_DUMP -> will_dump_p()
      * src/fingerprint-dummy.c: new file
      * src/fingerprint.h: new file
      * src/fns.c: CANNOT_DUMP -> will_dump_p(), etc.
      (weak_hash_tables): remove
      (hashfn_equal, hashfn_eql): un-staticify
      (make_hash_table): set new 'next_weak' hash table field; drop
      global weak_hash_tables logic.
      (copy_hash_table): drop global weak_hash_tables logic.
      (hash_table_rehash): new function.
      (hash_lookup, hash_put, hash_remove_from_table, hash_clear):
      rehash if needed.
      (sweep_weak_table): un-staticify; explain logic; bool-ify.
      (sweep_weak_hash_tables): remove function.
      * src/font.c (syms_of_font): remember pdumper stuff.
      * src/fontset.c (syms_of_fontset): remember pdumper stuff.
      * src/frame.c (make_initial_frame): don't reset Vframe_list.
      (init_frame_once_for_pdumper, init_frame_once): new functions.
      (syms_of_frame): remove redundant staticpro.
      * src/fringe.c (init_fringe_once_for_pdumper): new functin.
      (init_fringe_once): call it.
      * src/ftcrfont.c (syms_of_ftcrfont_for_pdumper): new function.
      (syms_of_ftcrfont): call it.
      * src/ftfont.c (syms_of_ftfont_for_pdumper): new function.
      (syms_of_ftfont): call it.
      * src/ftxont.c (syms_of_ftxfont_for_pdumper): new function.
      (syms_of_ftxfont): call it.
      * src/gmalloc.c: adjust for pdumper througout
      (DUMPED): remove weird custom dumped indicator.
      * src/gnutls.c (syms_of_gnutls): pdumper note for
      gnutls_global_initialized.
      * src/image.c (syms_of_image): add pdumper comment,
      initializer note.
      * src/insdel.c (prepare_to_modify_buffer_1): account
      for buffer contents possibly being in dump image.
      * src/keyboard.c (syms_of_keyboard_for_pdumper): new function.
      (syms_of_keyboard): staticpro more; call pdumper syms function.
      * src/lisp.h: add comments throughout
      (gflags): declare.
      (will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p)
      (dumped_with_pdumper_p, will_dump_with_unexec_p)
      (dumped_with_unexec_p, definitely_will_not_unexec_p): new
      functions.
      (POWER_OF_2, ROUNDUP): move macros.
      (PSEUDOVECTOR_TYPE, PSEUDOVECTOR_TYPEP): take vectorlike header
      pointer instead of vector; constify.
      (Lisp_Hash_Table): add comment about need to rehash on access; add
      comment for next_weak.
      (HASH_KEY, HASH_VALUE, HASH_HASH, HASH_TABLE_SIZE): const-ify.
      (hash_table_rehash): declare.
      (hash_rehash_needed_p, hash_rehash_if_needed): new functions.
      (finalizers, doomed_finalizers): declare extern.
      (SUBR_SECTION_ATTRIBUTE): new macro.
      (staticvec, staticidx): un-static-ify.
      (sweep_weak_hash_tables): remove declaration.
      (sweep_weak_table): declare.
      (hashfn_eql, hashfn_equal): declare.
      (number_finalizers_run): new variable.
      (Vdead): externify when ENABLE_CHECKING.
      (gc_root_type): new enumeration.
      (gc_root_visitor): new struct.
      (visit_static_gc_roots): declare.
      (vectorlike_nbytes): declare.
      (vector_nbytes): define as trivial inline function wrapper for
      vectorlike_nbytes.
      (init_obarray_once): change signature.
      (primary_thread): extern-ify.
      (init_buffer): change signature.
      (init_frame_once): declare.
      * src/lread.c (readevalloop): adjust for new dumped predicates.
      (init_obarray_once): new function.
      (ndefsubr): new variable.
      (defsubr): increment it.
      (load_path_check): adjust for pdumper.
      (load_path_default): use pdumper functions; adjust for
      dump search.
      * src/macfont.m (macfont_init_font_change_handler): avoid
      shadowing global.
      (syms_of_macfont_for_pdumper): new function.
      (syms_of_macfont): call it.
      * src/menu.c (syms_of_menu): staticpro more stuff.
      * src/minibuf.c (Ftry_completion): rehash if needed.
      (init_minibuf_once_for_pdumper): new function.
      (init_minibuf_once): call it.
      * src/nsfont.m (syms_of_nsfns): staticpro more.
      * src/nsfont.m (syms_of_nsfont_for_pdumper): new function.
      (syms_of_nsfont): call it.
      * src/nsterm.m (syms_of_nsfont): remember pdumper stuff.
      * src/pdumper.c: new file.
      * src/pdumper.h: new file.
      * src/process.c (init_process_emacs): use new pdumper functions
      instead of CANNOT_DUMP.
      * src/profiler.c (syms_of_profiler_for_pdumper): new function.
      (syms_of_profiler_for_pdumper): call it.
      * src/search.c (syms_of_search_for_pdumper): new function.
      (syms_of_search_for_pdumper): call it.
      * src/sheap.c (bss_sbrk_did_unexec): remove.
      * src/sheap.h (bss_sbrk_did_unexec): remove.
      * src/syntax.c (syms_of_syntax): don't redundantly staticpro
      re_match_object.
      * src/sysdep.c: use will_dump_with_unexec_p() instead of bss
      hack thing.
      * src/syssignals.h (init_sigsegv): declare.
      * src/systime.h (init_timefns): remove bool from signature.
      * src/textprop.c (syms_of_textprop): move staticpro.
      * src/thread.c (main_thread_p): constify.
      * src/thread.h (main_thread_p): constify.
      * src/timefns.c (init_timefns): remove bool from signature.
      (syms_of_timefns_for_pdumper): new function.
      (syms_of_timefns): call it.
      * src/w32.c: rearrange code.
      * src/w32.h (w32_relocate): declare.
      * src/w32fns.c (syms_of_w32fns): add pdumper note.
      * src/w32font.c (syms_of_w32font_for_pdumper): new function.
      (syms_of_w32font): call it.
      * src/w32heap.c (using_dynamic_heap): new variable.
      (init_heap): use it.
      * src/w32menu.c (syms_of_w32menu): add pdumper note.
      * src/w32proc.c
      (ctrl_c_handler, mainCRTStartup, _start, open_input_file)
      (rva_to_section, close_file_data): move here.
      * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper):
      new function.
      (syms_of_w32uniscribe): call it.
      * src/window.c (init_window_once_for_pdumper): new function.
      (init_window_once): call it; staticpro more stuff.
      * src/xfont.c (syms_of_xfont_for_pdumper): new function.
      (syms_of_xfont): call it.
      * src/xftfont.c (syms_of_xftfont_for_pdumper): new function.
      (syms_of_xftfont): call it.
      * src/xmenu.c (syms_of_xmenu_for_pdumper): new function.
      (syms_of_xmenu): call it.
      * src/xselect.c (syms_of_xselect_for_pdumper): new function.
      (syms_of_xselect): call it.
      * src/xsettings.c (syms_of_xsettings): add more pdumper notes.
      * src/term.c (syms_of_xterm): add pdumper note.
      
      * src/dispnew.c (init_faces_initial): new function.
      (init_display_interactive): rename from init_display; use
      will_dump_p instead of !initialized.  Initialize faces early for
      pdumper if needed.
      (init_display): new function.
      (syms_of_display_for_pdumper): new function.
      (syms_of_display): call it.
      
      * src/dbusbind.c (syms_of_dbusbind): Add TODO for bus reset
      on pdumper load.
      
      * src/data.c (Fdefalias): Use will_dump_p
      instead of Vpurify_flag.
      (Fmake_variable_buffer_local): silence compiler warning with -Og
      by making valcontents UNINIT.
      (arith_driver): silence compiler warning with UNINIT.
      
      * src/conf_post.h (ATTRIBUTE_SECTION): new macro.
      
      * src/composite.c (composition_gstring_put_cache): rehash hash
      table if needed.
      
      * src/coding.c (init_coding_once, syms_of_coding): remember
      pdumper stuff.
      
      * src/charset.h (charset_table_size, charset_table_user): declare.
      
      * src/charset.c (charset_table_used, charset_table_size): un-static.
      (init_charset_oncem, syms_of_charset): remember pdumper stuff.
      
      * src/category.c (category_table_version): remove obsolete
      variable.
      
      * src/callint.c (syms_of_callint): staticpro 'preserved_fns'
      (init_callproc): use will_dump_p instead of !CANNOT_DUMP.
      
      * src/bytecode.c (exec_byte_code): rehash table tables if needed
      
      * src/buffer.c (alloc_buffer_text, free_buffer_text): account for
      pdumper
      (init_buffer_once): add TODO; remember stuff for pdumper.
      (init_buffer): don't take initialized argument; adjust
      for pdumper.
      
      * src/atimer.c (init_atimer): initialize subr only if
      !initialized.
      
      * src/alloc.c: (vector_marked_p, set_vector_marked)
      (vectorlike_marked_p, set_vectorlike_marked, cons_marked_p)
      (set_cons_marked, string_marked_p, set_string_marked)
      (symbol_marked_p, set_symbol_marked, interval_marked_p)
      (set_interval_marked): new accessor routines.  Use them
      instead of raw GC access throughout.
      (Vdead): make non-static when ENABLE_CHECKING.
      (vectorlike_nbytes): rename of 'vector_nbytes'; take a vectorlike
      header as input instead of a vector.
      (number_finalizers_run): new internal C variable.
      (mark_maybe_object): check for pdumper objects.
      (valid_pointer_p): don't be gratuitously inefficient under rr(1).
      (make_pure_c_string): add support for size_byte = -2 mode
      indicating that string data points into Emacs image rodata.
      (visit_vectorlike_root): visits GC roots embedded in
      vectorlike objects.
      (visit_buffer_root): visits GC roots embedded in
      our totally-not-a-buffer buffer global objects.
      (visit_static_gc_roots): visit GC roots in the Emacs data section.
      (mark_object_root_visitor): root callback used for conventional GC
      marking
      (weak_hash_tables): new internal variable for tracking found weak
      hash tables during GC.
      (mark_and_sweep_weak_table_contents): new weak hash table marking.
      (garbage_collect_1): use new GC root visitor machinery.
      (mark_vectorlike): accept a vectorlike_header instead of a
      Lisp_Vector.
      (mark_frame, mark_window, mark_hash_table): new functions.
      (mark_object): initialize 'm'; check for pdumper objects and use
      new mark-bit accessors throughout.  Remove some object-specific
      marking code and move to helper functions above.
      (survives_gc_p): check for pdumper objects.
      (gc-sweep): clear pdumper mark bits.
      (init_alloc_once_for_pdumper): new helper function for early init
      called both during normal init and pdumper load.
      (init_alloc_once): pdumper integration.
      
      * src/Makefile.in: Rewrite dumping for pdumper; add pdumper.o;
      invoke temacs with --temacs command line option; build dmpstruct.h
      from dmpstruct.awk; stop relying on CANNOT_DUMP; clean up pdumper
      intermediate files during build.
      
      * nextstep/Makefile.in: build emacs.pdmp into NS packages
      
      * lisp/startup.el: account for new '--temacs' and '--dump-file'
      command line option.
      
      * lisp/loadup.el: rewrite early init to account for pdumper; use
      injected 'dump-mode' variable (set via the new '--temacs' option)
      instead of parsing command line.
      
      * lisp/cus-start.el: Check 'dump-mode' instead of 'purify-flag',
      since the new 'dump-mode'
      
      * lib-src/make-fingerprint.c: new program
      
      * lib-src/Makefile.in: built make-fingerprint utility program
      
      * configure.ac: Add --with-pdumper toggle to control pdumper
      support; add --with-unexec toggle to control unexec support.
      Add --with-dumping option to control which dumping strategy we use
      by default.  Adjust for pdumper throughout.  Check for
      posix_madvise.
      
      * Makefile.in: Add @DUMPING@ substitution; add pdumper mode.
      
      * .gitignore: Add make-fingerprint, temacs.in, fingerprint.c,
      dmpstruct.h, and pdumper dump files.
      d12e5d00
  12. 09 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Use shortcuts for Flength · a8465033
      Paul Eggert authored
      When calculating the length of a Lisp object whose type is
      known, use a specialized length operation on it to save a bit
      of runtime overhead.
      * src/callint.c (Fcall_interactively):
      * src/minibuf.c (read_minibuf_unwind):
      Use ASIZE rather than Flength on values that must be vectors.
      * src/charset.c (Fsort_charsets):
      * src/coding.c (detect_coding_sjis):
      (Fdefine_coding_system_internal):
      * src/data.c (wrong_choice):
      * src/eval.c (Flet, eval_sub, Fapply, apply_lambda):
      * src/fns.c (sort_list):
      * src/font.c (font_vconcat_entity_vectors)
      (font_find_for_lface):
      * src/frame.c (Fmodify_frame_parameters):
      * src/fringe.c (get_logical_fringe_bitmap):
      * src/ftfont.c (ftfont_get_open_type_spec):
      * src/gtkutil.c (xg_print_frames_dialog):
      * src/lread.c (read1, read_vector):
      * src/keymap.c (Fkey_description):
      * src/kqueue.c (Fkqueue_add_watch):
      * src/macfont.m (macfont_get_open_type_spec):
      * src/menu.c (parse_single_submenu, x_popup_menu_1):
      * src/minibuf.c (Finternal_complete_buffer):
      * src/nsfont.m (ns_findfonts, nsfont_list_family):
      * src/process.c (Fmake_process):
      * src/search.c (Fset_match_data):
      * src/xfaces.c (Fx_family_fonts):
      Use list_length rather than Flength on values that must be lists.
      * src/fns.c (list_length): New function.
      (Flength): Use it.
      * src/nsfont.m (ns_findfonts):
      Use !NILP (x) rather than XFIXNUM (Flength (x)) != 0.
      * src/xdisp.c (store_mode_line_string):
      Use SCHARS rather than Flength on values that must be strings.
      a8465033
  13. 01 Jan, 2019 1 commit
  14. 03 Nov, 2018 1 commit
  15. 28 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Improve bignum support for system types · d77d01d2
      Paul Eggert authored
      Use bignums when Emacs converts to and from system types like
      off_t for file sizes whose values can exceed fixnum range.
      Formerly, Emacs sometimes generted floats and sometimes ad-hoc
      conses of integers.  Emacs still accepts floats and conses for
      these system types, in case some stray Lisp code is generating
      them, though this usage is obsolescent.
      * doc/lispref/files.texi (File Attributes):
      * doc/lispref/hash.texi (Defining Hash):
      * doc/lispref/nonascii.texi (Character Sets):
      * doc/lispref/os.texi (User Identification):
      * doc/lispref/processes.texi (System Processes):
      * etc/NEWS:
      Document changes.
      * src/bignum.c (mpz_set_uintmax, make_biguint)
      (mpz_set_uintmax_slow, bignum_to_intmax, bignum_to_uintmax):
      New functions.
      (mpz_set_intmax_slow): Implement via mpz_limbs_write,
      to avoid the need for an extra pass through a negative number.
      * src/charset.c (Fencode_char):
      * src/composite.h (LGLYPH_SET_CODE):
      * src/dired.c (file_attributes):
      * src/dosfns.c, src/w32.c (list_system_processes)
      (system_process_attributes):
      * src/editfns.c (init_editfns, Fuser_uid, Fuser_real_uid)
      (Fgroup_gid, Fgroup_real_gid, Femacs_pid):
      * src/emacs-module.c (check_vec_index):
      * src/fns.c (Fsafe_length):
      * src/process.c (record_deleted_pid, Fprocess_id):
      * src/sysdep.c (list_system_processes, system_process_attributes):
      * src/xselect.c (x_own_selection, selection_data_to_lisp_data):
      * src/xterm.c (set_wm_state):
      * src/inotify.c (inotifyevent_to_event, add_watch)
      (inotify_callback):
      If an integer is out of fixnum range, use a bignum
      instead of converting it to a float or a cons of integers.
      * src/coding.c (Fdefine_coding_system_internal):
      * src/frame.c (frame_windows_min_size)
      (x_set_frame_parameters):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/nsterm.m (mouseDown:):
      * src/syntax.c (find_defun_start):
      * src/w32fns.c (x_set_undecorated, w32_createwindow)
      (w32_wnd_proc, Fx_create_frame, Fx_show_tip)
      (w32_console_toggle_lock_key):
      * src/w32inevt.c (key_event):
      * src/w32proc.c (Fw32_get_locale_info):
      Do not mishandle floats by treating their addresses as their
      values.
      * src/data.c (store_symval_forwarding):
      * src/gnutls.c (Fgnutls_error_fatalp, Fgnutls_error_string):
      * src/keyboard.c (command_loop_1, make_lispy_event):
      * src/lread.c (read_filtered_event, read1)
      (substitute_object_recurse):
      * src/window.c (Fcoordinates_in_window_p, Fwindow_at)
      (window_resize_apply, Fset_window_vscroll):
      * src/xdisp.c (handle_single_display_spec, try_scrolling)
      (redisplay_window, calc_pixel_width_or_height)
      (calc_line_height_property, on_hot_spot_p):
      * src/xfaces.c (check_lface_attrs):
      * src/xselect.c (x_get_local_selection, cons_to_x_long)
      (lisp_data_to_selection_data, clean_local_selection_data)
      (x_check_property_data, x_fill_property_data):
      (x_send_client_event):
      Do not reject bignums.
      * src/data.c (INTBIG_TO_LISP, intbig_to_lisp)
      (uintbig_to_lisp):
      Remove.  All uses removed.
      * src/data.c (cons_to_unsigned, cons_to_signed):
      * src/dbusbind.c (xd_signature, xd_extract_signed)
      (xd_extract_unsigned):
      * src/dispnew.c (sit_for):
      * src/dosfns.c, src/w32.c (system_process_attributes):
      * src/editfns.c (Fuser_full_name):
      * src/fileio.c (file_offset):
      * src/fileio.c (write_region):
      * src/font.c (font_unparse_xlfd, font_open_for_lface, Fopen_font):
      * src/frame.c (x_set_screen_gamma):
      * src/frame.h (NUMVAL, FRAME_PIXEL_X_FROM_CANON_X)
      (FRAME_PIXEL_Y_FROM_CANON_Y):
      * src/image.c (parse_image_spec, x_edge_detection)
      (compute_image_size):
      * src/json.c (json_to_lisp):
      * src/lcms.c (PARSE_LAB_LIST_FIELD, Flcms_cie_de2000)
      (PARSE_XYZ_LIST_FIELD, PARSE_JCH_LIST_FIELD)
      (PARSE_JAB_LIST_FIELD, PARSE_VIEW_CONDITION_FLOAT)
      (Flcms_temp_to_white_point):
      * src/nsimage.m (ns_load_image, setSizeFromSpec):
      * src/process.c (Fsignal_process, handle_child_signal):
      * src/sysdep.c (system_process_attributes):
      * src/xdisp.c (calc_line_height_property):
      Handle bignums.
      * src/data.c (Fnumber_to_string): Use proper predicate name in
      signal if the argument is not a number.
      * src/lisp.h (make_uint): New function.
      (INT_TO_INTEGER): New macro.
      (FIXED_OR_FLOATP, CHECK_FIXNUM_OR_FLOAT)
      (CHECK_FIXNUM_OR_FLOAT_COERCE_MARKER, INTEGER_TO_CONS)
      (make_fixnum_or_float): Remove; no longer used.
      * src/nsfns.m, src/w32fns.c, src/xfns.c (Fx_create_frame):
      Reject floating-point min-width or min-height.
      * src/process.c (handle_child_signal): Do not worry
      about floating-point pids, as they are no longer generated.
      d77d01d2
  16. 08 Aug, 2018 1 commit
    • Tom Tromey's avatar
      More macro renamings for bignum · d1ec3a0a
      Tom Tromey authored
      * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
      src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
      src/category.c, src/ccl.c, src/character.c, src/character.h,
      src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
      src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
      src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
      src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
      src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
      src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
      src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
      src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
      src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
      src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
      src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
      src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
      src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
      src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
      src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
      src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
      src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
      src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
      src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
      Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
      d1ec3a0a
  17. 13 Jul, 2018 1 commit
    • Tom Tromey's avatar
      Rename integerp->fixnum, etc, in preparation for bignums · 42fe787b
      Tom Tromey authored
      * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
      src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
      src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
      src/process.c, src/profiler.c, src/search.c, src/sound.c,
      src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
      src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
      src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
      src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
      src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
      src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
      src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
      INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
      make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
      NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
      42fe787b
  18. 08 Jun, 2018 1 commit
    • Daniel Colascione's avatar
      Add support for per-window face remapping · 9d447fa1
      Daniel Colascione authored
      Extend face specifications to support the notion of filtering to a
      specific context and add a filter that limits a face specification to
      windows having a certain parameter.
      
      * src/xfaces.c:
      (evaluate_face_filter,filter_face_ref): New functions.
      (merge_face_ref): Ignore filtered face specifications.
      (Fx_list_fonts,get_lface_attributes,merge_face_vectors)
      (merge_named_face,merge_face_ref,merge_face_ref)
      (Finternal_merge_in_global_face,Fface_font,lookup_named_face)
      (lookup_basic_face,Fface_attributes_as_vector)
      (x_supports_face_attributes_p)
      (Fdisplay_supports_face_attributes_p,realize_named_face)
      (compute_char_face,face_at_buffer_position)
      (face_at_buffer_position,face_at_buffer_position)
      (face_at_buffer_position)
      (face_for_overlay_string,face_at_string_position,merge_faces):
      Pass window to face machinery.
      (syms_of_xfaces): Add :window and :filtered
      
      * src/xdisp.c (init_iterator, handle_face_prop)
      (handle_single_display_spec, merge_escape_glyph_face)
      (merge_glyphless_glyph_face, get_next_display_element)
      (next_element_from_display_vector, append_space_for_newline)
      (extend_face_to_end_of_line,highlight_trailing_whitespace)
      (maybe_produce_line_number)
      (display_line, calc_line_height_property): Pass window to
      face machinery.
      
      * src/term.c (tty_menu_activate): Adjust to new face core
      function signature.
      
      * src/msdos.c (XMenuActivate): Adjust to new face core
      function signature.
      
      * src/fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face):
      Pass window to face machinery.
      
      * src/font.c (font_range, Finternal_char_font): Pass window to
      face machinery.
      
      * src/dispnew.c (spec_glyph_lookup_face): Pass window to
      face machinery.
      
      * src/dispextern.h:
      (lookup_named_face,lookup_basic_face)
      (lookup_derived_face,merge_faces):
      Add struct window arguments to prototypes.
      9d447fa1
  19. 01 Jan, 2018 1 commit
  20. 12 Dec, 2017 1 commit
    • Paul Eggert's avatar
      Narrow pointer bounds when appropriate · 4295050e
      Paul Eggert authored
      This typically occurs in a storage manager, where the caller
      is expected to access only the newly-allocated object,
      instead of using the returned value to access unrelated
      parts of the heap.
      * src/alloc.c (allocate_string, allocate_string_data)
      (compact_small_strings, find_string_data_in_pure)
      (sweep_strings, setup_on_free_list, allocate_vectorlike
      (pure_alloc):
      * src/bytecode.c (exec_byte_code):
      * src/callint.c (Fcall_interactively):
      * src/dispnew.c (scrolling):
      * src/editfns.c (styled_format):
      * src/frame.c (xrdb_get_resource, x_get_resource_string):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/gmalloc.c (malloc, realloc, aligned_alloc):
      Narrow pointer bounds when appropriate.
      * src/alloc.c (SDATA_OF_STRING):
      * src/lisp.h (make_lisp_symbol) [__CHKP__]:
      Widen bounds here, though.
      * src/bytecode.c, src/callint.c, src/dispnew.c, src/editfns.c:
      * src/emacs.c, src/frame.c, src/fringe.c:
      Include ptr-bounds.h.
      * src/ptr-bounds.h (ptr_bounds_clip): New function.
      4295050e
  21. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  22. 19 Feb, 2017 2 commits
  23. 01 Jan, 2017 1 commit
  24. 02 Jul, 2016 1 commit
    • Eli Zaretskii's avatar
      Rename FACE_OPT_FROM_ID to FACE_FROM_ID_OR_NULL · 55d38fc8
      Eli Zaretskii authored
      * src/dispextern.h (FACE_FROM_ID_OR_NULL): Renamed from
      FACE_OPT_FROM_ID; all callers changed.
      * src/xdisp.c (extend_face_to_end_of_line): Call FACE_FROM_ID, not
      FACE_FROM_ID_OR_NULL, as the resulting face is immediately
      dereferenced.
      (fill_gstring_glyph_string): Call FACE_FROM_ID, not
      FACE_FROM_ID_OR_NULL, as the resulting face will be dereferenced
      when the glyph string is drawn.
      (BUILD_COMPOSITE_GLYPH_STRING): Call FACE_FROM_ID, not
      FACE_FROM_ID_OR_NULL, as the resulting face will be dereferenced
      in fill_composite_glyph_string.
      (calc_line_height_property): Call FACE_FROM_ID_OR_NULL rather that
      FACE_FROM_ID, since the function and its caller can cope with that
      situation.  Conflate 3 tests of missing face or font into just
      one.
      * src/xfaces.c (Fx_list_fonts, Fface_font, lookup_face): Call
      FACE_FROM_ID_OR_NULL rather that FACE_FROM_ID, since these
      functions can cope with that situation.
      (lookup_derived_face): Don't call FACE_FROM_ID if the result will
      not be used.
      * src/w32console.c (w32_face_attributes): Remove redundant 'eassert'.
      55d38fc8
  25. 08 Jun, 2016 1 commit
  26. 18 May, 2016 1 commit
    • Paul Eggert's avatar
      Port --enable-gcc-warnings to GCC 6.1 · 374f6a5f
      Paul Eggert authored
      * configure.ac (WERROR_CFLAGS): Omit -Wunused-const-variable=2.
      * lib-src/etags.c (LOOKING_AT, LOOKING_AT_NOCASE):
      Omit test whether pointer plus a constant equals a null pointer.
      * src/alloc.c (compact_small_strings):
      Avoid pointer arithmetic on null pointers.
      * src/alloc.c (mark_face_cache):
      * src/fontset.c (free_realized_fontsets, Fset_fontset_font):
      * src/fringe.c (draw_fringe_bitmap_1)
      (Fset_fringe_bitmap_face):
      * src/macfont.m (macfont_draw):
      * src/msdos.c (IT_set_face, IT_clear_screen):
      * src/nsfont.m (nsfont_draw):
      * src/nsterm.h (FRAME_DEFAULT_FACE):
      * src/nsterm.m (ns_draw_window_cursor)
      (ns_draw_vertical_window_border, ns_draw_window_divider)
      (ns_dumpglyphs_box_or_relief)
      (ns_maybe_dumpglyphs_background, ns_dumpglyphs_image)
      (ns_dumpglyphs_stretch):
      * src/w32term.c (w32_draw_vertical_window_border)
      (w32_draw_window_divider, x_set_mouse_face_gc):
      * src/xdisp.c (estimate_mode_line_height, init_iterator)
      (handle_face_prop, handle_single_display_spec, pop_it)
      (CHAR_COMPOSED_P, get_next_display_element)
      (next_element_from_display_vector, extend_face_to_end_of_line)
      (fill_gstring_glyph_string,BUILD_COMPOSITE_GLYPH_STRING):
      * src/xfaces.c (Finternal_merge_in_global_face, Fface_font)
      (lookup_named_face):
      * src/xterm.c (x_draw_vertical_window_border)
      (x_draw_window_divider, x_set_mouse_face_gc):
      Prefer FACE_OPT_FROM_ID to FACE_FROM_ID when the result might be null.
      * src/xterm.c (try_window_id):
      Redo loop to convince GCC 6.1 that it is null pointer safe.
      (x_color_cells):
      Use eassume as necessary to pacify GCC 6.1.
      * src/dispextern.h (FACE_FROM_ID, IMAGE_FROM_ID): Now returns non-null.
      (FACE_OPT_FROM_ID, IMAGE_OPT_FROM_ID): New macro, with the old
      behavior of the non-_OPT macro, to be used when the result
      might be a null pointer.
      * src/dispnew.c (buffer_posn_from_coords, marginal_area_string)
      [HAVE_WINDOW_SYSTEM]:
      * src/intervals.h (INTERVAL_WRITABLE_P):
      * src/term.c (turn_off_face):
      * src/xdisp.c (get_glyph_face_and_encoding, fill_image_glyph_string)
      (produce_image_glyph, produce_xwidget_glyph):
      * src/xfaces.c (lookup_named_face):
      Remove unnecessary test for null pointer.
      * src/keyboard.c (read_char): Suppress bogus -Wclobbered warning.
      * src/process.c (would_block): New function.
      (server_accept_connection, wait_reading_process_output, send_process):
      Use it.
      * src/xdisp.c (get_window_cursor_type, note_mouse_highlight):
      Prefer IMAGE_OPT_FROM_ID to IMAGE_FROM_ID when the result
      might be null.
      374f6a5f
  27. 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
  28. 01 Jan, 2016 1 commit
  29. 21 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Include-file cleanup for src directory · 63cfb75f
      Paul Eggert authored
      Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707).
      In a few cases, add ‘#include "foo.h"’ if the file needs foo.h
      but does not include it directly.  As a general rule, a source
      file should include foo.h if it needs the interfaces that foo.h
      defines.
      * src/alloc.c: Don’t include process.h.  Include dispextern.h,
      systime.h.
      * src/atimer.c: Don’t include blockinput.h.
      * src/buffer.c: Include coding.h, systime.h.  Don’t include
      keyboard.h, coding.h.
      * src/callint.c: Don’t include commands.h, keymap.h.
      * src/callproc.c: Don’t include character.h, ccl.h, composite.h,
      systty.h, termhooks.h.
      * src/casetab.c: Don’t include character.h.
      * src/category.c: Don’t include charset.h, keymap.h.
      * src/ccl.h: Don’t include character.h.
      * src/character.c: Don’t include charset.h.
      * src/charset.c: Don’t include disptab.h.
      * src/chartab.c: Don’t include ccl.h.
      * src/cm.c: Don’t include frame.h, termhooks.h.
      * src/cmds.c: Don’t include window.h, dispextern.h.
      * src/coding.c: Don’t include window.h, frame.h.
      * src/composite.c: Include composite.h.  Don’t include window.h,
      font.h.
      * src/data.c: Don’t include syssignal.h, termhooks.h, font.h.
      * src/dbusbind.c: Don’t include frame.h.
      * src/decompress.c: Don’t include character.h.
      * src/dired.c: Don’t include character.h, commands.h, charset.h.
      * src/dispnew.c: Don’t include character.h, indent.h, intervals.h,
      process.h, timespec.h.  Include systime.h.
      * src/doc.c: Include coding.h.  Don’t include keyboard.h.
      * src/editfns.c: Include composite.h.  Don’t include frame.h.
      * src/emacs.c: Include fcntl.h, coding.h.  Don’t include
      commands.h, systty.h..
      * src/fileio.c: Don’t include intervals.h, dispextern.h.
      Include composite.h.
      * src/filelock.c: Don’t include character.h, systime.h.
      * src/fns.c: Don’t include time.h, commands.h, keyboard.h,
      keymap.h, frame.h, blockinput.h, xterm.h.  Include composite.h.
      * src/font.c: Include termhooks.h.
      * src/font.h: Don’t include ccl.h, frame.h.  Add forward decls of
      struct composition_it, struct face, struct glyph_string.
      * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h,
      intervals.h, window.h, termhooks.h.
      * src/frame.c: Don’t include character.h, commands.h, font.h.
      * src/frame.h: Don’t include dispextern.h.
      * src/fringe.c: Don’t include character.h.
      * src/ftcrfont.c: Don’t include dispextern.h, frame.h,
      character.h, charset.h, fontset.h.
      * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h,
      fontset.h.
      * src/ftxfont.c: Don’t include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/gfilenotify.c: Don’t include frame.h, process.h.
      * src/gtkutil.c: Include dispextern.h, frame.h, systime.h.
      Don’t include syssignal.h, buffer.h, charset.h, font.h.
      * src/gtkutil.h: Don’t include frame.h.
      * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h.
      Don’t include character.h.
      * src/indent.c: Don’t include keyboard.h, termchar.h.
      * src/inotify.c: Don’t include character.h, frame.h.
      * src/insdel.c: Include composite.h.  Don’t include blockinput.h.
      * src/intervals.c: Don’t include character.h, keyboard.h.
      * src/intervals.h: Don’t include dispextern.h, composite.h.
      * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h.
      Include coding.h.
      * src/keyboard.h: Don’t incldue systime.h.
      * src/keymap.c: Don’t include charset.h, frame.h.
      * src/lread.c: Include dispextern.h and systime.h.
      Don’t include frame.h.  Include systime.h.
      * src/macros.c: Don’t include commands.h, character.h, buffer.h.
      * src/menu.c: Include character.h, coding.h.  Don’t include
      dispextern.h.
      * src/menu.h: Don’t include systime.h.
      * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h,
      intervals.h, termhooks.h.
      * src/print.c: Include coding.h.  Don’t include keyboard.h,
      window.h, dispextern.h, termchar.h, termhooks.h, font.h.
      Add forward decl of struct terminal.
      * src/process.c: Don’t include termhooks.h, commands.h,
      dispextern.h, composite.h.
      * src/region-cache.c: Don’t include character.h.
      * src/scroll.c: Don’t include keyboard.h, window.h.
      * src/search.c: Don’t include category.h, commands.h.
      * src/sound.c: Don’t include dispextern.h.
      * src/syntax.c: Don’t include command.h, keymap.h.
      * src/sysdep.c: Don’t include window.h, dispextern.h.
      * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’,
      * src/term.c: Don’t include systty.h, intervals.h, xterm.h.
      * src/terminal.c: Include character.h.
      Don’t include charset.h, coding.h.
      * src/textprop.c: Don’t include character.h.
      * src/undo.c: Don’t include character.h, commands.h, window.h.
      * src/unexsol.c: Don’t include character.h, charset.h.
      * src/widget.c: Include widget.h.  Don’t include keyboard.h,
      window.h, dispextern.h, blockinput.h, character.h, font.h.
      * src/widgetprv.h: Don’t include widget.h.
      * src/window.c: Don’t include character.h, menu.h, intervals.h.
      * src/xdisp.c: Include composite.h, systime.h.  Don’t include
      macros.h, process.h.
      * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h,
      intervals.h.
      * src/xfns.c: Don’t include menu.h, character.h, intervals.h,
      epaths.h, fontset.h, systime.h, atimer.h, termchar.h.
      * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h.
      * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h.
      * src/xgselect.c: Don’t include timespec.h, frame.h.
      Include systime.h.
      * src/xgselect.h: Don’t include time.h.
      Use a forward decl to struct timespec instead.
      * src/xmenu.c: Don’t include keymap.h, character.h, charset.h,
      dispextern.h.  Include systime.h.
      * src/xml.c: Don’t include character.h.
      * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h.
      * src/xselect.c: Don’t include dispextern.h, character.h,
      buffer.h, process.h.
      * src/xsmfns.c: Don’t include systime.h, sysselect.h.
      * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h,
      intervals.h process.h, keymap.h, xgselect.h.  Include composite.h.
      63cfb75f
  30. 14 Feb, 2015 1 commit
  31. 11 Feb, 2015 1 commit
    • Jan D's avatar
      Add cairo drawing. · dddcc0e7
      Jan D authored
      * configure.ac (with-cairo): New option.
      (USE_CAIRO): Default to yes for Gtk+ 3.  Add code to test for cairo,
      set CAIRO_CFLAGS, CAIRO_LIBS.  Add ftcrfonto to FONT_OBJ if cairo.
      Output "Does Emacs use cairo?".
      
      * lisp/version.el (emacs-version): Add cairo version.
      
      * src/Makefile.in (CAIRO_CFLAGS, CAIRO_LIBS): New variables.
      (FONT_OBJ): Add comment about ftcrfont.
      (ALL_CFLAGS): Add CAIRO_CFLAGS.
      (LIBES): Add CAIRO_LIBS.
      
      * src/dispextern.h (struct image): Add cr_data for cairo.
      (x_cr_init_fringe): Declare.
      
      * src/font.c (syms_of_font): Call syms_of_ftcrfont for cairo.
      
      * src/font.h (ftcrfont_driver, syms_of_ftcrfont): Declare
      
      * src/fringe.c (x_cr_init_fringe): New function name that shares code
      with w32_init_fringe.
      
      * src/ftcrfont.c: New font driver for cairo, based on the ftfont driver.
      
      * src/ftfont.c (ftfont_info_size); New global variable.
      (ftfont_open2): New extern function almost the same as old ftfont_open,
      but takes the font_object as argument.
      (ftfont_open): Build font object and call ftfont_open2.
      
      * src/ftfont.h (ftfont_open2, ftfont_info_size): Declare.
      
      * src/gtkutil.c (xg_clear_under_internal_border)
      (xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos): Only
      queue_draw if not cairo.  Change args to x_clear_area.
      (xg_get_font): Use Qftcr when using cairo, Qxft otherwise.
      (xg_page_setup_dialog, xg_get_page_setup, draw_page)
      (xg_print_frames_dialog): New functions for printing.
      
      * src/gtkutil.h (xg_page_setup_dialog, xg_get_page_setup)
      (xg_print_frames_dialog): Declare.
      
      * src/image.c: Add defined (USE_CAIRO) for PNG.
      Add !defined USE_CAIRO for W32 PNG code.
      (x_clear_image): If cairo, destroy the surface in cr_data.
      (png_load): Add new cairo compatible implementation.
      (lookup_image_type): Add defined (USE_CAIRO) for define png_type.
      
      * src/xfns.c: New section Printing.
      (x-export-frames, x-page-setup-dialog, x-get-page-setup)
      (x-print-frames-dialog): New printing functions.
      (Fx_create_frame, x_create_tip_frame): Register ftcrfont if
      cairo.
      (syms_of_xfns): Defsym Qorientation, Qtop_margin, Qbottom_margin,
      Qportrait, Qlandscape, Qreverse_portrait, Qreverse_landscape).
      (syms_of_xfns): Provide cairo and defvar cairo-version-string.
      defsubr Sx_page_setup_dialog, Sx_get_page_setup, Sx_print_frames_dialog.
      
      * src/xterm.c (x_clear_area1, x_prepare_for_xlibdraw)
      (x_set_clip_rectangles, x_reset_clip_rectangles, x_fill_rectangle)
      (x_draw_rectangle, x_fill_trapezoid_for_relief, x_clear_window)
      (x_gc_get_ext_data, x_extension_initialize, x_cr_accumulate_data):
      Declare.
      (FRAME_CR_CONTEXT, FRAME_CR_SURFACE): New macros.
      (max_fringe_bmp, fringe_bmp): New variables.
      (x_gc_get_ext_data, x_extension_initialize)
      (x_cr_destroy_surface, x_begin_cr_clip, x_end_cr_clip)
      (x_set_cr_source_with_gc_foreground)
      (x_set_cr_source_with_gc_background, x_cr_define_fringe_bitmap)
      (x_cr_destroy_fringe_bitmap, x_cr_draw_image, x_cr_draw_frame)
      (x_cr_accumulate_data, x_cr_destroy, x_cr_export_frames)
      (x_prepare_for_xlibdraw, x_set_clip_rectangles)
      (x_reset_clip_rectangles, x_fill_rectangle, x_draw_rectangle)
      (x_clear_window, x_fill_trapezoid_for_relief): New functions.
      (x_update_begin): Create cairo surface if needed.
      (x_draw_vertical_window_border): Call x_fill_rectangle for cairo.
      (x_update_end): Paint cairo drawing surface to xlib surface.
      (x_clear_under_internal_border, x_after_update_window_line): Adjust
      arguments to x_clear_area.
      (x_draw_fringe_bitmap): Call x_fill_rectangle.  Get GC values and
      call x_cr_draw_image for cairo.  Call x_reset_clip_rectangles instead
      of XSetClipMask.
      (x_set_glyph_string_clipping)
      (x_set_glyph_string_clipping_exactly): Use x_set_clip_rectangles
      instead of XSetClipRectangles.
      (x_clear_glyph_string_rect, x_draw_glyph_string_background): Use
      x_fill_rectangle instead of XFillRectangle.
      (x_draw_glyph_string_foreground)
      (x_draw_composite_glyph_string_foreground)
      (x_draw_glyphless_glyph_string_foreground): Use x_draw_rectangle instead
      of XDrawRectangle.
      (x_draw_relief_rect): Add code for USE_CAIRO.
      Call x_reset_clip_rectangles instead of XSetClipMask.
      (x_draw_box_rect): x_set_clip_rectangles instead of XSetClipRectangles,
      x_fill_rectangle instead of XFillRectangle, x_reset_clip_rectangles
      instead of XSetClipMask.
      (x_draw_image_foreground, x_draw_image_foreground_1):
      x_draw_rectangle instead of XDrawRectangle.
      (x_draw_glyph_string_bg_rect): x_fill_rectangle instead of
      XFillRectangle.
      (x_draw_image_glyph_string): If img has cr_data, use it as
      a cairo surface.
      (x_draw_stretch_glyph_string): x_set_clip_rectangles instead of
      XSetClipRectangles, x_fill_rectangle instead of XFillRectangle.
      (x_draw_glyph_string): x_fill_rectangle instead of XFillRectangle.,
      x_reset_clip_rectangles instead of XSetClipMask.
      (x_shift_glyphs_for_insert): Call x_prepare_for_xlibdraw.
      (x_clear_area1): New function that calls XClearArea.
      (x_clear_area): Takes frame as parameter, calls x_clear_area1 for
      non-cairo.
      (x_clear_frame): x_clear_window instead of XClearWindow.
      (x_scroll_run): Set frame garbaged if cairo.
      (XTmouse_position): Initialize *part to 0.
      (x_scroll_bar_create): Adjust arguments to x_clear_area.
      (x_scroll_bar_set_handle): x_clear_area1 instead of x_clear_area,
      x_fill_rectangle instead of XFillRectangle.
      (XTset_vertical_scroll_bar, XTset_horizontal_scroll_bar): Adjust
      arguments to x_clear_area.
      (x_scroll_bar_expose): x_draw_rectangle instead of XDrawRectangle.
      (handle_one_xevent): Adjust arguments to x_clear_area.
      Destroy cairo surface for frame if ConfigureNotify.
      (x_clip_to_row): x_set_clip_rectangles instead of XSetClipRectangles.
      (x_draw_hollow_cursor): x_draw_rectangle instead of XDrawRectangle,
      x_reset_clip_rectangles instead of XSetClipMask.
      (x_draw_bar_cursor): x_fill_rectangle instead of XFillRectangle,
      x_reset_clip_rectangles instead of XSetClipMask.
      (x_clear_frame_area): Adjust arguments to x_clear_area.
      (x_free_frame_resources): Call x_prepare_for_xlibdraw.
      (x_term_init): Call x_extension_initialize if cairo.
      (x_redisplay_interface): Add x_cr_define_fringe_bitmap,
      x_cr_destroy_fringe_bitmap for cairo.
      (x_initialize): Call x_cr_init_fringe for cairo.
      
      * src/xterm.h: Add include of cairo header files.
      (x_bitmap_record): Add img if cairo.
      (x_gc_ext_data): New struct for cairo.
      (x_display_info): Add ext_codes for cairo.
      (x_output): Add cr_context and cr_surface for cairo.
      (x_clear_area): Change arguments from Display*/Window to frame pointer.
      (x_query_color, x_begin_cr_clip, x_end_cr_clip)
      (x_set_cr_source_with_gc_foreground, x_set_cr_source_with_gc_background)
      (x_cr_draw_frame, x_cr_export_frames): Declare.
      dddcc0e7
  32. 27 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Use bool for boolean in xfaces.c · 2639c2ed
      Paul Eggert authored
      * dispextern.h: Adjust to signature changes.
      * font.c (font_at, font_range):
      * fontset.c (Finternal_char_font):
      * fringe.c (draw_fringe_bitmap_1):
      * xdisp.c (handle_face_prop, face_before_or_after_it_pos)
      (get_next_display_element, highlight_trailing_whitespace)
      (display_string, calc_line_height_property)
      (note_mode_line_or_margin_highlight, note_mouse_highlight):
      * xfaces.c (tty_suppress_bold_inverse_default_colors_p)
      (menu_face_changed_default, recompute_basic_faces)
      (Fbitmap_spec_p, parse_rgb_list, tty_lookup_color)
      (tty_defined_color, defined_color, face_color_gray_p)
      (face_color_supported_p, load_color2, load_face_colors)
      (Fx_list_fonts, LFACEP, push_named_merge_point)
      (resolve_face_name, lface_from_face_name_no_resolve)
      (lface_from_face_name, get_lface_attributes_no_remap)
      (get_lface_attributes, lface_fully_specified_p)
      (set_lface_from_font, merge_face_vectors, merge_named_face)
      (merge_face_ref, Finternal_make_lisp_face)
      (Finternal_lisp_face_p, Finternal_copy_lisp_face)
      (Finternal_set_lisp_face_attribute)
      (update_face_from_frame_parameter, set_font_frame_param)
      (face_boolean_x_resource_value)
      (Finternal_set_lisp_face_attribute_from_resource)
      (x_update_menu_appearance, Finternal_get_lisp_face_attribute)
      (Finternal_merge_in_global_face, Fface_font, face_attr_equal_p)
      (lface_equal_p, Finternal_lisp_face_equal_p)
      (Finternal_lisp_face_empty_p, lface_same_font_attributes_p)
      (Fcolor_distance, lookup_named_face, lookup_basic_face)
      (lookup_derived_face, Fface_attributes_as_vector)
      (x_supports_face_attributes_p, tty_supports_face_attributes_p)
      (Fdisplay_supports_face_attributes_p, realize_basic_faces)
      (realize_default_face, realize_named_face)
      (realize_non_ascii_face, realize_x_face, map_tty_color)
      (realize_tty_face, compute_char_face, face_at_buffer_position)
      (face_for_overlay_string, face_at_string_position):
      Use bool for boolean.
      * xfaces.c (set_lface_from_font):
      Return void, since callers never use the result.
      2639c2ed
  33. 20 Jan, 2015 2 commits
    • Paul Eggert's avatar
      Undo port to hypothetical nonzero Qnil case · 0dd19ac8
      Paul Eggert authored
      This mostly undoes the previous change in this area.  See:
      http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00570.html
      * alloc.c (allocate_pseudovector):
      * callint.c (Fcall_interactively):
      * dispnew.c (realloc_glyph_pool):
      * fringe.c (init_fringe):
      * lisp.h (memsetnil):
      * xdisp.c (init_iterator):
      Simplify by assuming that Qnil is zero, but verify the assumption.
      * lisp.h (NIL_IS_ZERO): Revert back to this symbol, removing
      NIL_IS_NONZERO.  All uses changed.
      0dd19ac8
    • Paul Eggert's avatar
      Port to hypothetical case where Qnil is nonzero · 347e0144
      Paul Eggert authored
      * alloc.c (allocate_pseudovector):
      * callint.c (Fcall_interactively):
      * coding.c (syms_of_coding):
      * dispnew.c (realloc_glyph_pool):
      * fringe.c (init_fringe):
      * lisp.h (memsetnil):
      * xdisp.c (init_iterator):
      Port to the currently-hypothetical case where Qnil is nonzero.
      * dispnew.c (adjust_glyph_matrix): Remove unnecessary verification,
      as there are no Lisp_Object values in the data here.
      * lisp.h (NIL_IS_NONZERO): New symbol, replacing NIL_IS_ZERO.
      All uses changed.  Define only if not already defined, so that one
      can debug with -DNIL_IS_NONZERO.
      * xdisp.c (init_iterator): Remove unnecessary initializations to 0.
      347e0144
  34. 19 Jan, 2015 1 commit
    • Paul Eggert's avatar
      Prefer memset to repeatedly assigning Qnil · b7f83add
      Paul Eggert authored
      * alloc.c (allocate_pseudovector): Catch more bogus values.
      * alloc.c (allocate_pseudovector):
      * callint.c (Fcall_interactively):
      * coding.c (syms_of_coding):
      * fringe.c (init_fringe):
      Verify that Qnil == 0.
      * callint.c (Fcall_interactively):
      * eval.c (Fapply, Ffuncall):
      * fns.c (mapcar1, larger_vector):
      * font.c (font_expand_wildcards):
      * fringe.c (init_fringe):
      Prefer memset to assigning zeros by hand.
      * callint.c (Fcall_interactively):
      Remove duplicate assignment of Qnil to args[i].
      * coding.c (syms_of_coding):
      Prefer LISP_INITIALLY_ZERO to assigning zeros by hand.
      * fileio.c (Ffile_selinux_context):
      Rewrite to avoid need for Lisp_Object array.
      * lisp.h (XLI_BUILTIN_LISPSYM): New macro.
      (DEFINE_LISP_SYMBOL_END): Use it.
      (NIL_IS_ZERO): New constant.
      (memsetnil): New function.
      b7f83add
  35. 05 Jan, 2015 1 commit
    • 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
  36. 01 Jan, 2015 2 commits
  37. 27 Jul, 2014 1 commit
    • Martin Rudalics's avatar
      Complete pixelwise frame/window resizing, add horizontal scrollbar support. · 3477e270
      Martin Rudalics authored
      * frame.el (frame-notice-user-settings): Rewrite using
      frame-initial-frame-tool-bar-height.
      * menu-bar.el (menu-bar-horizontal-scroll-bar)
      (menu-bar-no-horizontal-scroll-bar): New functions.
      (menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal
      scroll bars.
      * scroll-bar.el (scroll-bar-lines)
      (set-horizontal-scroll-bar-mode)
      (get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode)
      (scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag)
      (scroll-bar-toolkit-horizontal-scroll): New functions.
      (horizontal-scroll-bar-mode)
      (previous-horizontal-scroll-bar-mode)
      (horizontal-scroll-bar-mode-explicit): New variables.
      (horizontal-scroll-bar-mode): New option.
      (toggle-horizontal-scroll-bar): Do something.
      (top-level): Bind horizontal-scroll-bar mouse-1.
      * startup.el (tool-bar-originally-present): Remove variable.
      (command-line): Don't set tool-bar-originally-present.
      * window.el (window-min-height): Update doc-string.
      (window--dump-frame): Dump horizontal scroll bar values.
      (window--min-size-1): Handle minibuffer window separately.
      Count in margins and horizontal scroll bar.  Return safe value
      iff IGNORE equals 'safe.
      (frame-windows-min-size): New function (used by frame resizing
      routines).
      (fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal
      scroll bars.
      (window--sanitize-window-sizes): New function.
      (window-split-min-size): Remove.
      (split-window): Count divider-width.  Don't use
      `window-split-min-size' any more.  Reword error messages.
      Sanitize windows sizes after splitting.
      * buffer.h (struct buffer): New fields scroll_bar_height and
      horizontal_scroll_bar_type.
      * buffer.c (bset_scroll_bar_height)
      (bset_horizontal_scroll_bar_type): New functions.
      (Fbuffer_swap_text): Handle old_pointm field.
      (init_buffer_once): Set defaults for scroll_bar_height and
      horizontal_scroll_bar_type.
      (syms_of_buffer): New variables scroll_bar_height and
      horizontal_scroll_bar_type.
      * dispextern.h (window_part): Rename ON_SCROLL_BAR to
      ON_VERTICAL_SCROLL_BAR.  Add ON_HORIZONTAL_SCROLL_BAR.
      (set_vertical_scroll_bar): Remove prototype.
      (x_change_tool_bar_height): Add prototype.
      * dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
      (window_to_frame_vpos, update_frame_1, scrolling, init_display):
      Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
      and FRAME_LINES.
      (adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
      (update_window): Start mode_line_row->y after horizontal scroll
      bar.
      (change_frame_size_1): Call adjust_frame_size.
      (init_display): When changing the size of a tty frame do not
      pass height of menu bar.
      (Qframe_windows_min_size): New symbol.
      * frame.h (struct frame): List tool bar fields after menu bar
      fields.  Add official, total_lines, horizontal_scroll_bars,
      config_scroll_bar_height and config_scroll_bar_lines fields.
      (FRAME_HAS_HORIZONTAL_SCROLL_BARS)
      (FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
      (FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
      (FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
      (FRAME_WINDOWS_HEIGHT): New macros.
      (SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
      (FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
      (FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
      horizontal scroll bar.
      (frame_inhibit_resize, adjust_frame_size)
      (frame_windows_min_size): Add declarations.
      (Qscroll_bar_height, Qhorizontal_scroll_bars)
      (x_set_scroll_bar_default_height, x_set_left_fringe)
      (x_set_right_fringe, x_set_vertical_scroll_bars)
      (x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
      (x_set_scroll_bar_height): Add external declarations.
      * frame.c: (frame_inhibit_resize, frame_windows_min_size)
      (adjust_frame_size): New functions.
      (make_frame): Initial horizontal_scroll_bars field.  Use
      SET_FRAME_LINES.  Don't allow horizontal scroll bar in
      minibuffer window.
      (make_initial_frame, make_terminal_frame): No horizontal scroll
      bar in initial and terminal frames.  Use adjust_frame_size.
      (Fframe_total_cols): Fix doc-string.
      (Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
      (Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite
      using adjust_frame_size.
      (Qscroll_bar_height, Qhorizontal_scroll_bars)
      (Qframe_windows_min_size): New symbols.
      (x_set_frame_parameters): Remove call of check_frame_size.
      (x_report_frame_params): Return scroll_bar_height value.
      (x_set_left_fringe, x_set_right_fringe): New functions.
      (adjust_frame_height, x_set_internal_border_width)
      (x_set_fringe_width): Remove.
      (x_set_internal_border_width, x_set_vertical_scroll_bars)
      (x_set_scroll_bar_width, x_set_right_divider_width)
      (x_set_bottom_divider_width): Rewrite using adjust_frame_size.
      (x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New
      functions.
      (x_figure_window_size): Rewrite to make frame display the
      expected number of lines.
      (Vdefault_frame_scroll_bars): Rewrite doc-string.
      (Vdefault_frame_horizontal_scroll_bars)
      (Vframe_initial_frame_tool_bar_height)
      (frame_inhibit_implied_resize): New variables.
      * fringe.c (compute_fringe_widths): Remove.
      * gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
      (xg_create_horizontal_scroll_bar)
      (xg_update_horizontal_scrollbar_pos)
      (xg_set_toolkit_horizontal_scroll_bar_thumb)
      (xg_get_default_scrollbar_height)
      (xg_clear_under_internal_border): Extern.
      * gtkutil.c (xg_frame_resized): Don't call
      do_pending_window_change.
      (xg_frame_set_char_size): Use adjust_frame_size.
      (style_changed_cb): Call update_theme_scrollbar_height and
      x_set_scroll_bar_default_height.
      (x_wm_set_size_hint): Don't call check_frame_size.
      (update_theme_scrollbar_height)
      (xg_get_default_scrollbar_height)
      (xg_create_horizontal_scroll_bar)
      (xg_update_horizontal_scrollbar_pos)
      (xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
      (xg_create_scroll_bar): Set horizontal slot of bar.
      (xg_initialize): Call update_theme_scrollbar_height.
      (xg_clear_under_internal_border): No more static.
      * insdel.c (adjust_suspend_auto_hscroll): New function.
      (adjust_markers_for_delete, adjust_markers_for_insert)
      (adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
      * keyboard.c (readable_events, discard_mouse_events)
      (make_lispy_event): Handle horizontal scroll bar click events.
      (Fsuspend_emacs): When changing the size of a tty frame do not
      pass height of menu bar.
      (Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
      (Qright, Qleftmost, Qrightmost): New symbols.
      * menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
      FRAME_LINES.
      * minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
      * nsfns.m (x_set_internal_border_width): New function.
      * nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
      Remove extended fringe code.
      (x_set_window_size, x_new_font): Don't call
      compute_fringe_widths.
      * term.c (Fresume_tty): When changing the size of a tty frame do
      not pass height of menu bar.
      (clear_tty_hooks, set_tty_hooks): Clear
      horizontal_scroll_bar_hook.
      (init_tty): Frame has no horizontal scroll bars.
      * termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
      scroll_bar_before_handle, scroll_bar_horizontal_handle,
      scroll_bar_after_handle, scroll_bar_left_arrow,
      scroll_bar_right_arrow, scroll_bar_to_leftmost and
      scroll_bar_to_rightmost entries.
      (enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
      (struct terminal): Add set_horizontal_scroll_bar_hook.
      * w32console.c (initialize_w32_display): Clear
      horizontal_scroll_bar_hook.
      * w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
      FRAME_X_DISPLAY.
      (x_clear_under_internal_border, x_set_internal_border_width):
      New functions.
      (x_set_menu_bar_lines): Rewrite using frame_inhibit_resize.  Set
      windows_or_buffers_changed when adding the menu bar.
      (x_set_tool_bar_lines): Rewrite using adjust_frame_size.
      (x_change_tool_bar_height, x_set_scroll_bar_default_height)
      (w32_createhscrollbar): New functions.
      (w32_createscrollbar): Rename to w32_createvscrollbar.
      (w32_createwindow): Init WND_HSCROLLBAR_INDEX.
      (w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
      WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR.  Add
      WM_EMACS_SHOWCURSOR.
      (w32_wnd_proc): Handle WM_HSCROLL case.  In WM_WINDOWPOSCHANGING
      case do not artificially impose WM size hints.  Handle
      WM_EMACS_SHOWCURSOR case.  Replace WM_EMACS_CREATESCROLLBAR case
      by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
      cases.
      (my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
      WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
      (unwind_create_frame_1): Remove.
      (Fx_create_frame): Make both scrollbars the system standard
      width and height.  Use official field of frame structure to
      inhibit running window-configuration-change-hook.
      (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
      pixelwise.  Handle frame's official field.
      (w32_frame_parm_handlers): Remove x_set_fringe_width
      entries. Add x_set_scroll_bar_height,
      x_set_horizontal_scroll_bars, x_set_left_fringe and
      x_set_right_fringe.
      * w32inevt.c (resize_event, maybe_generate_resize_event): Do not
      pass height of menu bar to change_frame_size.
      * w32menu.c (set_frame_menubar): Rewrite using
      frame_inhibit_resize.
      * w32term.h (struct w32_display_info): Add
      horizontal_scroll_bar_cursor and cursor_display_counter.
      (struct scroll_bar): Add horizontal.
      (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
      (HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
      (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
      (HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
      (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
      (HORIZONTAL_SCROLL_BAR_TOP_BORDER)
      (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
      (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
      (WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define
      instead of WM_EMACS_CREATESCROLLBAR.
      (WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
      WND_SCROLLBAR_INDEX.
      * w32term.c (horizontal_scroll_bar_min_handle)
      (horizontal_scroll_bar_left_border)
      (horizontal_scroll_bar_right_border): New integers.
      (x_set_frame_alpha): Replace x_highlight_frame by
      w32_focus_frame.
      (x_window_to_scroll_bar): New argument "type".  Update callers
      accordingly.
      (w32_set_horizontal_scroll_bar_thumb)
      (x_horizontal_scroll_bar_report_motion)
      (w32_set_horizontal_scroll_bar)
      (w32_horizontal_scroll_bar_handle_click)
      (x_horizontal_scroll_bar_report_motion): New functions.
      (w32_mouse_position): Discriminate horizontal and vertical
      scrollbar cases.
      (my_create_scrollbar): Replace with two new functions
      my_create_vscrollbar and my_create_hscrollbar.
      (x_scroll_bar_create): New argument "horizontal".  Update
      callers accordingly.
      (x_scroll_bar_remove, w32_condemn_scroll_bars)
      (w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal
      scroll bar case.
      (w32_read_socket): Handle WM_HSCROLL cae.
      (x_new_font): Don't recompute fringe widths.  Use
      frame_inhibit_resize.  Calculate new menu bar height iff we
      build without toolkit.  Always clear under internal border.
      (x_set_window_size): Don't check frame size or recompute
      fringes.  Reset fullscreen status before applying sizes.  Always
      resize as requested by pixelwise argument.  Don't call
      do_pending_window_change.
      (x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT.
      (w32_initialize_display_info): Initialize dpyinfo's
      horizontal_scroll_bar_cursor entry.
      (w32_create_terminal): Add set_horizontal_scroll_bar_hook.
      (w32_initialize): Init horizontal_scroll_bar_min_handle and
      horizontal_scroll_bar_left_border.
      (w32fullscreen_hook): Intermittently resize window to normal
      when switching from fullscreen to maximized state.
      (run_window_configuration_change_hook): Don't run it if frame is
      not official yet.
      (unwind_change_frame): Remove.
      (Fset_window_configuration): Rewrite using frame's official field.
      * widget.c (set_frame_size): Don't call compute_fringe_widths.
      (EmacsFrameSetCharSize): Obey frame_inhibit_resize.
      * window.h (struct window): New fields old_pointm,
      horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole,
      scroll_bar_height and suspend_auto_hscroll.
      (wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type):
      New functions.
      (sanitize_window_sizes): Extern.
      (MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P)
      (WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR)
      (WINDOW_CONFIG_SCROLL_BAR_HEIGHT)
      (WINDOW_CONFIG_SCROLL_BAR_LINES)
      (WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New
      macros.
      (WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
      (WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros.
      (WINDOW_VERTICAL_SCROLL_BAR_TYPE)
      (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
      (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
      (WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite.
      (WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT)
      (WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height.
      * window.c (wset_old_pointm, Fwindow_scroll_bar_height)
      (Fwindow_old_point, sanitize_window_sizes): New functions.
      (Qwindow_sanitize_window_sizes): New symbol.
      (window_body_height): Count in horizontal scroll bar.
      (set_window_hscroll, Fscroll_left, Fscroll_right): Set
      suspend_auto_hscroll slot.
      (Fwindow_inside_edges): Count fringes pixelwise.
      (coordinates_in_window, Fcoordinates_in_window_p): Consider
      horizontal scroll bar.
      (check_frame_size, adjust_window_margins): Remove functions and
      corresponding calls.
      (set_window_buffer): Initialize old_pointm and horizontal scroll
      bars.
      (temp_output_buffer_show): Reset hscroll related fields.
      Initialize old_pointm.
      (make_parent_window): Initialize old_pointm.
      (make_window): Initialize old_pointm, horizontal scroll bar type,
      and scroll bar height.
      (resize_frame_windows): Don't count top margin in new sizes.
      Don't use safe sizes when shrinking a frame; let the window
      manager do the clipping.
      (Fsplit_window_internal): Inherit horizontal scroll bar type and
      height.
      (Fdelete_window_internal): Unchain old_pointm marker.
      (window_scroll_pixel_based, Fscroll_other_window): Adjust
      old_pointm.
      (Fwindow_text_width, Fwindow_text_height): New argument
      "pixelwise".
      (struct saved_window): New fields, old_pointm, hscroll_whole,
      suspend_auto_hscroll, scroll_bar_height and
      horizontal_scroll_bar_type.
      (Fset_window_configuration, save_window_save): Set new fields of
      saved_window.
      (apply_window_adjustment): Don't call adjust_window_margins.
      (set_window_margins): Don't change margins if new sizes don't
      fit into window.
      (set_window_scroll_bars): New argument "horizontal_type".
      Handle horizontal scroll bars.  Don't change scroll bars if they
      don't fit into window.
      (Fset_window_scroll_bars): New argument "horizontal_type".
      (Fwindow_scroll_bars): Return values for horizontal scroll bars.
      (compare_window_configurations): Compare horizontal scroll bar
      settings.
      * xdisp.c (window_text_bottom_y, window_box_height): Count in
      horizontal scroll bar height.
      (pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES
      instead of FRAME_LINES.
      (remember_mouse_glyph): Case ON_SCROLL_BAR changed to
      ON_VERTICAL_SCROLL_BAR.
      (with_echo_area_buffer): Initialize old_pointm.
      (with_echo_area_buffer_unwind_data): Store old_pointm values in
      vector.
      (unwind_with_echo_area_buffer): Handle old_pointm.
      (update_tool_bar): Set do_update when the tool bar window has at
      least one line (since this is what the user sets).
      (MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro.
      (redisplay_tool_bar): Return early when toolbar has zero lines.
      Call x_change_tool_bar_height.  Don't use max_tool_bar_height.
      (hscroll_window_tree): Handle suspension of auto_hscroll and
      old_pointm.
      (set_horizontal_scroll_bar): New function.
      (redisplay_window): Set ignore_mouse_drag_p when tool bar has
      more than one line.  Handle horizontal scroll bars.
      (note_mouse_highlight): Handle horizontal scrol bars.
      (expose_frame): Set dimensions of XRectangle from frame's text
      sizes.
      (Vvoid_text_area_pointer): Update doc-string.
      * xfns.c (x_set_menu_bar_lines): Use adjust_frame_size.
      (x_change_tool_bar_height, x_set_scroll_bar_default_height)
      (x_set_internal_border_width): New functions.
      (x_set_tool_bar_lines): Call x_change_tool_bar_height.
      (unwind_create_frame_1): Remove.
      (Fx_create_frame): Handle horizontal scroll bars.  Use official
      field of frame structure to inhibit running
      window-configuration-change-hook.
      (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
      pixelwise.  Handle frame's official field.
      (x_frame_parm_handlers): Add x_set_scroll_bar_height,
      x_set_horizontal_scroll_bars, x_set_left_fringe,
      x_set_right_fringe.
      * xmenu.c (update_frame_menubar, free_frame_menubar): Use
      adjust_frame_size.
      * xterm.h (struct x_display_info): Add
      horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar
      slots.
      (struct scroll_bar): Add horizontal slot.
      (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
      (HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
      (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros.
      (HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
      (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
      (HORIZONTAL_SCROLL_BAR_TOP_BORDER)
      (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
      (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define.
      (x_clear_under_internal_border): Remove.
      * xterm.c (XTmouse_position): Handle horizontal scroll bars.
      (x_window_to_scroll_bar): New argument TYPE.  Update callers.
      (x_send_scroll_bar_event, x_scroll_bar_create): New arguments
      HORIZONTAL.  Update callers.
      (horizontal_action_hook_id): New action hook id.
      (x_horizontal_scroll_bar_to_input_event)
      (x_create_horizontal_toolkit_scroll_bar)
      (xt_horizontal_action_hook)
      (x_set_toolkit_horizontal_scroll_bar_thumb)
      (XTset_horizontal_scroll_bar, x_net_wm_state)
      (x_horizontal_scroll_bar_report_motion): New functions.
      (xg_scroll_callback, x_scroll_bar_handle_click): Handle
      horizontal scroll bars.
      (SCROLL_BAR_HORIZONTAL_NAME): Define.
      (XTset_vertical_scroll_bar): Attempt to clear areas not covered
      by scroll bar.
      (XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite.  Handle
      horizontal scroll bars.
      (handle_one_xevent): Handle horizontal scroll bar events.  Call
      x_net_wm_state.
      (x_set_window_size_1, x_wm_set_size_hint): Don't call
      check_frame_size.
      (x_set_window_size): Don't call check_frame_size and
      do_pending_window_change.
      (x_term_init): Init horizontal_scroll_bar_cursor display info.
      (x_create_terminal): Add set_horizontal_scroll_bar_hook.
      (x_scroll_bar_set_handle): Add some checks when calling
      x_clear_area.
      3477e270