1. 23 Apr, 2020 1 commit
    • Paul Eggert's avatar
      text-char-description minor cleanup · 7b15cc3e
      Paul Eggert authored
      * src/keymap.c (push_text_char_description): Omit useless code.
      (Ftext_char_description): Minor code cleanup, inspired by
      seeing an incorrect comment about MAX_MULTIBYTE_LENGTH’s value.
      7b15cc3e
  2. 17 Apr, 2020 2 commits
    • Paul Eggert's avatar
      Port recent character.h changes to --with-wide-int · 2cb7e866
      Paul Eggert authored
      * src/fns.c (mapcar1):
      * src/keymap.c (Fkey_description):
      * src/syntax.c (scan_lists):
      Prefer ptrdiff_t to EMACS_INT where either will do; this fixes
      newly-introduced type errors on --with-wide-int platforms where
      ptrdiff_t is narrower than EMACS_INT.
      * src/keymap.c (Fkey_description): Rework for clarity; remove goto.
      * src/syntax.c (scan_words, Fforward_comment, scan_lists)):
      Fix unlikely integer overflow problems that can occur on
      --with-wide-int platforms, and that were caught by the recent
      character.h changes.
      2cb7e866
    • 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
  3. 01 Jan, 2020 1 commit
  4. 14 Oct, 2019 1 commit
  5. 13 Oct, 2019 1 commit
  6. 01 Oct, 2019 1 commit
  7. 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
  8. 22 Aug, 2019 1 commit
  9. 12 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Avoid duplicate comparison in describe_map_compare · 77a4cc9f
      Paul Eggert authored
      * src/fns.c (string_version_cmp): New function.
      This has most of the old Fstring_version_lessp,
      with an assertion to make things a bit clearer.
      * src/fns.c (Fstring_version_lessp):
      * src/keymap.c (describe_map_compare): Use it (Bug#33237).
      77a4cc9f
  10. 11 Jul, 2019 1 commit
  11. 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
  12. 09 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Use shortcuts for Flength · a8465033
      Paul Eggert authored
      When calculating the length of a Lisp object whose type is
      known, use a specialized length operation on it to save a bit
      of runtime overhead.
      * src/callint.c (Fcall_interactively):
      * src/minibuf.c (read_minibuf_unwind):
      Use ASIZE rather than Flength on values that must be vectors.
      * src/charset.c (Fsort_charsets):
      * src/coding.c (detect_coding_sjis):
      (Fdefine_coding_system_internal):
      * src/data.c (wrong_choice):
      * src/eval.c (Flet, eval_sub, Fapply, apply_lambda):
      * src/fns.c (sort_list):
      * src/font.c (font_vconcat_entity_vectors)
      (font_find_for_lface):
      * src/frame.c (Fmodify_frame_parameters):
      * src/fringe.c (get_logical_fringe_bitmap):
      * src/ftfont.c (ftfont_get_open_type_spec):
      * src/gtkutil.c (xg_print_frames_dialog):
      * src/lread.c (read1, read_vector):
      * src/keymap.c (Fkey_description):
      * src/kqueue.c (Fkqueue_add_watch):
      * src/macfont.m (macfont_get_open_type_spec):
      * src/menu.c (parse_single_submenu, x_popup_menu_1):
      * src/minibuf.c (Finternal_complete_buffer):
      * src/nsfont.m (ns_findfonts, nsfont_list_family):
      * src/process.c (Fmake_process):
      * src/search.c (Fset_match_data):
      * src/xfaces.c (Fx_family_fonts):
      Use list_length rather than Flength on values that must be lists.
      * src/fns.c (list_length): New function.
      (Flength): Use it.
      * src/nsfont.m (ns_findfonts):
      Use !NILP (x) rather than XFIXNUM (Flength (x)) != 0.
      * src/xdisp.c (store_mode_line_string):
      Use SCHARS rather than Flength on values that must be strings.
      a8465033
  13. 01 Jan, 2019 1 commit
  14. 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
  15. 25 Sep, 2018 1 commit
  16. 20 Sep, 2018 1 commit
    • Eli Zaretskii's avatar
      More accurate docs for 'text-char-description' · d28d54c7
      Eli Zaretskii authored
      * src/keymap.c (Ftext_char_description):
      * doc/lispref/help.texi (Describing Characters): More accurate
      description of 'text-char-description'.  Remove incorrect
      examples from the ELisp manual.  (Bug#32743)
      d28d54c7
  17. 10 Sep, 2018 1 commit
    • Eli Zaretskii's avatar
      Clarify documentation of functions reading character events · 5cf282d6
      Eli Zaretskii authored
      * doc/lispref/help.texi (Describing Characters):
      * doc/lispref/commands.texi (Keyboard Events)
      (Reading One Event, Classifying Events): Make the distinction
      between characters and character events more explicit.
      
      * src/keymap.c (Ftext_char_description)
      (Fsingle_key_description):
      * src/lread.c (Fread_char, Fread_char_exclusive): Doc fixes,
      to make a clear distinction between a character input event
      and a character code.  (Bug#32562)
      5cf282d6
  18. 07 Sep, 2018 1 commit
    • Paul Eggert's avatar
      Shrink pseudovectors a bit · 2c8520e1
      Paul Eggert authored
      sizeof (struct Lisp_Marker) was 32 on x86, where 24 would do.
      Problem noted by Stefan Monnier in:
      https://lists.gnu.org/r/emacs-devel/2018-09/msg00165.html
      * src/bignum.h (struct Lisp_Bignum):
      * src/frame.h (struct frame):
      * src/lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector)
      (struct Lisp_Char_Table, struct Lisp_Hash_Table)
      (struct Lisp_Marker, struct Lisp_Overlay)
      (struct Lisp_Misc_Ptr, struct Lisp_User_Ptr)
      (struct Lisp_Finalizer, struct Lisp_Float)
      (struct Lisp_Module_Function):
      * src/process.h (struct Lisp_Process):
      * src/termhooks.h (struct terminal):
      * src/thread.h (struct thread_state, struct Lisp_Mutex)
      (struct Lisp_CondVar):
      * src/window.c (struct save_window_data):
      * src/window.h (struct window):
      * src/xterm.h (struct scroll_bar):
      * src/xwidget.h (struct xwidget, struct xwidget_view):
      Add GCALIGNED_STRUCT attribute.
      * src/lisp.h (GCALIGNED_UNION_MEMBER): Renamed from GCALIGNED_UNION.
      All uses changed.
      (GCALIGNED_STRUCT_MEMBER, GCALIGNED_STRUCT, GCALIGNED): New macros.
      All uses of open-coded GCALIGNED changed to use GCALIGNED.
      (union vectorlike_header): No longer GC-aligned.
      (PSEUDOVECSIZE): Yield 0 for pseudovectors without Lisp
      objects that place a member before where the first Lisp object
      member would be.
      2c8520e1
  19. 29 Aug, 2018 1 commit
  20. 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
  21. 13 Jul, 2018 1 commit
    • Tom Tromey's avatar
      Rename integerp->fixnum, etc, in preparation for bignums · 42fe787b
      Tom Tromey authored
      * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
      src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
      src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
      src/process.c, src/profiler.c, src/search.c, src/sound.c,
      src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
      src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
      src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
      src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
      src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
      src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
      src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
      INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
      make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
      NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
      42fe787b
  22. 30 Jun, 2018 1 commit
    • Paul Eggert's avatar
      unbind_to performance tuning · 2e281186
      Paul Eggert authored
      * src/alloc.c (which_symbols):
      * src/dispnew.c (Fredisplay):
      * src/editfns.c (Fsubst_char_in_region):
      * src/fileio.c (Fdo_auto_save):
      * src/indent.c (Fvertical_motion):
      * src/keymap.c (Fcurrent_active_maps):
      * src/lread.c (Feval_buffer):
      * src/minibuf.c (get_minibuffer):
      * src/sysdep.c (system_process_attributes):
      * src/textprop.c (Fnext_single_char_property_change)
      (Fprevious_single_char_property_change):
      * src/window.c (Fscroll_other_window, Fscroll_other_window_down):
      * src/xdisp.c (Fformat_mode_line):
      Help the compiler eliminate tail recursion in call to unbind_to.
      * src/coding.c (decode_coding_gap):
      Omit unnecessary unbind_to, as we’re about to call unbind_to anyway.
      * src/coding.c (Fread_coding_system):
      * src/eval.c (eval_sub):
      * src/xdisp.c (handle_single_display_spec, decode_mode_spec):
      * src/xselect.c (x_get_local_selection):
      Avoid need to save a machine register when calling unbind_to.
      * src/minibuf.c (Ftry_completion, Fall_completions):
      Omit unnecessary assignment.
      2e281186
  23. 15 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Avoid Lisp_Misc allocation if C stack suffices · 12fd59bb
      Paul Eggert authored
      * src/fileio.c (union read_non_regular): New type.
      (read_non_regular, Finsert_file_contents):
      Use it to avoid	allocating a Lisp_Misc.
      * src/keymap.c (union map_keymap): New type.
      (map_keymap_char_table_item, map_keymap_internal):
      Use it to avoid	allocating a Lisp_Misc.
      12fd59bb
  24. 16 Feb, 2018 1 commit
  25. 01 Jan, 2018 1 commit
  26. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  27. 11 Jul, 2017 1 commit
    • NicolasPetton's avatar
      Add an optional testfn parameter to assoc · 0bece6c6
      NicolasPetton authored
      * src/fns.c (assoc): New optional testfn parameter used for comparison
      when provided.
      * test/src/fns-tests.el (test-assoc-testfn): Add tests for the new
      'testfn' parameter.
      * src/buffer.c:
      * src/coding.c:
      * src/dbusbind.c:
      * src/font.c:
      * src/fontset.c:
      * src/gfilenotify.c:
      * src/image.c:
      * src/keymap.c:
      * src/process.c:
      * src/w32fns.c:
      * src/w32font.c:
      * src/w32notify.c:
      * src/w32term.c:
      * src/xdisp.c:
      * src/xfont.c: Add a third argument to Fassoc calls.
      * etc/NEWS:
      * doc/lispref/lists.texi: Document the new 'testfn' parameter.
      0bece6c6
  28. 19 Feb, 2017 1 commit
  29. 26 Jan, 2017 1 commit
    • Paul Eggert's avatar
      Replace QUIT with maybe_quit · b3a3ed52
      Paul Eggert authored
      There’s no longer need to have QUIT stand for a slug of C statements.
      Use the more-obvious function-call syntax instead.
      Also, use true and false when setting immediate_quit.
      These changes should not affect the generated machine code.
      * src/lisp.h (QUIT): Remove.  All uses replaced by maybe_quit.
      b3a3ed52
  30. 01 Jan, 2017 1 commit
  31. 30 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Limit <config.h>’s includes · f4eb8900
      Paul Eggert authored
      This follows up on recent problems with the fact that config.h
      includes stdlib.h etc.; some files need to include stdlib.h later.
      config.h generally should limit itself to includes that are
      universally safe; outside of MS-Windows, only stdbool.h makes
      the cut among the files currently included.  So, move the
      other includes to just the files that need them (Bug#24506).
      * configure.ac (config_opsysfile): Remove, as this generic hook
      is no longer needed.
      * lib-src/etags.c, src/unexmacosx.c, src/w32.c, src/w32notify.c:
      * src/w32proc.c (_GNU_SOURCE):
      Remove, as it’s OK for config.h to do this now.
      * src/conf_post.h: Include <ms-w32.h>, instead of the generic
      config_opsysfile, for simplicity as this old way of configuring is
      now done only for the MS-Windows port.  Do not include <ms-w32.h>
      if DEFER_MS_W32_H, for the benefit of the few files that want its
      effects later.  Do not include <alloca.h>, <string.h>, or
      <stdlib.h>.  Other files modified to include these headers as
      needed, or to not include headers that are no longer needed.
      * src/lisp.h: Include <alloca.h> and <string.h> here, since
      some of the inline functions need them.
      * src/regex.c: Include <alloca.h> if not emacs.  (If emacs,
      we can rely on SAFE_ALLOCA.)  There is no longer any need to
      worry about HAVE_ALLOCA_H.
      * src/unexmacosx.c: Rely on config.h not including stdlib.h.
      * src/w32.c, src/w32notify.c, src/w32proc.c (DEFER_MS_W32_H):
      Define before including <config.h> first, and include <ms-w32.h>
      after the troublesome headers.
      f4eb8900
  32. 15 Jun, 2016 1 commit
  33. 01 May, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Doc fix · 7b858857
      Lars Ingebrigtsen authored
      * src/keymap.c (Fdefine_prefix_command): Clarify doc string
      slightly (bug#18092).
      
      (cherry picked from commit 6b769c81)
      7b858857
  34. 29 Apr, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Doc fix · 6b769c81
      Lars Ingebrigtsen authored
      * src/keymap.c (Fdefine_prefix_command): Clarify doc string
      slightly (bug#18092).
      6b769c81
  35. 04 Apr, 2016 1 commit
    • Paul Eggert's avatar
      New C macro AUTO_STRING_WITH_LEN · 17cb263a
      Paul Eggert authored
      Put a bit less pressure on the garbage collector by defining a
      macro that is like AUTO_STRING but also allows null bytes in strings,
      and by extending AUTO_STRING to work with any unibyte string.
      * src/alloc.c (verify_ascii): Remove; all uses removed.
      AUTO_STRING can now be used on non-ASCII unibyte strings.
      * src/lisp.h (AUTO_STRING): Now allows non-ASCII unibyte strings.
      (AUTO_STRING_WITH_LEN): New macro.
      * src/coding.c (from_unicode_buffer):
      * src/editfns.c (format_time_string):
      * src/emacs-module.c (module_make_string, module_format_fun_env):
      * src/fileio.c (Fexpand_file_name):
      * src/font.c (font_parse_family_registry):
      * src/ftfont.c (ftfont_get_charset):
      * src/keymap.c (silly_event_symbol_error):
      * src/menu.c (single_menu_item):
      * src/sysdep.c (system_process_attributes):
      Use AUTO_STRING_WITH_LEN if possible.
      * src/emacs-module.c (module_make_function):
      * src/fileio.c (report_file_errno, report_file_notify_error):
      * src/fns.c (Flocale_info):
      * src/sysdep.c (system_process_attributes):
      Use AUTO_STRING if possible.  This is doable more often now
      that AUTO_STRING works on any unibyte string.
      17cb263a
  36. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  37. 01 Jan, 2016 1 commit
  38. 09 Nov, 2015 2 commits
    • Eli Zaretskii's avatar
      Fix assertion violation in define-key · 86c19714
      Eli Zaretskii authored
      * src/keymap.c (store_in_keymap): Don't use XFASTINT on non-character
      objects.  Reported by Drew Adams <drew.adams@oracle.com>
      and Juanma Barranquero <lekktu@gmail.com>.
      86c19714
    • Paul Eggert's avatar
      Use INT_ADD_WRAPV etc. to check integer overflow · 10873055
      Paul Eggert authored
      * src/alloc.c (xnmalloc, xnrealloc, xpalloc, Fmake_string):
      * src/buffer.c (record_overlay_string, overlay_strings):
      * src/casefiddle.c (casify_object):
      * src/ccl.c (Fccl_execute_on_string):
      * src/character.c (char_width, c_string_width, lisp_string_width)
      (count_size_as_multibyte, string_escape_byte8):
      * src/coding.c (coding_alloc_by_realloc, produce_chars):
      * src/data.c (arith_driver):
      * src/dispnew.c (realloc_glyph_pool, init_display):
      * src/editfns.c (styled_format):
      * src/fns.c (Ffillarray):
      * src/ftfont.c (ftfont_shape_by_flt):
      * src/gnutls.c (gnutls_hex_string):
      * src/gtkutil.c (get_utf8_string):
      * src/image.c (x_to_xcolors, x_detect_edges, png_load_body):
      * src/keymap.c (Fkey_description):
      * src/lisp.h (SAFE_ALLOCA_LISP):
      * src/term.c (encode_terminal_code):
      * src/tparam.c (tparam1):
      * src/xselect.c (x_property_data_to_lisp):
      * src/xsmfns.c (smc_save_yourself_CB):
      * src/xterm.c (x_term_init):
      When checking for integer overflow, prefer INT_MULTIPLY_WRAPV to
      more-complicated code involving division and/or
      INT_MULTIPLY_OVERFLOW, and similarly for INT_ADD_WRAPV and
      subtraction and/or INT_ADD_OVERFLOW.
      * src/casefiddle.c (casify_object): Simplify multibyte size check.
      * src/character.c: Remove some obsolete ‘#ifdef emacs’s.
      * src/data.c (arith_driver): Also check for division overflow,
      as that’s now possible given that the accumulator can now contain
      any Emacs integer.
      * src/lisp.h (lisp_word_count): Remove; no longer used.
      10873055