1. 05 Apr, 2020 1 commit
    • Paul Eggert's avatar
      Improve integer range checking · bec5cfee
      Paul Eggert authored
      * src/bignum.c (check_integer_range, check_uinteger_max)
      (check_int_nonnegative): New functions.
      * src/frame.c (check_frame_pixels): New function.
      (Fset_frame_height, Fset_frame_width, Fset_frame_size): Use it.
      * src/lisp.h (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER):
      Remove these macros.  Unless otherwise specified, all callers
      replaced by calls to check_integer_range, check_uinteger_range,
      check_int_nonnegative.
      * src/frame.c (gui_set_right_divider_width)
      (gui_set_bottom_divider_width):
      * src/nsfns.m (ns_set_internal_border_width):
      * src/xfns.c (x_set_internal_border_width):
      Using check_int_nonnegative means these functions no longer
      incorrectly reject negative bignums; they treat them as 0,
      just like negative fixnums.
      bec5cfee
  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. 07 Jan, 2020 1 commit
    • Paul Eggert's avatar
      Fix sxhash-equal on bytecodes, markers, etc. · 724af767
      Paul Eggert authored
      Problem reported by Pip Cet (Bug#38912#14).
      * doc/lispref/objects.texi (Equality Predicates):
      Document better when ‘equal’ looks inside objects.
      * doc/lispref/windows.texi (Window Configurations):
      Don’t say that ‘equal’ looks inside window configurations.
      * etc/NEWS: Mention the change.
      * src/fns.c (internal_equal):
      Do not look inside window configurations.
      (sxhash_obj): Hash markers, byte-code function objects,
      char-tables, and font objects consistently with Fequal.
      * src/window.c (compare_window_configurations):
      Now static.  Remove last argument.  Caller changed.
      * test/lisp/ffap-tests.el (ffap-other-window--bug-25352):
      Use compare-window-configurations, not ‘equal’.
      * test/src/fns-tests.el (test-sxhash-equal): New test.
      724af767
  4. 01 Jan, 2020 1 commit
  5. 30 Dec, 2019 1 commit
  6. 11 Dec, 2019 1 commit
  7. 09 Nov, 2019 2 commits
    • Juri Linkov's avatar
      Run scroll/recenter commands from minibuffer in original window (bug#38076) · 898cdc67
      Juri Linkov authored
      * lisp/minibuffer.el (with-minibuffer-selected-window): New macro.
      (minibuffer-recenter-top-bottom, minibuffer-scroll-up-command)
      (minibuffer-scroll-down-command, minibuffer-scroll-other-window):
      (minibuffer-scroll-other-window-down): New commands.
      (minibuffer-local-map): Remap recenter/scroll symbols to their
      minibuffer wrappers: recenter-top-bottom to minibuffer-recenter-top-bottom.
      
      * src/window.c (Fother_window_for_scrolling): Use 'lambda' value for
      MINIBUF arg of Fnext_window, so minibuffer-scroll-other-window and
      minibuffer-scroll-other-window-down doesn't try to scroll the
      minibuffer window.
      898cdc67
    • Paul Eggert's avatar
      Fix some quoting glitches in doc strings · f8284f1e
      Paul Eggert authored
      This also fixes a misplaced "only".
      f8284f1e
  8. 18 Oct, 2019 1 commit
  9. 17 Oct, 2019 1 commit
    • Juanma Barranquero's avatar
      lisp/*.el, src/*.c: Doc fixes related to returning t vs non-nil · 3ad40700
      Juanma Barranquero authored
      * lisp/progmodes/flymake-proc.el (flymake-proc--find-buffer-for-file):
      Doc fix; return value is a buffer, not t.
      
      * lisp/progmodes/ebrowse.el (ebrowse-member-display-p):
      Doc fix; return value is the MEMBER argument, not nil.
      
      * lisp/files.el (hack-one-local-variable-eval-safep):
      * lisp/play/doctor.el (doctor-nounp, doctor-pronounp):
      * lisp/progmodes/flymake-proc.el (flymake-proc--check-include):
      * lisp/progmodes/js.el (js--broken-arrow-terminates-line-p):
      Doc fix; a non-nil return value is not always t.
      
      * lisp/image.el (image-type-available-p):
      * lisp/simple.el (region-active-p):
      * lisp/window.el (frame-root-window-p):
      * src/buffer.c (Fbuffer_live_p):
      * src/image.c (Finit_image_library):
      * src/window.c (Fwindow_minibuffer_p):
      Doc fix; a non-nil return value is always t.
      
      * doc/lispref/minibuf.texi (Minibuffer Windows): Doc fix.
      3ad40700
  10. 16 Oct, 2019 1 commit
    • Martin Rudalics's avatar
      Handle top margin change in adjust_frame_size · d68e8495
      Martin Rudalics authored
      * src/frame.c (adjust_frame_size): Handle case where only
      pseudo windows changed height so the top margin has to be
      adjusted.
      * src/window.c (Fset_window_configuration): Call
      adjust_frame_size with inhibit 4.
      d68e8495
  11. 04 Oct, 2019 1 commit
    • Paul Eggert's avatar
      Minor style tweaks for recent tab changes · 81c7f3af
      Paul Eggert authored
      * src/dispextern.h (MR_PARTIALLY_VISIBLE_AT_TOP):
      * src/window.c (Fwindow_mode_line_height)
      (Fwindow_header_line_height, Fwindow_tab_line_height)
      (Fwindow_right_divider_width, Fwindow_bottom_divider_width)
      (Fwindow_scroll_bar_width, Fwindow_scroll_bar_height):
      (Fset_window_configuration, Fcurrent_window_configuration):
      Omit unnecessary parens.
      * src/dispextern.h (CURRENT_MODE_LINE_HEIGHT)
      (CURRENT_HEADER_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT):
      Add parens needed to make these macros function-like.
      * src/window.c (window_resize_check):
      * src/window.h (WINDOW_TAB_BAR_P):
      * src/xdisp.c (tab_bar_item_info): Reindent.
      * src/window.c (window_wants_mode_line)
      (window_wants_header_line, window_wants_tab_line):
      Simplify (a && b ? 1 : 0) to (a && b).
      81c7f3af
  12. 01 Oct, 2019 1 commit
  13. 23 Sep, 2019 1 commit
    • Paul Eggert's avatar
      Update some URLs · 946a56a1
      Paul Eggert authored
      This mostly changes http: to https: in URLs.  It also updates
      some URLs that have moved, removes some URLs that no longer
      work, recommends against using procmail (procmail.org no
      longer works), and removes some mentions of the
      no-longer-existing Gmane, LPF and VTW.
      It doesn't update all URLs, just the ones I had time for.
      * GNUmakefile (help):
      * admin/admin.el (manual-doctype-string):
      * admin/charsets/Makefile.in (${charsetdir}/ALTERNATIVNYJ.map):
      * admin/charsets/mapconv:
      * lisp/net/soap-client.el (soap-create-envelope):
      * lisp/org/org.el (org-doi-server-url):
      * lisp/textmodes/bibtex.el (bibtex-generate-url-list):
      Prefer https: to http: un URLs.
      946a56a1
  14. 05 Sep, 2019 1 commit
    • Juri Linkov's avatar
      Don't use hook pre-redisplay-functions. Set buffer-local tab-line-format. · 2a016475
      Juri Linkov authored
      * lisp/tab-line.el (tab-line-format): Move to C.
      (tab-line-update-window-parameter): Remove function.
      (global-tab-line-mode): Set the default value of tab-line-format.
      
      * src/buffer.c (syms_of_buffer): Define buffer-local variable
      tab-line-format.
      
      * src/buffer.h (struct buffer): Add tab_line_format_.
      
      * src/window.c (window_wants_tab_line):
      * src/xdisp.c (pos_visible_p, display_mode_lines):
      Check for buffer-local tab_line_format.
      2a016475
  15. 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
  16. 22 Jul, 2019 1 commit
    • Martin Rudalics's avatar
      Handle persistence of windows' scroll bar and fringes settings (Bug#36193) · 8e0ebb9a
      Martin Rudalics authored
      * doc/lispref/display.texi (Fringe Size/Pos): Document new
      argument PERSISTENT of 'set-window-fringes'.
      (Scroll Bars): Document new argument PERSISTENT of
      'set-window-scroll-bars'.  Mention that HORIZONTAL-TYPE must
      be 'bottom' to show a horizontal scroll bar on mini windows.
      * lisp/window.el (window-min-pixel-height): For mini windows the
      minimum height is one line.
      (window--min-size-1): Use value returned by
      'window-min-pixel-height' when dealing with mini windows.
      (window--resize-mini-window): Try to handle horizontal scroll
      bars and size restrictions more accurately.
      (window--state-put-2): Handle persistence of scroll bar
      settings.
      * src/frame.c (make_frame): Allow horizontal scroll bars in
      mini windows.
      (adjust_frame_size): Drop PIXELWISE argument in
      'resize_frame_windows' calls.
      * src/window.c (set_window_buffer): Don't override WINDOW's
      scroll bar and fringe settings when marked as persistent.
      (resize_frame_windows): Drop fourth argument PIXELWISE - SIZE
      is always specified in terms of pixels.  Try to handle height
      of mini windows more accurately.
      (grow_mini_window, shrink_mini_window): Use body height of
      mini window when calculating expected height change.  Take
      horizontal scroll bars into account.
      (struct saved_window): Two new members to handle persistence
      of window fringes and scroll bars.
      (Fset_window_configuration, save_window_save): Handle
      persistence of fringes and scroll bars.
      (set_window_fringes, set_window_scroll_bars): New arguments
      PERSISTENT.  Make dimension checks more accurate.
      (Fset_window_fringes): New argument PERSISTENT.
      (Fwindow_fringes, Fwindow_scroll_bars): Add PERSISTENT to
      return values.
      (Fset_window_scroll_bars): New argument PERSISTENT.  In
      doc-string mention that 'bottom' must be specified to get a
      horizontal scroll bar in mini windows.
      (compare_window_configurations): Add checks for persistence of
      fringes and scroll bars.
      * src/window.h (struct window): New boolean slots
      'fringes_persistent' and 'scroll_bars_persistent'.
      (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Allow horizontal scroll bars
      for mini windows.
      (resize_frame_windows): Remove fourth argument of
      'resize_frame_windows' in external declaration.
      * src/xdisp.c (resize_mini_window): Use box text height to
      tell whether mini window height changed.
      (set_horizontal_scroll_bar): Set mini window's horizontal
      scroll bar when its type is specified as 'bottom'.
      * etc/NEWS: Mention new options for 'set-window-fringes' and
      'set-window-scroll-bars'.
      8e0ebb9a
  17. 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
  18. 22 May, 2019 1 commit
    • Paul Eggert's avatar
      Remove fixnum restriction on some display vars · dfed333b
      Paul Eggert authored
      This is a minor patch to remove some fixnum restrictions.
      Many more such patches are needed, but one thing at a time.
      * doc/emacs/custom.texi (Examining): Update fill-column example.
      * src/buffer.c (fill-column, left-margin, tab-width)
      (buffer-saved-size, left-margin-width, right-margin-width)
      (left-fringe-width, right-fringe-width, scroll-bar-width)
      (scroll-bar-height, buffer-display-count):
      Allow any integer; do not restrict to fixnums.
      * src/character.h (SANE_TAB_WIDTH): Do not assume tab_width
      is a nonnegative fixnum.
      (sanitize_tab_width): Take a Lisp_Object integer, not an
      EMACS_INT.  Only use changed.
      * src/data.c (store_symval_forwarding): Remove unnecessary
      SYMBOLP since the predicate (e.g., Qintegerp) is always a
      symbol (leave the test in as an eassert).  Avoid assignments
      inside if-conditions.
      * src/fileio.c (Fdo_auto_save): Do not assume
      buffer-saved-size is a fixnum.  Avoid undefined behavior
      on EMACS_INT overflow by multiplying a fixnum by at most 4,
      not by at most 13.
      * src/window.c (set_window_buffer): When buffer-display-count
      is too large for a fixnum, make it a bignum.
      * src/xdisp.c (FILL_COLUMN_INDICATOR_NEEDED): Remove macro, ...
      (fill_column_indicator_column): ... replacing with this new function.
      All uses changed.  The function is a bit pickier, to prevent
      problems with non-character fixnums and columns out of range
      for int, and to remove the assumption that integers are in
      fixnum range.
      (append_space_for_newline, extend_face_to_end_of_line):
      Avoid undefined behavior with signed integer overflow.
      Simplify.
      dfed333b
  19. 20 May, 2019 1 commit
  20. 26 Apr, 2019 2 commits
    • Alexander Gramiak's avatar
      Rename generic x_* identifiers · a411517f
      Alexander Gramiak authored
      * src/image.c: Rename x_* procedures to image_*.
      
      * src/frame.c: Rename x_* procedures to gui_*. Rename
      xrdb_get_resource to gui_display_get_resource. Rename x_get_arg to
      gui_display_get arg.
      
      * src/frame.h: Rename can_x_set_window_size to can_set_window_size.
      
      * src/xfaces.c: Rename realize_x_face to realize_gui_face. Rename
      x_supports_face_attributes_p to gui_supports_face_attributes_p.
      
      * src/keyboard.c:
      * src/lisp.h:
      * src/nsterm.m:
      * src/w32term.c:
      * src/xterm.c: Rename x_get_keysym_name to get_keysym_name.
      
      * src/nsfns.c:
      * src/nsterm.m: Rename x_* procedures to ns_*.
      
      * src/w32fns.c:
      * src/w32term.c: Rename x_* procedures to w32_*.
      
      * src/termhooks.h (query_colors, get_focus_frame, focus_frame_hook)
      (frame_visible_invisible_hook, iconify_frame_hook)
      (set_window_size_hook, set_frame_offset_hook, set_frame_alpha_hook)
      (set_new_font_hook, set_bitmap_icon_hook, implicit_set_name_hook)
      (activate_menubar_hook, change_tool_bar_height_hook)
      (set_scroll_bar_default_width_hook)
      (set_scroll_bar_default_height_hook, get_string_resource_hook): New
      terminal hooks to replace backend-specific x_* procedures.
      
      * src/dispextern.h (clear_under_internal_border): New RIF procedure.
      
      * src/alloc.c:
      * src/frame.c:
      * src/xdisp.c: Use FRAME_OUTPUT_DATA instead of FRAME_X_OUTPUT.
      
      * src/frame.c:
      * src/w32term.c:
      * src/w32fns.c: Use FRAME_NATIVE_WINDOW instead of FRAME_X_WINDOW.
      a411517f
    • Alexander Gramiak's avatar
      Rename generic x_* procedures in xdisp.c · ff4e31fa
      Alexander Gramiak authored
      * src/xdisp.c (x_consider_frame_title, x_get_glyph_overhangs)
      (x_produce_glyphs, x_write_glyphs, x_insert_glyphs)
      (x_clear_end_of_line), x_fix_overlapping_area)
      (x_update_cursor, x_clear_cursor, x_clear_window_mouse_face)
      (x_draw_vertical_border, x_draw_right_divider, x_draw_bottom_divider)
      (x_intersect_rectangles): Rename with a gui prefix to indicate
      non-X-specific functionality.
      
      * src/composite.c:
      * src/dispextern.h:
      * src/nsfns.m:
      * src/nsterm.m:
      * src/w32fns.c:
      * src/w32term.c:
      * src/window.c:
      * src/xfns.c:
      * src/xterm.c: Use the renamed procedures.
      ff4e31fa
  21. 08 Apr, 2019 1 commit
  22. 06 Apr, 2019 1 commit
    • Eli Zaretskii's avatar
      Improve documentation of set-window-start · a30a6c30
      Eli Zaretskii authored
      * doc/lispref/windows.texi (Window Start and End):
      * src/window.c (Fset_window_start): Document that reliable
      setting of a window start position requires to adjust point to
      be visible.  (Bug#34038)
      a30a6c30
  23. 16 Mar, 2019 1 commit
  24. 13 Mar, 2019 1 commit
    • Martin Rudalics's avatar
      Document restrictions when setting window margins, fringes or scroll bars · bc75589b
      Martin Rudalics authored
      * src/window.c (Fset_window_margins, Fset_window_fringes)
      (Fset_window_scroll_bars): In doc-strings tell that a window
      must be large enough to accommodate fringes, sroll bars and
      margins of the desired size.
      * doc/lispref/display.texi (Fringe Size/Pos, Scroll Bars)
      (Display Margins): Tell that windows must be large enough to
      accommodate fringes, sroll bars and margins of the desired
      size.
      bc75589b
  25. 11 Mar, 2019 1 commit
    • Martin Rudalics's avatar
      Rewrite minibuffer window resizing code · 95373b69
      Martin Rudalics authored
      * src/frame.c (resize_mini_frames): New variable.
      * src/window.c (resize_mini_window_apply): New function.
      (grow_mini_window, shrink_mini_window): Remove PIXELWISE
      argument.  Call resize_mini_window_apply to apply changes.
      (Fresize_mini_window_internal): Call resize_mini_window_apply
      to apply changes.
      (Qwindow__resize_mini_frame): New symbol.
      * src/window.h (grow_mini_window, shrink_mini_window): Adjust
      external declarations.
      * src/xdisp.c (resize_mini_window): For minibuffer-only frames
      call 'window--resize-mini-frame' if resize_mini_frames is
      non-nil.  Offload parts of logic to grow_mini_window and
      shrink_mini_window which are now called without the PIXELWISE
      argument.
      (Vresize_mini_windows): Mention 'resize-mini-frames' in
      doc-string.
      * lisp/cus-start.el (resize-mini-frames): Add customization
      support.
      * lisp/window.el (window--resize-mini-window): Simplify code.
      (window--resize-mini-frame): New function.
      * doc/lispref/minibuf.texi (Minibuffer Windows): Describe new
      option 'resize-mini-frames'.
      * etc/NEWS: Mention new option 'resize-mini-frames'.
      95373b69
  26. 09 Mar, 2019 1 commit
    • Martin Rudalics's avatar
      Further redesign of window change functions · 4e082ce3
      Martin Rudalics authored
      * doc/lispref/windows.texi (Window Hooks): Revise description
      of window change functions.  Add documentation for
      'window-state-change-hook' and window state change flag.
      * etc/NEWS: Update entry for window change functions.
      * src/frame.c (Fframe_window_state_change)
      (Fset_frame_window_state_change): New functions.
      * src/frame.h (struct frame): New boolean window_state_change.
      (FRAME_WINDOW_STATE_CHANGE): New macro.
      * src/window.c (window_change_record_frames): New static
      boolean.
      (window_change_record_frame): Remove function - code moved to
      window_change_record.
      (window_change_record): Record frame changes here taking
      window_change_record_frames into account.
      (run_window_change_functions_1): Set window_change_record_frames
      whenever we run one of our hooks.
      (run_window_change_functions): Run hooks also when
      FRAME_WINDOW_STATE_CHANGE has been set.  Run
      Vwindow_state_change_hook.  Leave decision whether to record
      changes for all frames to window_change_record.
      (Vwindow_state_change_functions): Update doc-string.
      (Vwindow_state_change_hook): New normal hook.
      4e082ce3
  27. 06 Mar, 2019 1 commit
  28. 04 Mar, 2019 1 commit
    • Paul Eggert's avatar
      Simplify list creation in C code · 5c2563a5
      Paul Eggert authored
      The main new thing here is that C code can now say
      ‘list (a, b, c, d, e, f)’ instead of
      ‘listn (CONSTYPE_HEAP, 6, a, b, c, d, e, f)’,
      thus relieving callers of the responsibility of counting
      arguments (plus, the code feels more like Lisp).  The old
      list1 ... list5 functions remain, as they’re probably a bit
      faster for small lists.
      * src/alloc.c (cons_listn, pure_listn): New functions.
      (listn): Omit enum argument.
      All callers changed to use either new ‘list’ or ‘pure_list’ macros.
      * src/charset.c (Fdefine_charset_internal):
      * src/coding.c (detect_coding_system)
      (Fset_terminal_coding_system_internal):
      * src/frame.c (frame_size_history_add, adjust_frame_size):
      * src/gtkutil.c (xg_frame_set_char_size):
      * src/keyboard.c (command_loop_1):
      * src/nsfns.m (frame_geometry):
      * src/widget.c (set_frame_size):
      * src/xfaces.c (Fcolor_distance):
      * src/xfns.c (frame_geometry):
      * src/xterm.c (x_set_window_size_1):
      * src/xwidget.c (Fxwidget_size_request):
      Prefer list1i, list2i, etc. to open-coding them.
      * src/charset.c (Fset_charset_priority):
      * src/nsterm.m (append2):
      * src/window.c (window_list):
      * src/xfaces.c (Fx_list_fonts):
      Use nconc2 instead of open-coding it.
      * src/eval.c (eval_sub, backtrace_frame_apply):
      * src/kqueue.c (kqueue_generate_event):
      * src/nsterm.m (performDragOperation:):
      * src/pdumper.c (Fpdumper_stats):
      * src/w32.c (init_environment):
      Prefer list1, list2, etc. to open-coding them.
      * src/font.c (font_list_entities):
      Parenthesize to avoid expanding new ‘list’ macro.
      * src/gtkutil.c (GETSETUP): Rename from MAKE_FLOAT_PAGE_SETUP
      to get lines to fit.  Move outside the ‘list’ call, since it’s
      now a macro.
      * src/keymap.c (Fmake_keymap): Simplify.
      * src/lisp.h (list, pure_list): New macros.
      (list1i): New function.
      5c2563a5
  29. 27 Feb, 2019 1 commit
    • Paul Eggert's avatar
      DEFVAR_INT variables are now intmax_t · e828765d
      Paul Eggert authored
      Formerly they were fixnums, which led to problems when dealing
      with values that might not fit on 32-bit platforms, such as
      string-chars-consed or floats_consed.  64-bit counters should
      be good enough for these (for a while, anyway...).
      While we’re at it, fix some unlikely integer overflow bugs
      that have been in the code for a while.
      * lib-src/make-docfile.c (write_globals):
      * src/data.c (do_symval_forwarding, store_symval_forwarding):
      * src/eval.c (restore_stack_limits, call_debugger):
      * src/frame.h (struct frame.cost_calculation_baud_rate):
      * src/keyboard.c (last_auto_save, bind_polling_period, read_char):
      * src/lisp.h (struct Lisp_Intfwd.intvar):
      * src/lread.c (defvar_int):
      * src/pdumper.c (dump_fwd_int):
      * src/thread.h (struct thread_state.m_lisp_eval_depth):
      * src/undo.c (truncate_undo_list):
      * src/xselect.c (wait_for_property_change)
      (x_get_foreign_selection):
      * src/xterm.c (x_emacs_to_x_modifiers):
      DEFVAR_INT variables now have the C type intmax_t, not EMACS_INT.
      * src/data.c (store_symval_forwarding):
      * src/gnutls.c (Fgnutls_boot):
      * src/keyboard.c (bind_polling_period):
      * src/macros.c (pop_kbd_macro, Fexecute_kbd_macro):
      * src/undo.c (truncate_undo_list):
      Allow any integer that fits into intmax_t, instead of
      requiring it to be a Lisp fixnum.
      * src/dispnew.c (update_window):
      * src/frame.c (x_figure_window_size):
      * src/gnutls.c (init_gnutls_functions)
      (emacs_gnutls_handle_error):
      * src/keyboard.c (make_lisp_event):
      * src/nsterm.m (ns_dumpglyphs_image):
      * src/profiler.c (make_log):
      * src/scroll.c (calculate_scrolling)
      (calculate_direct_scrolling):
      * src/termcap.c (tputs):
      * src/xterm.c (x_draw_image_relief):
      Avoid implementation-defined behavior on conversion of
      out-of-range integers.
      * src/eval.c (when_entered_debugger): Now intmax_t.
      (max_ensure_room): New function, that avoids signed integer overflow.
      (call_debugger, signal_or_quit): Use it.
      * src/fileio.c (Fdo_auto_save):
      * src/keyboard.c (make_lisp_event):
      * src/term.c (calculate_costs):
      * src/xdisp.c (build_desired_tool_bar_string)
      (hscroll_window_tree, try_scrolling, decode_mode_spec)
      (x_produce_glyphs):
      Avoid signed integer overflow.
      * src/lisp.h (clip_to_bounds): Generalize to intmax_t.
      * src/pdumper.c (dump_emacs_reloc_immediate_emacs_int): Remove, ...
      (dump_emacs_reloc_immediate_intmax_t): ... replacing with this
      function.  All uses changed.
      * src/profiler.c (make_log): Omit args.  All callers changed.
      * src/termcap.c: Include stdlib.h, for atoi.
      Include intprops.h.
      * src/window.c (sanitize_next_screen_context_lines): New function.
      (window_scroll_pixel_based, window_scroll_line_based):
      Use it to avoid signed integer overflow.
      e828765d
  30. 02 Feb, 2019 1 commit
    • Martin Rudalics's avatar
      Fix bugs caused by running window change functions during redisplay · dc1d2d3c
      Martin Rudalics authored
      * src/xdisp.c (redisplay_internal): Run window change
      functions before updating the display so changes induced by
      these functions can get caught by redisplay (Bug#34138).
      * src/window.c (run_window_change_functions): Bind
      Qinhibit_redisplay to avoid that the minibuffer window gets
      resized while running window change functions (Bug#34179,
      Bug#34260).
      dc1d2d3c
  31. 31 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Prefer static to extern where either will do · 47679e63
      Paul Eggert authored
      * src/charset.c (charset_table_size):
      * src/pdumper.c (dump_private):
      * src/sysdep.c (init_sigsegv):
      * src/window.c (old_selected_window):
      Now static.
      * src/charset.c (charset_table_size):
      Now int, since the value always fits in int.
      * src/gtkutil.c (xg_gtk_initialized): Now present only if
      HAVE_XWIDGETS, to make it clearer that this is an xwidgets
      hack.  All uses changed.
      * src/lread.c (ndefsubr): Remove; unused.
      * src/pdumper.h: Use usual GNU indenting style for functions,
      since my static-vs-extern checking hack relies on it.
      (dump_public): Always declare; simpler and doesn’t hurt.
      (pdumper_handle_page_fault): Remove unused decl.
      47679e63
  32. 17 Jan, 2019 1 commit
    • Martin Rudalics's avatar
      Expand spectrum of window change functions · 0aece3e1
      Martin Rudalics authored
      * src/window.c (run_window_change_functions): Run window
      change functions for Qwindow_state_change_functions.
      (resize_frame_windows): Set frame's window_change slot when
      single-window frames change size.
      (Qwindow_state_change_functions): New symbol.
      (Vwindow_state_change_functions): New Lisp variable.
      * doc/lispref/windows.texi (Selecting Windows): Mention
      'window-selection/state-change-functions' and add reference to
      Window Hooks.
      (Window Hooks): Document 'window-state-change-functions'.
      * etc/NEWS: Mention new hook 'window-state-change-functions'.
      0aece3e1
  33. 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
  34. 11 Jan, 2019 1 commit
    • Martin Rudalics's avatar
      Run window change functions during redisplay · e567ac14
      Martin Rudalics authored
      * doc/lispref/windows.texi (Window Sizes): Move (and rename)
      descriptions of 'window-pixel-height-before-size-change' and
      'window-pixel-width-before-size-change' to Window Hooks
      section.
      (Window Configurations): Remove warning against use of
      'save-window-excursion' in 'window-size-change-functions'.
      (Window Hooks): Rewrite section according to redesign of
      window change functions.
      * lisp/erc/erc-track.el (erc-window-configuration-change)
      (erc-modified-channels-update): Call latter directly from
      'window-configuration-change-hook' instead via
      'post-command-hook'.
      * lisp/frame.el (frame-size-changed-p): Change nomenclature
      in let bindings.
      * lisp/net/rcirc.el (rcirc-window-configuration-change)
      (rcirc-window-configuration-change-1): Call latter directly
      from 'window-configuration-change-hook' instead via
      'post-command-hook'.
      * lisp/window.el (window-pixel-width-before-size-change)
      (window-pixel-height-before-size-change): Defalias.
      (window--resize-mini-window, window-resize)
      (adjust-window-trailing-edge, delete-window)
      (delete-other-windows, balance-windows): Don't run
      'window-configuration-change-hook' any more from here.
      (split-window): Don't run 'window-configuration-change-hook'
      from here.  'run-window-scroll-functions' from here.
      (window--adjust-process-windows): Run from
      'window-configuration-change-hook' only.
      * src/frame.c (old_selected_frame): New Lisp variable.
      (make_frame): Initialize frame's change_stamp slot.
      (Fold_selected_frame): New function.
      * src/frame.h (struct frame): New slots old_selected_window,
      window_change, change_stamp and number_of_windows.
      (fset_old_selected_window): New inlined function.
      (FRAME_WINDOW_CHANGE, FRAME_OLD_SELECTED_WINDOW): New macros.
      * src/window.c (old_selected_window): New Lisp variable.
      (wset_old_buffer): New inlined function.
      (Fframe_old_selected_window, Fold_selected_window)
      (Fwindow_old_buffer): New functions.
      (Fwindow_old_pixel_width, Fwindow_old_pixel_height): Rename
      from Fwindow_pixel_width_before_size_change and
      Fwindow_pixel_height_before_size_change.  Update doc-strings.
      (Fwindow_old_body_pixel_width, Fwindow_old_body_pixel_height):
      New functions.
      (Fdelete_other_windows_internal): Set frame's window_change
      slot instead of running 'window-configuration-change-hook'.
      (Frun_window_configuration_change_hook): In doc-string tell
      that this function is no more needed.
      (Frun_window_scroll_functions): Amend doc-string.  Run with
      window's buffer current.
      (window_sub_list, window_change_record_windows)
      (window_change_record_frame, window_change_record)
      (run_window_change_functions_1, run_window_change_functions):
      New functions.
      (set_window_buffer): Set frame's window_change slot instead of
      running 'window-configuration-change-hook'.
      (make_window): Don't initialize pixel_width_before_size_change
      and pixel_height_before_size_change slots.
      (window_resize_apply, Fdelete_window_internal): Set frame's
      window_change slot.
      (Fsplit_window_internal): Set frame's window_change slot.
      Don't run 'window-scroll-functions' from here.
      * src/window.h (struct window): New slots old_buffer,
      change_stamp, old_pixel_width (renamed from
      pixel_width_before_size_change), old_pixel_height (renamed
      from pixel_height_before_size_change), old_body_pixel_width
      and old_body_pixel_height.
      * src/xdisp.c (init_iterator): Set frame's window_change slot
      when the body height or width changes.
      (prepare_menu_bars): Don't run_window_size_change_functions.
      (redisplay_internal): Don't run_window_size_change_functions,
      run_window_change_functions instead.
      e567ac14
  35. 08 Jan, 2019 1 commit
  36. 04 Jan, 2019 1 commit
  37. 01 Jan, 2019 1 commit
  38. 30 Dec, 2018 1 commit