1. 04 Aug, 2020 1 commit
    • Paul Eggert's avatar
      Simplify use of __lsan_ignore_object · a1436544
      Paul Eggert authored
      * configure.ac: Use AC_CHECK_FUNCS_ONCE for __lsan_ignore_object.
      * src/buffer.c, src/data.c, src/emacs-module.c, src/regex-emacs.c:
      * src/search.c: Use __lsan_ignore_object unconditionally, and don’t
      include sanitizer/lsan_interface.h.
      * src/lisp.h (__lsan_ignore_object): Provide a dummy in the
      typical case where leak sanitization is not available.
      a1436544
  2. 01 Aug, 2020 2 commits
    • Philipp Stephani's avatar
      Use a more precise check for '__lsan_ignore_object' · 06310cf9
      Philipp Stephani authored
      * configure.ac: Add check for __lsan_ignore_object.
      
      * src/buffer.c (enlarge_buffer_text):
      * src/data.c (make_blv):
      * src/emacs-module.c (Fmodule_load, initialize_environment):
      * src/regex-emacs.c (regex_compile):
      * src/search.c (newline_cache_on_off): Use new configuration macro.
      06310cf9
    • Philipp Stephani's avatar
      Suppress leak detector in some cases · c3b53559
      Philipp Stephani authored
      We intentionally leak some objects.  Prevent the ASan leak detector
      from raising false alarms in these cases.
      
      * configure.ac: Search for lsan_interface.h header.
      
      * src/data.c (make_blv): Allow leaking of buffer-local values.
      
      * src/buffer.c (enlarge_buffer_text): Allow leaking of buffer text.
      
      * src/emacs-module.c (Fmodule_load, initialize_environment): Allow
      intentional leak of runtime and environment objects if module
      assertions are enabled.
      c3b53559
  3. 18 May, 2020 1 commit
    • Glenn Morris's avatar
      Restore buffer-undo-list to buffer-local-variables · 86594a3d
      Glenn Morris authored
      It has been missing since 2012-07-03 (Emacs 24.3)
      "Cleanup basic buffer management", when undo_list was moved to
      the end of struct buffer.  (Bug#33492)
      * src/buffer.c (buffer_local_variables_1): New function.
      (Fbuffer_local_variables): Explicitly add buffer-undo-list.
      86594a3d
  4. 21 Apr, 2020 1 commit
    • Paul Eggert's avatar
      Fix string-to-multibyte overlong sequence bug · c88a3be8
      Paul Eggert authored
      * src/character.h (MULTIBYTE_LENGTH, MULTIBYTE_LENGTH_NO_CHECK):
      Remove, replacing with ...
      (multibyte_length): ... this new function.  All callers changed.
      The new function rejects overlong multibyte forms.
      * test/src/buffer-tests.el (buffer-multibyte-overlong-sequences):
      New test.
      c88a3be8
  5. 17 Apr, 2020 1 commit
    • Paul Eggert's avatar
      Prefer more inline functions in character.h · 27d10183
      Paul Eggert authored
      * src/buffer.h (fetch_char_advance, fetch_char_advance_no_check)
      (buf_next_char_len, next_char_len, buf_prev_char_len)
      (prev_char_len, inc_both, dec_both): New inline functions,
      replacing the old character.h macros FETCH_CHAR_ADVANCE,
      FETCH_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS, INC_POS, BUF_DEC_POS,
      DEC_POS, INC_BOTH, DEC_BOTH respectively.  All callers changed.
      These new functions all assume buffer primitives and so need
      to be here rather than in character.h.
      * src/casefiddle.c (make_char_unibyte): New static function,
      replacing the old MAKE_CHAR_UNIBYTE macro.  All callers changed.
      (do_casify_unibyte_string): Use SINGLE_BYTE_CHAR_P instead
      of open-coding it.
      * src/ccl.c (GET_TRANSLATION_TABLE): New static function,
      replacing the old macro of the same name.
      * src/character.c (string_char): Omit 2nd arg.  3rd arg can no
      longer be NULL.  All callers changed.
      * src/character.h (SINGLE_BYTE_CHAR_P): Move up.
      (MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE, PREV_CHAR_BOUNDARY)
      (STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE)
      (FETCH_STRING_CHAR_ADVANCE)
      (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
      (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE)
      (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH)
      (DEC_BOTH, BUF_INC_POS, BUF_DEC_POS): Remove.
      (make_char_multibyte): New static function, replacing
      the old macro MAKE_CHAR_MULTIBYTE.  All callers changed.
      (CHAR_STRING_ADVANCE): Remove; all callers changed to use
      CHAR_STRING.
      (NEXT_CHAR_BOUNDARY): Remove; it was unused.
      (raw_prev_char_len): New inline function, replacing the
      old PREV_CHAR_BOUNDARY macro.  All callers changed.
      (string_char_and_length): New inline function, replacing the
      old STRING_CHAR_AND_LENGTH macro.  All callers changed.
      (STRING_CHAR): Rewrite in terms of string_char_and_length.
      (string_char_advance): New inline function, replacing the old
      STRING_CHAR_ADVANCE macro.  All callers changed.
      (fetch_string_char_advance): New inline function, replacing the
      old FETCH_STRING_CHAR_ADVANCE macro.  All callers changed.
      (fetch_string_char_as_multibyte_advance): New inline function,
      replacing the old FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE macro.
      All callers changed.
      (fetch_string_char_advance_no_check): New inline function,
      replacing the old FETCH_STRING_CHAR_ADVANCE_NO_CHECK macro.  All
      callers changed.
      * src/regex-emacs.c (HEAD_ADDR_VSTRING): Remove; no longer used.
      * src/syntax.c (scan_lists): Use dec_bytepos instead of
      open-coding it.
      * src/xdisp.c (string_char_and_length): Rename from
      string_char_and_length to avoid name conflict with new function in
      character.h.  All callers changed.
      27d10183
  6. 03 Apr, 2020 1 commit
  7. 31 Mar, 2020 1 commit
    • Stefan Monnier's avatar
      Remove `all_buffers` and the associated `next` field of buffers · cddf85d2
      Stefan Monnier authored
      * src/alloc.c (enum mem_type): Remove MEM_TYPE_BUFFER.
      (allocate_buffer): Allocate like any other pseudovector.
      Don't register on `all_buffers` any more.
      (live_buffer_holding, live_buffer_p): Delete functions.
      (mark_maybe_object, valid_lisp_object_p): Don't pay attention to
      MEM_TYPE_BUFFER any more.
      (garbage_collect): Only compact the live buffers.
      (mark_buffer): Mark the undo_list of dead buffers here.
      (mark_object): Buffers are normal pseudovectors now.
      (sweep_buffers): Don't do the actual sweep here, just cleanup the
      markers and only for live buffers.
      
      * src/buffer.c (all_buffers): Remove variable.
      (Fkill_buffer): Don't check indirect dead buffers.
      Set the undo_list before we remove ourselves from the list of live buffers.
      (Fbuffer_swap_text, Fset_buffer_multibyte): Don't check indirect dead
      buffers.
      (init_buffer_once): Don't set `all_buffers`.
      (init_buffer): Don't map new memory for dead buffers.
      
      * src/buffer.h (struct buffer): Remove `next` field.
      (FOR_EACH_BUFFER): Remove macro.
      
      * src/pdumper.c (dump_buffer): Don't dump the `next` field.
      cddf85d2
  8. 30 Mar, 2020 1 commit
  9. 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
  10. 07 Feb, 2020 1 commit
    • Zajcev Evgeny's avatar
      Support for (box . SIZE) 'cursor-type' · 63fd6c9e
      Zajcev Evgeny authored
      This allows control of the minimum size of a masked image under
      which the box cursor becomes hollow.
      * buffer.c (cursor-type): Add commentary about (box . SIZE)
      'cursor-type'.
      * xdisp.c (get_specified_cursor_type): Check for 'cursor-type'
      of the form (box . SIZE).
      (get_window_cursor_type): Check masked image size for
      (box . SIZE) 'cursor-type'.
      
      * doc/emacs/display.texi (Cursor Display):
      * doc/emacs/display.texi (Cursor Parameters): Add description
      of (box . SIZE) 'cursor-type'.
      
      * etc/NEWS: Mention the new (box . SIZE) 'cursor-type'.
      63fd6c9e
  11. 01 Jan, 2020 1 commit
  12. 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
  13. 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
  14. 04 Sep, 2019 1 commit
    • Paul Eggert's avatar
      Take last_per_buffer_idx private · 97cfda26
      Paul Eggert authored
      This will simplify future changes.  Turn the runtime check
      into an eassert, since it’s not needed in production.
      * src/buffer.c (last_per_buffer_idx): Now static.
      (valid_per_buffer_idx): New function.
      * src/buffer.h (PER_BUFFER_VALUE_P, SET_PER_BUFFER_VALUE_P): Use it.
      97cfda26
  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 Aug, 2019 1 commit
  17. 13 Jul, 2019 3 commits
  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. 07 May, 2019 1 commit
    • Stefan Monnier's avatar
      * src/marker.c (buf_bytepos_to_charpos): Re-add the CHAR_HEAD_P assertion · 32cf0781
      Stefan Monnier authored
      This assertion was removed in 1c349c62
      because the assumption was invalid during set_intervals_multibyte_1.
      So we change set_intervals_multibyte_1 to solve the problem in the same
      way as in the rest of Fset_buffer_multibyte, which actually simplifies
      the code.
      
      * src/buffer.c (advance_to_char_boundary): Not static any more.
      * src/buffer.h (advance_to_char_boundary): Add prototype.
      * src/intervals.c (set_intervals_multibyte_1): Use it.
      32cf0781
  20. 06 Apr, 2019 2 commits
  21. 01 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Fix union Lisp_Fwd * alignment bug · 9287813d
      Paul Eggert authored
      It's not portable to cast (e.g.) struct Lisp_Objfwd * to union
      Lisp_Fwd * and then back again, because the compiler can then assume
      that the pointer is aligned for union Lisp_Fwd * when accessing
      the struct Lisp_Objfwd * components, and this assumption might
      be incorrect becase we don't force that alignment.
      * src/lisp.h (lispfwd): New type, replacing ...
      (union Lisp_Fwd): ... this type, which was removed.
      All uses changed.
      (SET_SYMBOL_FWD): 2nd arg is now void *, not lispfwd.
      All uses changed (casts no longer needed; they were
      not portable anyway).
      9287813d
  22. 30 Mar, 2019 2 commits
    • Eli Zaretskii's avatar
      Fix a thinko in a recent commit · dd7d83e1
      Eli Zaretskii authored
      * src/buffer.c (Fkill_buffer): Fix last change.  (Bug#31138)
      Reported by Mattias Engdegård <mattiase@acm.org>.
      dd7d83e1
    • Eli Zaretskii's avatar
      Don't run buffer-related hooks in " *code conversion work*" buffers · 9c0fa117
      Eli Zaretskii authored
      Note: portions of this change were mistakenly pushed as part
      of an unrelated commit a35a1f6a.
      
      * src/buffer.c (Fget_buffer_create): Set inhibit_buffer_hooks
      non-zero for temporary buffers created by coding.c.  Don't run
      buffer-list-update-hook for such buffers.
      (Frename_buffer, Fkill_buffer, record_buffer)
      (Fbury_buffer_internal): Don't run hooks for buffers whose
      inhibit_buffer_hooks flag is set.
      * src/buffer.h (struct buffer): New member
      inhibit_buffer_hooks.
      * src/pdumper.c (dump_buffer): Dump the new field.  Update the
      hash value in HASH_buffer_XXX.
      * src/coding.c (make_conversion_work_buffer): Function deleted;
      code moved to code_conversion_save.
      (code_conversion_save): Insert code from
      make_conversion_work_buffer, but arrange for unwind-protecting
      the current buffer before switching to the work buffer.  This
      avoids leaving reused_workbuf_in_use set if user presses C-g
      during encoding/decoding.
      (Vcode_conversion_workbuf_name): Now external variable.
      * src/coding.h (Vcode_conversion_reused_workbuf): Declare.
      9c0fa117
  23. 08 Mar, 2019 1 commit
  24. 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
  25. 31 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Widen modiff counts to avoid wraparound · 05d2fc71
      Paul Eggert authored
      Widen modification counts to at least 64 bits, to make
      wraparound practically impossible.
      * doc/lispref/buffers.texi (Buffer Modification):
      Don’t say the modification-count can wrap around.
      * src/buffer.c (Frestore_buffer_modified_p, Fbuffer_swap_text)
      (modify_overlay):
      * src/insdel.c (insert_1_both, insert_from_string_1)
      (insert_from_gap, insert_from_buffer_1)
      (adjust_after_replace, replace_range, replace_range_2)
      (del_range_2, modify_text):
      * src/textprop.c (modify_text_properties):
      Use modiff_incr instead of incrementing	directly.
      (Fbuffer_modified_tick, Fbuffer_chars_modified_tick):
      Don’t assume modification counts fit into fixnums.
      * src/buffer.h (struct buffer_text, struct buffer):
      * src/cmds.c (internal_self_insert):
      * src/fileio.c (Finsert_file_contents):
      * src/indent.c (last_known_column_modified):
      * src/keyboard.c (command_loop_1):
      * src/marker.c (cached_modiff):
      * src/syntax.c (find_start_modiff, parse_sexp_propertize)
      (find_defun_start):
      * src/window.h (struct window):
      Use modiff_count for modification counts.
      * src/editfns.c (Fsubst_char_in_region):
      Copy instead of incrementing modification counts,
      since integer overflow checking is not needed here.
      * src/lisp.h (modiff_count): New type.
      (modiff_incr, modiff_to_integer): New inline functions.
      * src/pdumper.c (dump_buffer): Update hash.
      05d2fc71
  26. 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
  27. 01 Jan, 2019 1 commit
  28. 22 Dec, 2018 1 commit
    • Michael Albinus's avatar
      Use "file name handler" consequently · 88b41c40
      Michael Albinus authored
      * doc/lispref/files.texi:
      * doc/lispref/processes.texi:
      * doc/misc/ediff.texi:
      * lisp/simple.el:
      * lisp/vc/ediff-ptch.el:
      * src/buffer.c:
      * src/dired.c:
      * src/fileio.c:
      * src/image.c:
      * src/insdel.c:
      * src/w32fns.c: Use "file name handler" consequently.
      88b41c40
  29. 09 Dec, 2018 1 commit
    • Paul Eggert's avatar
      Add make_vector and make_nil_vector · d79bb756
      Paul Eggert authored
      This makes the callers a bit easier to read, and doubtless
      improves efficiency very slightly.  It also simplifies
      possible future changes to allow bignum indexes to buffers.
      * src/alloc.c (allocate_vectorlike):
      Prefer ptrdiff_t to size_t when either will do.
      (make_vector): New function.
      (Fmake_vector): Use it.
      * src/buffer.c (syms_of_buffer):
      * src/bytecode.c (syms_of_bytecode):
      * src/category.c (Fmake_category_table, init_category_once):
      * src/ccl.c (syms_of_ccl):
      * src/character.c (syms_of_character):
      * src/charset.c (Fdefine_charset_internal)
      (Ffind_charset_region, Ffind_charset_string):
      * src/chartab.c (copy_char_table):
      * src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
      * src/composite.c (get_composition_id, Fcomposition_get_gstring):
      * src/composite.h (LGLYPH_NEW):
      * src/fns.c (concat, Flocale_info, make_hash_table):
      * src/font.c (font_otf_ValueRecord, font_otf_anchor)
      (build_style_table, syms_of_font):
      * src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
      (dump_fontset, syms_of_fontset):
      * src/image.c (xpm_make_color_table_v):
      * src/keyboard.c (modify_event_symbol, menu_bar_items)
      (parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
      (syms_of_keyboard):
      * src/keymap.c (Fdefine_key, describe_map, describe_vector):
      * src/lread.c (read_vector):
      * src/macfont.m (macfont_shape):
      * src/menu.c (init_menu_items):
      * src/nsfns.m (ns_make_monitor_attribute_list):
      * src/process.c (conv_sockaddr_to_lisp, network_interface_info):
      * src/profiler.c (make_log):
      * src/window.c (Fcurrent_window_configuration):
      * src/xdisp.c (with_echo_area_buffer_unwind_data)
      (format_mode_line_unwind_data):
      * src/xfaces.c (Finternal_make_lisp_face)
      (Fface_attributes_as_vector):
      * src/xfns.c (x_make_monitor_attribute_list)
      (Fx_display_monitor_attributes_list):
      * src/xfont.c (syms_of_xfont):
      * src/xselect.c (x_handle_dnd_message):
      * src/xwidget.c (save_script_callback):
      Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
      * src/callint.c (Fcall_interactively):
      * src/charset.c (load_charset_map):
      * src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
      * src/composite.c (get_composition_id)
      * src/dispnew.c (Fframe_or_buffer_changed_p)
      (syms_of_display):
      * src/fns.c (make_hash_table, maybe_resize_hash_table):
      * src/font.c (font_style_to_value):
      * src/fontset.c (FONTSET_ADD, fontset_add):
      * src/json.c (json_to_lisp):
      * src/keymap.c (syms_of_keymap):
      * src/lread.c (init_obarray):
      * src/profiler.c (make_log, Fprofiler_cpu_log):
      * src/term.c (term_get_fkeys_1):
      Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
      * src/font.c (build_style_table):
      * src/macfont.m (macfont_shape):
      * src/process.c (conv_sockaddr_to_lisp, network_interface_info):
      Prefer make_uninit_vector if the vector will be initialized soon.
      * src/lisp.h (make_nil_vector): New function.
      d79bb756
  30. 13 Nov, 2018 1 commit
    • Paul Eggert's avatar
      Act like POSIX sh if $HOME is relative · 90027650
      Paul Eggert authored
      POSIX says sh ~/foo should act like $HOME/foo even if $HOME is
      relative, so be consistent with that (Bug#33255).
      * admin/merge-gnulib (GNULIB_MODULES): Add dosname.
      * src/buffer.c (init_buffer): Use emacs_wd to get
      initial working directory with slash appended if needed.
      (default-directory): Say it must be absolute.
      * src/emacs.c (emacs_wd): New global variable.
      (init_cmdargs): Dir arg is now char const *.
      (main): Set emacs_wd.
      * src/emacs.c (main) [NS_IMPL_COCOA]:
      * src/fileio.c (Fexpand_file_name):
      Use get_homedir instead of egetenv ("HOME").
      * src/fileio.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME.
      (splice_dir_file, get_homedir): New functions.
      * src/xrdb.c (gethomedir): Remove.  All callers changed
      to use get_homedir and splice_dir_file.
      * test/src/fileio-tests.el (fileio-tests--relative-HOME): New test.
      90027650
  31. 14 Oct, 2018 1 commit
  32. 24 Sep, 2018 1 commit
    • Paul Eggert's avatar
      file-attributes cleanup · 662bee7d
      Paul Eggert authored
      Mostly, this replaces magic-number calls like (nth 4 A) with
      more-informative calls like (file-attribute-access-time A).
      It also fixes some documentation and minor timestamp coding
      issues that I noticed while looking into this.
      * doc/lispref/files.texi (File Attributes):
      * lisp/files.el (file-attribute-size)
      (file-attribute-inode-number, file-attribute-device-number):
      * src/dired.c (Fdirectory_files_and_attributes)
      (Ffile_attributes):
      Mention which attributes must be integers, or nonnegative integers,
      as opposed to merely being numbers.  Remove no-longer-correct
      talk about representing large integers as conses of integers.
      * doc/lispref/files.texi (Magic File Names):
      * doc/misc/gnus.texi (Low-level interface to the spam-stat dictionary):
      * lisp/autorevert.el (auto-revert-find-file-function)
      (auto-revert-tail-mode, auto-revert-handler):
      * lisp/auth-source.el (auth-source-netrc-parse):
      * lisp/cedet/ede/files.el (ede--inode-for-dir):
      * lisp/cedet/semantic/db-file.el (object-write):
      * lisp/cedet/semantic/db-mode.el (semanticdb-kill-hook):
      * lisp/cedet/semantic/db.el (semanticdb-needs-refresh-p)
      (semanticdb-synchronize):
      * lisp/cedet/srecode/table.el (srecode-mode-table-new):
      * lisp/desktop.el (desktop-save, desktop-read):
      * lisp/dired-aux.el (dired-file-set-difference)
      (dired-do-chxxx, dired-do-chmod, dired-copy-file-recursive)
      (dired-create-files):
      * lisp/dired.el (dired-directory-changed-p, dired-readin):
      * lisp/dos-w32.el (w32-direct-print-region-helper):
      * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads)
      (autoload-find-destination, update-directory-autoloads):
      * lisp/emacs-lisp/shadow.el (load-path-shadows-same-file-or-nonexistent):
      * lisp/epg.el (epg--start, epg-wait-for-completion):
      * lisp/eshell/em-ls.el (eshell-ls-filetype-p)
      (eshell-ls-applicable, eshell-ls-size-string)
      (eshell-ls-file, eshell-ls-dir, eshell-ls-files)
      (eshell-ls-entries):
      * lisp/eshell/em-pred.el (eshell-predicate-alist)
      (eshell-pred-file-type, eshell-pred-file-links)
      (eshell-pred-file-size):
      * lisp/eshell/em-unix.el (eshell-shuffle-files, eshell/cat)
      (eshell-du-sum-directory, eshell/du):
      * lisp/eshell/esh-util.el (eshell-read-passwd)
      (eshell-read-hosts):
      * lisp/files.el (remote-file-name-inhibit-cache)
      (find-file-noselect, insert-file-1, dir-locals-find-file)
      (dir-locals-read-from-dir, backup-buffer)
      (file-ownership-preserved-p, copy-directory)
      (read-file-modes):
      * lisp/find-lisp.el (find-lisp-format):
      * lisp/gnus/gnus-agent.el (gnus-agent-unfetch-articles)
      (gnus-agent-read-agentview, gnus-agent-expire-group-1)
      (gnus-agent-request-article, gnus-agent-regenerate-group)
      (gnus-agent-update-files-total-fetched-for)
      (gnus-agent-update-view-total-fetched-for):
      * lisp/gnus/gnus-cache.el (gnus-cache-read-active)
      (gnus-cache-update-file-total-fetched-for)
      (gnus-cache-update-overview-total-fetched-for):
      * lisp/gnus/gnus-cloud.el (gnus-cloud-file-new-p):
      * lisp/gnus/gnus-score.el (gnus-score-score-files):
      * lisp/gnus/gnus-start.el (gnus-save-newsrc-file)
      (gnus-master-read-slave-newsrc):
      * lisp/gnus/gnus-sum.el (gnus-summary-import-article):
      * lisp/gnus/gnus-util.el (gnus-file-newer-than)
      (gnus-cache-file-contents):
      * lisp/gnus/mail-source.el (mail-source-delete-old-incoming)
      (mail-source-callback, mail-source-movemail):
      * lisp/gnus/nneething.el (nneething-create-mapping)
      (nneething-make-head):
      * lisp/gnus/nnfolder.el (nnfolder-read-folder):
      * lisp/gnus/nnheader.el (nnheader-file-size)
      (nnheader-insert-nov-file):
      * lisp/gnus/nnmail.el (nnmail-activate):
      * lisp/gnus/nnmaildir.el (nnmaildir--group-maxnum)
      (nnmaildir--new-number, nnmaildir--update-nov)
      (nnmaildir--scan, nnmaildir-request-scan)
      (nnmaildir-request-update-info)
      (nnmaildir-request-expire-articles):
      * lisp/gnus/nnmh.el (nnmh-request-list-1)
      (nnmh-request-expire-articles, nnmh-update-gnus-unreads):
      * lisp/gnus/nnml.el (nnml-request-expire-articles):
      * lisp/gnus/spam-stat.el (spam-stat-save, spam-stat-load)
      (spam-stat-process-directory, spam-stat-test-directory):
      * lisp/ido.el (ido-directory-too-big-p)
      (ido-file-name-all-completions):
      * lisp/image-dired.el (image-dired-get-thumbnail-image)
      (image-dired-create-thumb-1):
      * lisp/info.el (info-insert-file-contents):
      * lisp/ls-lisp.el (ls-lisp-insert-directory)
      (ls-lisp-handle-switches, ls-lisp-classify-file)
      (ls-lisp-format):
      * lisp/mail/blessmail.el:
      * lisp/mail/feedmail.el (feedmail-default-date-generator)
      (feedmail-default-message-id-generator):
      * lisp/mail/mailabbrev.el (mail-abbrevs-sync-aliases)
      (mail-abbrevs-setup):
      * lisp/mail/mspools.el (mspools-size-folder):
      * lisp/mail/rmail.el (rmail-insert-inbox-text):
      * lisp/mail/sendmail.el (sendmail-sync-aliases):
      * lisp/mh-e/mh-alias.el (mh-alias-tstamp):
      * lisp/net/ange-ftp.el (ange-ftp-parse-netrc)
      (ange-ftp-write-region, ange-ftp-file-newer-than-file-p)
      (ange-ftp-cf1):
      * lisp/net/eudcb-mab.el (eudc-mab-query-internal):
      * lisp/net/eww.el (eww-read-bookmarks):
      * lisp/net/netrc.el (netrc-parse):
      * lisp/net/newst-backend.el (newsticker--image-get):
      * lisp/nxml/rng-loc.el (rng-get-parsed-schema-locating-file):
      * lisp/obsolete/fast-lock.el (fast-lock-save-cache):
      * lisp/obsolete/vc-arch.el (vc-arch-state)
      (vc-arch-diff3-rej-p):
      * lisp/org/ob-eval.el (org-babel--shell-command-on-region):
      * lisp/org/org-attach.el (org-attach-commit):
      * lisp/org/org-macro.el (org-macro-initialize-templates):
      * lisp/org/org.el (org-babel-load-file)
      (org-file-newer-than-p):
      * lisp/org/ox-html.el (org-html-format-spec):
      * lisp/org/ox-publish.el (org-publish-find-date)
      (org-publish-cache-ctime-of-src):
      * lisp/pcmpl-gnu.el (pcomplete/tar):
      * lisp/pcmpl-rpm.el (pcmpl-rpm-packages):
      * lisp/play/cookie1.el (cookie-snarf):
      * lisp/progmodes/cmacexp.el (c-macro-expansion):
      * lisp/ps-bdf.el (bdf-file-mod-time):
      * lisp/server.el (server-ensure-safe-dir):
      * lisp/simple.el (shell-command-on-region):
      * lisp/speedbar.el (speedbar-item-info-file-helper)
      (speedbar-check-obj-this-line):
      * lisp/thumbs.el (thumbs-cleanup-thumbsdir):
      * lisp/time.el (display-time-mail-check-directory)
      (display-time-file-nonempty-p):
      * lisp/url/url-cache.el (url-is-cached):
      * lisp/url/url-file.el (url-file-asynch-callback):
      * lisp/vc/diff-mode.el (diff-delete-if-empty):
      * lisp/vc/pcvs-info.el (cvs-fileinfo-from-entries):
      * lisp/vc/vc-bzr.el (vc-bzr-state-heuristic):
      * lisp/vc/vc-cvs.el (vc-cvs-checkout-model)
      (vc-cvs-state-heuristic, vc-cvs-merge-news)
      (vc-cvs-retrieve-tag, vc-cvs-parse-status, vc-cvs-parse-entry):
      * lisp/vc/vc-hg.el (vc-hg--slurp-hgignore-1)
      (vc-hg--ignore-patterns-valid-p)
      (vc-hg--cached-dirstate-search, vc-hg-state-fast):
      * lisp/vc/vc-hooks.el (vc-after-save):
      * lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer):
      * lisp/vc/vc-svn.el (vc-svn-merge-news, vc-svn-parse-status):
      * lisp/vc/vc.el (vc-checkout, vc-checkin, vc-revert-file):
      * lisp/xdg.el (xdg-mime-apps):
      Prefer (file-attribute-size A) to (nth 7 A), and similarly
      for other file attributes accessors.
      * doc/lispref/files.texi (File Attributes):
      * doc/lispref/intro.texi (Version Info):
      * doc/lispref/os.texi (Idle Timers):
      * lisp/erc/erc.el (erc-string-to-emacs-time):
      * lisp/files.el (file-attribute-access-time)
      (file-attribute-modification-time)
      (file-attribute-status-change-time):
      * lisp/net/tramp-compat.el:
      (tramp-compat-file-attribute-modification-time)
      (tramp-compat-file-attribute-size):
      * src/buffer.c (syms_of_buffer):
      * src/editfns.c (Fget_internal_run_time):
      * src/fileio.c (Fvisited_file_modtime)
      (Fset_visited_file_modtime):
      * src/keyboard.c (Fcurrent_idle_time):
      * src/process.c (Fprocess_attributes):
      Defer implementation details about timestamp format to the
      section that talks about timestamp format, to make it easier
      to change the documentation later if timestamp formats are
      extended.
      * lisp/gnus/gnus-util.el (gnus-file-newer-than):
      * lisp/speedbar.el (speedbar-check-obj-this-line):
      * lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer):
      Prefer time-less-p to doing it by hand.
      * lisp/ls-lisp.el (ls-lisp-format): Inode numbers are no longer conses.
      * lisp/vc/vc-bzr.el (vc-bzr-state-heuristic):
      Use eql, not eq, to compare integers that might be bignums.
      * lisp/org/ox-publish.el (org-publish-cache-ctime-of-src):
      Prefer float-time to doing time arithmetic by hand.
      662bee7d
  33. 15 Sep, 2018 1 commit
    • Eli Zaretskii's avatar
      Avoid adverse side effects of fixing bug#21824 · e133b630
      Eli Zaretskii authored
      * test/src/buffer-tests.el
      (overlay-modification-hooks-deleted-overlay): New test.
      
      * src/buffer.c (report_overlay_modification): Don't bypass all
      the overlay-modification hooks; instead, invoke each function
      only if the buffer associated with the overlay is the current
      buffer.  (Bug#30823)
      e133b630
  34. 12 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Turn misc objects into pseudovectors · d614e4a8
      Paul Eggert authored
      Eliminate the category of miscellaneous objects, and turn all
      such objects into pseudovectors.  The immediate motivation
      for this change is to free up an enum Lisp_Type tag value, a
      scarce resource that can be better used elsewhere.  However,
      this change is worthwhile in its own right, as it improves
      performance slightly on my platform, 0.3% faster for 'make
      compile-always' on Fedora 28, and it simplifies the garbage
      collector and interpreter (Bug#32405).
      * doc/lispref/internals.texi (Garbage Collection):
      * etc/NEWS:
      Document change to garbage-collect return value.
      * src/alloc.c (total_markers, total_free_markers):
      (union aligned_Lisp_Misc, MARKER_BLOCK_SIZE)
      (struct marker_block, marker_block, marker_block_index)
      (misc_free_list, allocate_misc, live_misc_holding)
      (live_misc_p, sweep_misc):
      * src/lisp.h (lisp_h_MARKERP, lisp_h_MISCP, MARKERP, MISCP)
      (Lisp_Misc, enum Lisp_Misc_Type, Lisp_Misc_Free)
      (Lisp_Misc_Marker, Lisp_Misc_Overlay, Lisp_Misc_Finalizer)
      (Lisp_Misc_Ptr, Lisp_Misc_User_Ptr, Lisp_Misc_Limit)
      (Lisp_Misc_Bignum)
      (XSETMISC, struct Lisp_Misc_Any, XMISCANY, XMISCTYPE)
      (struct Lisp_Free, union Lisp_Misc, XMISC):
      Remove.  All uses removed.
      (cleanup_vector): Clean up objects that were formerly misc
      and are now pseudovectors.
      (make_misc_ptr, build_overlay, Fmake_marker, build_marker)
      (make_bignum_str, make_number, make_pure_bignum)
      (make_user_ptr, Fmake_finalizer):
      Build as pseudovectors, not as misc objects.
      (mark_finalizer_list, queue_doomed_finalizers)
      (compact_undo_list, mark_overlay, mark_object)
      (unchain_dead_markers):
      Mark as vector-like objects, not as misc objects.
      (mark_maybe_object, mark_maybe_pointer, valid_lisp_object_p)
      (total_bytes_of_live_objects, survives_gc_p):
      * src/fns.c (sxhash):
      No need to worry about misc objects.
      (garbage_collect_1): Do not generate a 'misc' component.
      (syms_of_alloc): No need for 'misc' symbol.
      * src/buffer.c (overlays_at, overlays_in, overlay_touches_p)
      (overlay_strings, recenter_overlay_lists)
      (fix_start_end_in_overlays, fix_overlays_before)
      (Foverlay_lists, report_overlay_modification)
      (evaporate_overlays):
      * src/editfns.c (overlays_around):
      * src/data.c (Ftype_of):
      * src/fns.c (internal_equal):
      * src/lisp.h (mint_ptrp, xmint_pointer, FINALIZERP)
      (XFINALIZER, MARKERP, XMARKER, OVERLAYP, XOVERLAY, USER_PTRP)
      (XUSER_PTR, BIGNUMP, XBIGNUM):
      * src/print.c (print_vectorlike, print_object):
      * src/undo.c (record_marker_adjustments):
      * src/xdisp.c (load_overlay_strings):
      Formerly misc objects are now pseudovectors.
      * src/lisp.h (PVEC_MARKER, PVEC_OVERLAY, PVEC_FINALIZER)
      (PVEC_BIGNUM, PVEC_MISC_PTR, PVEC_USER_PTR):
      New constants, replacing their misc versions.  All uses changed.
      (struct Lisp_Marker, struct Lisp_Overlay, struct Lisp_Misc_Ptr)
      (struct Lisp_Bignum, struct Lisp_User_Ptr, struct Lisp_Finalizer):
      Make usable as a pseudovector by using a pseudovector header,
      replacing any DIY components, and putting Lisp_Object members
      first.  All uses changed.
      d614e4a8
  35. 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