1. 13 Sep, 2019 1 commit
    • Eli Zaretskii's avatar
      Fix assertion violations due to non-ASCII text in menus · 5940ac63
      Eli Zaretskii authored
      * src/xdisp.c (tool_bar_height, redisplay_tool_bar)
      (display_menu_bar): If the Lisp string to be displayed in the
      menu-bar or tool-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)
  2. 04 Sep, 2019 1 commit
  3. 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>.
    • 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.
  4. 21 Aug, 2019 1 commit
  5. 17 Aug, 2019 1 commit
  6. 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
      (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...
  7. 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
      * 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
  8. 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.
  9. 11 Jul, 2019 1 commit
  10. 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)
      * 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)
      * 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)
      * src/lread.c (readbyte_from_stdio, read1):
      * src/minibuf.c (read_minibuf_noninteractive):
      * src/print.c (printchar_to_stream, strout)
      * 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)
      * 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.
  11. 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
      * 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.
  12. 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.
    • 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.
  13. 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.
  14. 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.
  15. 29 Jun, 2019 1 commit
  16. 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: ...
  17. 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'.
  18. 20 Jun, 2019 2 commits
  19. 11 Jun, 2019 1 commit
  20. 06 Jun, 2019 1 commit
  21. 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.
  22. 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
      * src/nsmenu.m ([EmacsDialogPanel initWithContentRect:styleMask:]):
      Remove reference to oneShot.
      * src/nsterm.h (ns_enable_screen_updates): Remove function prototype.
      (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_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
  23. 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):
      * 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.
    • Alexander Gramiak's avatar
      Introduce Emacs_Rectangle struct and typedef · 462b1fd7
      Alexander Gramiak authored
      * src/dispextern.h [HAVE_X_WINDOWS]: Alias Emacs_Rectangle to
      [!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
    • 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.
  24. 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.
  25. 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.
  26. 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.
  27. 05 May, 2019 8 commits
  28. 03 May, 2019 1 commit
    • Alexander Gramiak's avatar
      Refactor update_window_begin and update_window_end hooks · 9ae94ebd
      Alexander Gramiak authored
      * src/dispnew.c (gui_update_window_begin, gui_update_window_end): New
      procedures implementing common functionality.
      * src/nsterm.m: (ns_update_window_begin, ns_update_window_end):
      * src/xterm.c: (x_update_window_begin, x_update_window_end): Remove in
      favor of only using the new generic versions.
      * src/w32term.c: (w32_update_window_begin, w32_update_window_end):
      Remove duplicated and unused code.