1. 24 Sep, 2019 1 commit
  2. 22 Sep, 2019 1 commit
  3. 16 Sep, 2019 1 commit
  4. 15 Sep, 2019 2 commits
    • Juri Linkov's avatar
      Use images for new/close buttons in tab-bar and tab-line. · 6474abc3
      Juri Linkov authored
      * etc/images/tabs/new.xpm:
      * etc/images/tabs/close.xpm:
      New files.
      
      * lisp/tab-bar.el (tab-bar-separator): New face.
      (tab-bar-separator, tab-bar-button-new, tab-bar-button-close):
      Use display property with images in default values.
      
      * lisp/tab-line.el (tab-line-button-new, tab-line-button-close):
      Use display property with images in default values.
      
      * src/xdisp.c (tab_bar_item_info): Add new arg close_p and set it
      to the value of property `close' at charpos.
      (get_tab_bar_item): Add new arg close_p.
      (handle_tab_bar_click): Add ctrl_modifier when close_p is non-nil.
      (Fdump_tab_bar_row): Fix crash for non-X builds.
      6474abc3
    • Juri Linkov's avatar
      Fix assertion violations due to non-ASCII text in tabs · 8d30e1bc
      Juri Linkov authored
      * src/xdisp.c (tab_bar_height, redisplay_tab_bar)
      (display_tab_bar): If the Lisp string to be displayed in the
      tab-bar window is multibyte, tell the display
      engine to treat it as multibyte, instead of relying on the
      initial determination by init_iterator (which is based on the
      multibyteness of the current buffer).  (Bug#37385)
      8d30e1bc
  5. 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
  6. 04 Sep, 2019 1 commit
  7. 03 Sep, 2019 2 commits
    • Juri Linkov's avatar
      Small fix for text-mode display · d1c14de9
      Juri Linkov authored
      d1c14de9
    • Juri Linkov's avatar
      Text-mode display of the tab-bar and emulation of clicking on a tty. · a365251d
      Juri Linkov authored
      * lisp/tab-bar.el (tab-bar-mouse): New command bound to mouse-1 on [tab-bar].
      
      * lisp/xt-mouse.el (xterm-mouse-event): Use `tab-bar' when clicking
      on the tab-bar that is on the second row below menu-bar.
      
      * src/frame.c (set_tab_bar_lines): New function.
      (frame_windows_min_size): Add FRAME_TAB_BAR_LINES.
      (make_initial_frame): Call set_tab_bar_lines.
      (store_frame_param): Call set_tab_bar_lines for Qtab_bar_lines prop.
      (Fframe_parameters): Call store_in_alist for Qtab_bar_lines.
      
      * src/xdisp.c (display_tab_bar): New function.
      (redisplay_window): Call display_tab_bar when `FRAME_WINDOW_P (f)'
      is NULL on a tty.
      a365251d
  8. 31 Aug, 2019 1 commit
    • Juri Linkov's avatar
      Frame-local tab-bar and window-local tab-line. · 3e0ad29a
      Juri Linkov authored
      * etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
      
      * etc/TODO: Remove tab-related items.
      
      * lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
      
      * lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
      
      * lisp/loadup.el: Load "tab-bar".
      
      * lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
      (menu-bar-showhide-menu): Define showhide-tab-bar.
      
      * lisp/startup.el (tab-bar-images-pixel-height): New defconst.
      (command-line): Reset tab-bar-mode.
      (x-apply-session-resources): Add "tabBar", "TabBar".
      
      * lisp/subr.el (read-key): Add tab-bar.
      
      * lisp/tab-bar.el: New file.
      * lisp/tab-line.el: New file.
      
      * lisp/window.el (window--dump-frame): Add tab-bar-height.
      
      * src/dispextern.h (enum window_part): Add ON_TAB_LINE.
      (struct glyph_matrix): Add tab_line_p.
      (struct glyph_row): Add tab_line_p.
      (MATRIX_TAB_LINE_ROW): New macro.
      (MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
      (MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
      (MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
      (DESIRED_TAB_LINE_HEIGHT): New macros.
      (enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
      (struct it): Add tab_line_p.
      (tab_bar_item_idx, tab_bar_item_image): New enums.
      (DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
      (DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
      New constants.
      
      * src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
      (shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
      (clear_current_matrices, clear_desired_matrices):
      Call clear_glyph_matrix on tab_bar_window.
      (blank_row): Add WINDOW_TAB_LINE_HEIGHT.
      (required_matrix_height): Change 2 to 3.
      (fake_current_matrices): Reset tab_line_p.
      (adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
      Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
      (free_glyphs): Handle tab_bar_window.
      (update_frame): Handle tab_bar_window.
      (update_window): Handle row->tab_line_p.
      (scrolling_window): Change arg type from bool to int.
      Change header_line_p to tab_line_p.
      (buffer_posn_from_coords): Add window_wants_tab_line.
      (mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
      
      * src/frame.c (frame_default_tab_bar_height): New internal variable.
      (adjust_frame_size): Handle tab_bar_window.
      (make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
      last_tab_bar_item.
      (Ftab_bar_pixel_width): New function.
      (frame_parms): Add tab-bar-lines.
      (gui_figure_window_size): Add new arg tabbar_p.
      (syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
      Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
      Add Qtab_bar_lines to frame_inhibit_implied_resize.
      (tab-bar-mode): New variable.
      
      * src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
      desired_tab_bar_string, current_tab_bar_string.
      (GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
      minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
      tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
      (fset_tab_bar_items, fset_tab_bar_window)
      (fset_current_tab_bar_string, fset_desired_tab_bar_string):
      New inlines.
      (FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
      (FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
      Use FRAME_TAB_BAR_LINES.
      
      * src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
      Add WINDOW_TAB_LINE_HEIGHT.
      
      * src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
      (x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
      
      * src/keyboard.c (read_char): Handle Qtab_bar.
      (kbd_buffer_get_event): Handle TAB_BAR_EVENT.
      (make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
      Handle TAB_BAR_EVENT.
      (tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
      New internal variables.
      (tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
      (parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
      New functions.
      (read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
      (tab-bar-separator-image-expression): New variable.
      
      * src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
      
      * src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
      
      * src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
      (GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
      
      * src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
      
      * src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
      
      * src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
      (Fwindow_tab_line_height): New function.
      (coordinates_in_window): Use window_wants_tab_line with
      CURRENT_TAB_LINE_HEIGHT.
      (window_relative_x_coord): Add ON_TAB_LINE.
      (Fcoordinates_in_window_p): Add ON_TAB_LINE.
      (window_from_coordinates): Add new arg tab_bar_p.
      (Fwindow_line_height): Use window_wants_tab_line with
      WINDOW_TAB_LINE_HEIGHT.
      (Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
      (make_window): Set tab_line_height to -1.
      (window_wants_tab_line): New function.
      (window_internal_height): Use window_wants_tab_line.
      (window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
      (Frecenter): Set minimize_tab_bar_window_p to 1.
      (GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
      (Fcurrent_window_configuration): Set frame_tab_bar_lines and
      frame_tab_bar_height.
      (set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
      (syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
      
      * src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
      (WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
      New macros.
      (WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
      Add WINDOW_TAB_BAR_P.
      
      * src/xdisp.c (window_box_height): Add window_wants_tab_line with
      MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
      (pos_visible_p): Use window_wants_tab_line.
      Add WINDOW_TAB_LINE_HEIGHT.
      (get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
      (get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
      (remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
      ON_TAB_LINE.
      (init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
      Add WINDOW_TAB_LINE_HEIGHT.  Add window_wants_tab_line.
      (Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
      (prepare_menu_bars): Call update_tab_bar.
      (update_tab_bar, build_desired_tab_bar_string)
      (display_tab_bar_line, tab_bar_height, Ftab_bar_height)
      (redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
      (handle_tab_bar_click, note_tab_bar_highlight): New functions.
      (compute_window_start_on_continuation_line): Use window_wants_tab_line.
      (try_cursor_movement): Use window_wants_tab_line with
      CURRENT_TAB_LINE_HEIGHT.
      (redisplay_window): Use window_wants_tab_line with
      CURRENT_TAB_LINE_HEIGHT.
      (try_window_reusing_current_matrix): Use window_wants_tab_line
      with WINDOW_TAB_LINE_HEIGHT.
      (Fdump_tab_bar_row): New function.
      (compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
      (display_line): Use window_wants_tab_line.
      (display_mode_line): Set tab_line_p to true if face_id is
      TAB_LINE_FACE_ID.
      (Fformat_mode_line): Handle Qtab_line and Qtab_bar.
      (gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
      (erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
      (show_mouse_face): Use tab_bar_window.
      (note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
      area ON_TAB_LINE.
      (note_mouse_highlight): Call note_tab_bar_highlight,
      (expose_frame): Handle tab_bar_window.
      (syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
      (auto-resize-tab-bars, auto-raise-tab-bar-buttons)
      (tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
      (tab-bar-max-label-size): New variables.
      
      * src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
      TAB_BAR_FACE_ID.
      (syms_of_xfaces): Define Qtab_bar and Qtab_line.
      
      * src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
      New functions.
      (xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
      (frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
      
      * src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
      (x_draw_image_relief): Use TAB_BAR_FACE_ID.
      (handle_one_xevent): Handle tab_bar_window.
      (x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
      (x_create_terminal): Set change_tab_bar_height_hook.
      
      * src/xterm.h (struct x_output): Add tabbar_top_height,
      tabbar_bottom_height, tabbar_left_width, tabbar_right_width
      tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
      (FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
      FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
      FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
      FRAME_TABBAR_WIDTH.
      3e0ad29a
  9. 23 Aug, 2019 2 commits
    • Eli Zaretskii's avatar
      Fix compilation --without--x · ad9c8b02
      Eli Zaretskii authored
      * src/xdisp.c (extend_face_to_end_of_line): Fix a recent
      change that moved the initialization of default_face.
      Reported by Glenn Morris <rgm@gnu.org>.
      ad9c8b02
    • Robert Pluim's avatar
      Move default face lookup · ef49439f
      Robert Pluim authored
      * src/xdisp.c (extend_face_to_end_of_line): Move default face
      lookup lower.
      ef49439f
  10. 21 Aug, 2019 1 commit
  11. 17 Aug, 2019 1 commit
  12. 04 Aug, 2019 1 commit
    • Martin Rudalics's avatar
      Fix two mouse drag and drop issues (Bug#28620, Bug#36269) · 5ec3f705
      Martin Rudalics authored
      Allow 'mouse-drag-and-drop-region' to move/copy text from one
      frame to another (Bug#28620).  Prevent mouse avoidance mode from
      interfering with 'mouse-drag-and-drop-region' (Bug#36269).
      
      * lisp/avoid.el (mouse-avoidance-ignore-p): Suspend avoidance
      when 'track-mouse' equals 'dropping'.
      * lisp/mouse.el (mouse-drag-and-drop-region): Set
      'track-mouse' to 'dropping'.  Continue reading events also
      when switching frames.
      * src/keyboard.c (Finternal_track_mouse): Rename from
      Ftrack_mouse.
      (some_mouse_moved): Return NULL also when mouse is not tracked.
      (show_help_echo, readable_events, kbd_buffer_get_event): Don't
      check whether mouse is tracked, some_mouse_moved does it now.
      (track_mouse): Rename variable from do_mouse_tracking.  Adjust
      all users.  In doc-string explain meanings of special values
      'dragging' and 'dropping'.
      * src/nsterm.m (ns_mouse_position): During drag and drop
      consider last mouse frame only when there is no currently
      focused frame.
      * src/w32fns.c (w32_wnd_proc): Don't set mouse capture during a
      drag and drop operation.
      * src/w32term.c (w32_mouse_position): Track frame under mouse
      during mouse drag and drop.
      (mouse_or_wdesc_frame): New function.
      (w32_read_socket): Call mouse_or_wdesc_frame on mouse events.
      * src/xdisp.c (define_frame_cursor1): Don't change mouse cursor
      shape during mouse drag and drop.
      (syms_of_xdisp): New symbol Qdropping.
      * src/xterm.c (XTmouse_position): Allow mouse drag and drop move
      to another frame
      (mouse_or_wdesc_frame): New function.
      (handle_one_xevent): Use mouse_or_wdesc_frame for mouse events.
      5ec3f705
  13. 22 Jul, 2019 1 commit
    • Martin Rudalics's avatar
      Handle persistence of windows' scroll bar and fringes settings (Bug#36193) · 8e0ebb9a
      Martin Rudalics authored
      * doc/lispref/display.texi (Fringe Size/Pos): Document new
      argument PERSISTENT of 'set-window-fringes'.
      (Scroll Bars): Document new argument PERSISTENT of
      'set-window-scroll-bars'.  Mention that HORIZONTAL-TYPE must
      be 'bottom' to show a horizontal scroll bar on mini windows.
      * lisp/window.el (window-min-pixel-height): For mini windows the
      minimum height is one line.
      (window--min-size-1): Use value returned by
      'window-min-pixel-height' when dealing with mini windows.
      (window--resize-mini-window): Try to handle horizontal scroll
      bars and size restrictions more accurately.
      (window--state-put-2): Handle persistence of scroll bar
      settings.
      * src/frame.c (make_frame): Allow horizontal scroll bars in
      mini windows.
      (adjust_frame_size): Drop PIXELWISE argument in
      'resize_frame_windows' calls.
      * src/window.c (set_window_buffer): Don't override WINDOW's
      scroll bar and fringe settings when marked as persistent.
      (resize_frame_windows): Drop fourth argument PIXELWISE - SIZE
      is always specified in terms of pixels.  Try to handle height
      of mini windows more accurately.
      (grow_mini_window, shrink_mini_window): Use body height of
      mini window when calculating expected height change.  Take
      horizontal scroll bars into account.
      (struct saved_window): Two new members to handle persistence
      of window fringes and scroll bars.
      (Fset_window_configuration, save_window_save): Handle
      persistence of fringes and scroll bars.
      (set_window_fringes, set_window_scroll_bars): New arguments
      PERSISTENT.  Make dimension checks more accurate.
      (Fset_window_fringes): New argument PERSISTENT.
      (Fwindow_fringes, Fwindow_scroll_bars): Add PERSISTENT to
      return values.
      (Fset_window_scroll_bars): New argument PERSISTENT.  In
      doc-string mention that 'bottom' must be specified to get a
      horizontal scroll bar in mini windows.
      (compare_window_configurations): Add checks for persistence of
      fringes and scroll bars.
      * src/window.h (struct window): New boolean slots
      'fringes_persistent' and 'scroll_bars_persistent'.
      (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Allow horizontal scroll bars
      for mini windows.
      (resize_frame_windows): Remove fourth argument of
      'resize_frame_windows' in external declaration.
      * src/xdisp.c (resize_mini_window): Use box text height to
      tell whether mini window height changed.
      (set_horizontal_scroll_bar): Set mini window's horizontal
      scroll bar when its type is specified as 'bottom'.
      * etc/NEWS: Mention new options for 'set-window-fringes' and
      'set-window-scroll-bars'.
      8e0ebb9a
  14. 13 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Avoid interleaving stderr in a few cases · a8ffbb20
      Paul Eggert authored
      * src/sysdep.c (buferr): New static var.
      (init_standard_fds) [_PC_PIPE_BUF]: Initialize it.
      (errstream, errputc, verrprintf, errwrite): New functions.
      (close_output_streams): Check buferr status too.
      * src/xdisp.c: Include sysstdio.h instead of stdio.h.
      (message_to_stderr, vmessage): Use the new functions
      to avoid interleaving stderr.
      a8ffbb20
  15. 11 Jul, 2019 1 commit
  16. 09 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Use fewer locks when accessing stdio · f8ab9083
      Paul Eggert authored
      * src/alloc.c, src/bidi.c, src/emacs-module.c, src/pdumper.c:
      * src/regex-emacs.c, src/unexhp9k800.c, src/unexmacosx.c:
      * src/widget.c, src/xdisp.c, src/xselect.c, src/xterm.c:
      Include sysstdio.h instead of stdio.h, to avoid locking
      stdio streams in many cases.
      * src/alloc.c (test_setjmp):
      * src/bidi.c (bidi_dump_cached_states):
      * src/cm.c (calccost):
      * src/dispnew.c (init_display_interactive):
      * src/emacs.c (main):
      * src/image.c (convert_mono_to_color_image):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/nsfont.m (ns_descriptor_to_entity)
      (ns_dump_glyphstring):
      * src/nsterm.h (NSTRACE_MSG_NO_DASHES):
      * src/nsterm.m (ns_mouse_position)
      (sendEvent:, keyDown:, performDragOperation:):
      * src/pdumper.c (dump_fingerprint, print_paths_to_root_1):
      * src/print.c (debug_print):
      * src/regex-emacs.c (debug_putchar, print_fastmap)
      (print_partial_compiled_pattern, print_compiled_pattern)
      (print_double_string, regex_compile):
      * src/term.c (vfatal):
      * src/unexhp9k800.c (read_header):
      * src/unexmacosx.c (unexec_error):
      * src/widget.c (EmacsFrameInitialize):
      * src/xdisp.c (message_to_stderr, vmessage, dump_glyph_row)
      (Fdump_glyph_matrix, Fdump_frame_glyph_matrix, dump_glyph_string):
      * src/xfaces.c (Fdump_colors, Fdump_face):
      * src/xselect.c (x_clipboard_manager_error_2):
      * src/xterm.c (x_initialize):
      * src/xwidget.c (WEBKIT_FN_INIT):
      Prefer unlocked calls like fputs to locked calls like fprintf.
      * src/charset.c (read_hex):
      * src/cm.c (cmputc, cmcheckmagic):
      * src/dispnew.c (update_frame, update_frame_with_menu)
      (update_frame_1, Fsend_string_to_terminal, Fding)
      (bitch_at_user):
      * src/emacs.c (main, Fdump_emacs):
      * src/emacs-module.c (module_abort):
      * src/fileio.c (Fdo_auto_save):
      * src/image.c (slurp_file)
      (png_read_from_file, png_load_body, our_stdio_fill_input_buffer):
      * src/keyboard.c (record_char, kbd_buffer_get_event)
      (handle_interrupt):
      * src/lread.c (readbyte_from_stdio, read1):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/print.c (printchar_to_stream, strout)
      (Fredirect_debugging_output):
      * src/sysdep.c (reset_sys_modes, close_output_streams)
      (procfs_ttyname, procfs_get_total_memory):
      * src/term.c (tty_ring_bell, tty_send_additional_strings)
      (tty_set_terminal_modes, tty_reset_terminal_modes)
      (tty_update_end, tty_clear_end_of_line, tty_write_glyphs)
      (tty_write_glyphs_with_face, tty_insert_glyphs)
      (tty_menu_activate):
      * src/xfaces.c (Fx_load_color_file):
      Simplify by using ordinary calls like putc to explicitly-unlocked
      calls like putc_unlocked, since the ordinary calls are now
      unlocked anyway.
      * src/emacs.c (main, Fdump_emacs):
      * src/pdumper.c (Fdump_emacs_portable):
      Coalesce adjacent printfs.
      * src/nsterm.h: Include sysstdio.h as this file’s macros rely on it.
      * src/regex-emacs.c (print_compiled_pattern):
      Omit redundant fflush.
      * src/sysstdio.h: Include unlocked-io.h.
      (clearerr_unlocked, feof_unlocked, ferror_unlocked)
      (fflush_unlocked, fgets_unlocked, fputc_unlocked)
      (fputs_unlocked, fread_unlocked, fwrite_unlocked)
      (getc_unlocked, getchar_unlocked, putc_unlocked)
      (putchar_unlocked): Remove these macros; now done by unlocked-io.h.
      * src/xwidget.c: Include sysstdio.h.
      f8ab9083
  17. 07 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Remove printmax_t etc. · 8f522efe
      Paul Eggert authored
      printmax_t etc. were needed only for platforms that lacked
      support for printing intmax_t.  These platforms are now so
      obsolete that they are no longer practical porting targets.
      * src/image.c (gs_load): Fix unlikely buffer overrun
      discovered while making these changes.  It was introduced in
      2011-07-17T00:34:43!eggert@cs.ucla.edu.
      * src/lisp.h (printmax_t, uprintmax_t, pMd, pMu, pMx):
      Remove.  All uses replaced by their standard counterparts
      intmax_t, uintmax_t, PRIdMAX, PRIuMAX, PRIxMAX.
      8f522efe
  18. 03 Jul, 2019 2 commits
    • Eli Zaretskii's avatar
      Fix compiler warnings due to a recent commit · b5de191e
      Eli Zaretskii authored
      * src/xdisp.c (expose_window, expose_frame): Avoid compilation
      warnings about printing unsigned values with %d.
      b5de191e
    • Paul Eggert's avatar
      Replace TRACE with redisplay_trace, etc. · 52d0d4fe
      Paul Eggert authored
      This simplifies callers and catches trace printf format errors
      even with typical (non-debugging) compiles.
      * src/dispextern.h (TRACE) [GLYPH_DEBUG]:
      Move definitions to xdisp.c if it’s used only there.
      * src/xdisp.c (redisplay_trace): New function, replacing TRACE macro.
      (move_trace): New function, replacing TRACE_MOVE macro.
      All uses changed.
      (dump_glyph): When tracing, don’t use %d to format ptrdiff_t,
      or %x to format a pointer.
      (expose_frame): Redo trace printfs to avoid interleaved output
      on GNU/Linux.
      52d0d4fe
  19. 02 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Fix printf formats when DEBUG_TRACE_MOVE · c136f93d
      Paul Eggert authored
      Problem caught by gcc -DDEBUG_TRACE_MOVE -Wformat.
      * src/xdisp.c (move_it_in_display_line_to, move_it_to)
      (move_it_vertically) [DEBUG_TRACE_MOVE]: Fix printf format typos.
      c136f93d
  20. 30 Jun, 2019 1 commit
    • Andreas Schwab's avatar
      Fix use of undefined macro · 5f3a63d5
      Andreas Schwab authored
      * src/xdisp.c (append_space_for_newline): Use FRAME_FONT only
      inside HAVE_WINDOW_SYSTEM.
      (extend_face_to_end_of_line): Likewise.
      (syms_of_xdisp): Doc fix.
      5f3a63d5
  21. 29 Jun, 2019 1 commit
  22. 25 Jun, 2019 1 commit
    • Paul Eggert's avatar
      Avoid some strlen work, primarily via strnlen · d7c68362
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add strnlen.
      * lib-src/etags.c (find_entries):
      * src/emacs.c (main):
      * src/nsmenu.m (parseKeyEquiv:):
      * src/nsterm.m (ns_xlfd_to_fontname):
      * src/term.c (vfatal):
      Prefer !*X to !strlen (X).
      * lib-src/etags.c (pfnote, add_regex):
      * lib-src/pop.c (pop_open):
      * lib-src/update-game-score.c (main):
      * lwlib/lwlib.c (lw_separator_p):
      * src/doprnt.c (doprnt):
      * src/emacs.c (main):
      * src/inotify.c (inotifyevent_to_event):
      * src/keyboard.c (menu_separator_name_p, parse_tool_bar_item):
      * src/sysdep.c (get_current_dir_name_or_unreachable):
      * src/xdisp.c (store_mode_line_string):
      Use strnlen to avoid unnecessary work with strlen.
      * lib-src/etags.c (Prolog_functions, prolog_pr)
      (Erlang_functions, erlang_func):
      Prefer ptrdiff_t to size_t when either will do.
      (prolog_pr, erlang_func): New arg LASTLEN, to avoid
      unnecessary strlen call. All callers changed.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/strnlen.c, m4/strnlen.m4: New files, copied from Gnulib.
      * lwlib/lwlib.c (lw_separator_p):
      * src/json.c (json_has_prefix):
      Use strncmp to avoid unecessary work with strlen + memcmp.
      * src/process.c (set_socket_option): Use SBYTES instead of strlen.
      d7c68362
  23. 24 Jun, 2019 1 commit
    • Lars Ingebrigtsen's avatar
      Make message_to_stderr do one single fwrite · 630e01a7
      Lars Ingebrigtsen authored
      * src/xdisp.c (message_to_stderr): When running as a batch
      process, the output from `message' goes to stderr, and has a
      newline appended.  Rewrite the code so that only one fwrite is
      performed to enable messages that are shorter than PIPE_BUF
      (usually 4096 on modern operating systems) are written out as one
      chunk, as this will ensure that the messages are not interleaved
      with messages from other processes that are writing at the same
      time.  This does not affect other stderr outputs, just the ones
      from `message'.
      630e01a7
  24. 20 Jun, 2019 2 commits
  25. 11 Jun, 2019 1 commit
  26. 06 Jun, 2019 1 commit
  27. 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
  28. 21 May, 2019 1 commit
    • Alan Third's avatar
      Fix some deprecation notices on macOS 10.14 · 9624f609
      Alan Third authored
      * src/nsimage.m ([EmacsImage setXBMColor:]): Replace colorSpaceName
      code.
      * src/nsmenu.m ([EmacsDialogPanel initWithContentRect:styleMask:]):
      Remove reference to oneShot.
      * src/nsterm.h (ns_enable_screen_updates): Remove function prototype.
      (NSPasteboardTypeString):
      (NSPasteboardTypeTabularText):
      (NSControlStateValueOn):
      (NSControlStateValueOff):
      (NSBezelStyleRounded):
      (NSPasteboardTypeURL): Define new names and replace all callers.
      * src/nsterm.m ([EmacsColor colorUsingDefaultColorSpace]): Replace
      calls to colorUsingColorSpaceName on macOS > 10.7.
      ([EmacsView performDragOperation:]): Add FIXME about deprecation.
      (ns_disable_screen_updates):
      (ns_enable_screen_updates): Remove functions and all callers.
      (disable_screen_updates_count): Remove variable.
      * src/macfont.m (macfont_draw): Use CGContext instead of graphicsPort
      on macOS >= 10.10
      9624f609
  29. 20 May, 2019 3 commits
    • Alexander Gramiak's avatar
      Replace XChar2b with unsigned in all font backends · a4fe9c70
      Alexander Gramiak authored
      The xfont backend using XChar2b in its API doesn't mean that we should
      use it everywhere else.
      
      * src/dispextern.h (glyph_string):
      * src/ftcrfont.c (ftcrfont_draw):
      * src/ftxfont.c (ftxfont_draw):
      * src/w32term.c (w32_draw_glyphless_glyph_string_foreground):
      * src/xdisp.c (init_glyph_string, get_char_face_and_encoding)
      (get_glyph_face_and_encoding, get_char_glyph_code)
      (fill_gstring_glyph_string, fill_stretch_glyph_string)
      (normal_char_ascent_descent, gui_get_glyph_overhangs)
      (compute_overhangs_and_x, gui_produce_glyphs):
      * src/xfont.c (xfont_get_pcm, xfont_chars_supported, xfont_open)
      (xfont_encode_char, xfont_text_extents, xfont_draw)
      * src/xftfont.c (xftfont_draw):
      * src/xterm.c (x_compute_glyph_string_overhangs)
      (x_draw_glyphless_glyph_string_foreground): Use unsigned over XChar2b.
      
      * src/nsgui.h:
      * src/w32gui.h:
      * src/xterm.h: Remove XChar2b, STORE_XCHAR2B, XCHAR2B_BYTE1, and
      XCHAR2B_BYTE2 typedefs and macros.
      
      * src/font.h (font_driver):
      (ftfont_text_extents)
      * src/ftcrfont.c (ftcrfont_text_extents):
      * src/ftfont.c (ftfont_text_extents):
      * src/macfont.m (macfont_text_extents):
      * src/nsfont.m (nsfont_text_extents):
      * src/w32font.h (w32_font_text_extents):
      * src/font.c (xfont_text_extents):
      * src/xftfont.c (xftfont_text_extents): Make code parameter const.
      a4fe9c70
    • Alexander Gramiak's avatar
      Introduce Emacs_Rectangle struct and typedef · 462b1fd7
      Alexander Gramiak authored
      * src/dispextern.h [HAVE_X_WINDOWS]: Alias Emacs_Rectangle to
      XRectangle.
      [!HAVE_X_WINDOWS]: Define Emacs_Rectangle struct.
      Use Emacs_Rectangle over XRectangle.
      
      * src/frame.h (MonitorInfo):
      * src/msdos.h:
      * src/w32term.c:
      * src/xdisp.c: Use Emacs_Rectangle over XRectangle.
      
      * src/nsgui.h:
      * src/w32gui.h: Remove old XRectangle structs.
      
      * src/xdisp.c:
      * src/nsgui.h:
      * src/w32gui.h: Rename CONVERT_FROM_XRECT and CONVERT_TO_XRECT to
      CONVERT_FROM_EMACS_RECT and CONVERT_TO_EMACS_RECT respectively.
      462b1fd7
    • Alexander Gramiak's avatar
      Introduce Emacs_Cursor typedef · 06db2a05
      Alexander Gramiak authored
      * src/dispextern.h [HAVE_X_WINDOWS]: Define Emacs_Cursor alias. Move
      the No_Cursor definition from xterm.h.
      (redisplay_interface): Use Emacs_Cursor over Cursor.
      
      * src/nsgui.h:
      * src/nsterm.h:
      * src/nsterm.m:
      * src/w32gui.h:
      * src/w32term.c:
      * src/xdisp.c:
      * src/xterm.c (x_define_frame_cursor): Use Emacs_Cursor over Cursor.
      06db2a05
  30. 10 May, 2019 1 commit
    • Alexander Gramiak's avatar
      Remove display member of glyph_string · 6bfc5fc6
      Alexander Gramiak authored
      This member has little value even on X, and it leaks internal backend
      details to the glyph_string struct.
      
      * src/dispextern.h (glyph_string): Remove X display member.
      
      * src/xdisp.c (init_glyph_string): Remove initialization of display.
      
      * src/xfont.c (xfont_draw):
      * src/xterm.c: Use FRAME_X_DISPLAY (s->f) instead of display member.
      6bfc5fc6
  31. 08 May, 2019 1 commit
    • Eli Zaretskii's avatar
      Add an assertion to xdisp.c · cd8a1d6b
      Eli Zaretskii authored
      * src/xdisp.c (display_mode_element): Add an assertion where
      we assume that 'string' returned by decode_mode_spec is always
      either a Lisp string or nil.
      cd8a1d6b
  32. 07 May, 2019 1 commit
    • Paul Eggert's avatar
      Pacify GCC 9.1 · 504f8e55
      Paul Eggert authored
      * src/intervals.c (set_intervals_multibyte_1): Omit unused temps.
      * src/xdisp.c (display_mode_element): Use !NILP instead of
      STRINGP.  This convinces GCC we’re not dereferencing a
      possibly-null pointer, and should be a bit faster anyway.
      504f8e55
  33. 05 May, 2019 1 commit