1. 31 May, 2017 1 commit
  2. 30 May, 2017 1 commit
  3. 22 May, 2017 1 commit
  4. 21 May, 2017 1 commit
    • Alan Mackenzie's avatar
      Enhance mode-line percentage offset facility, with "%o" and "%q" · b0b02ca7
      Alan Mackenzie authored
      "%o" will display the percentage "travel" of the window through the buffer.
      "%q" will display a combination of the percentage offsets of the top and
      bottom of the window.  The new user option mode-line-percent-position will
      facilitate selecting a setting for this part of the mode line.
      * lisp/bindings.el (mode-line-percent-position): New customizable user option.
      (mode-line-position): Use mode-line-percent-position in place of "%p", etc.
      * src/xdisp.c (decode_mode_spec): Add handlers for "%o" and "%q".
      * doc/lispref/modes.texi (Mode Line Variables): Document
      (%-Constructs): Document %o and %q.
      * etc/NEWS: Add an entry for these new facilities.
  5. 20 May, 2017 1 commit
    • Eli Zaretskii's avatar
      Fix automatic hscrolling of only the current line · 1cbbecee
      Eli Zaretskii authored
      * src/xdisp.c (display_line): When hscrolling only the current
      line, increment iterator's first_visible_x and last_visible_x
      values to account for the hscroll.  This propagates the hscroll
      effect on the iterator geometry all the way down to the
      subroutines called by display_line, and avoids scrolling bugs
      under large hscroll values.  (Bug#26994)
  6. 18 May, 2017 1 commit
    • Eli Zaretskii's avatar
      Support hscrolling only the current line · 064b92d6
      Eli Zaretskii authored
      * src/xdisp.c (hscrolling_current_line_p): New function.
      (init_iterator): If auto-hscrolling just the current line, don't
      increment the iterator's first_visible_x and last_visible_x
      (hscroll_window_tree): Recompute window's hscroll when moving
      vertically to another screen line.
      (redisplay_window): If we are hscrolling only the current line,
      disable the optimizations that rely on the current matrix being
      (display_line): Accept an additional argument CURSOR_VPOS, the
      vertical position of the current screen line which might need
      hscrolling; all callers changed.  Compute first_visible_x and
      last_visible_x specially when auto-hscrolling current line, by
      repeating the calculation that is done in init_iterator in other
      (syms_of_xdisp) <auto-hscroll-mode>: No longer boolean, it can now
      accept a 3rd value 'current-line, to turn on the mode where
      only the current line is hscrolled.
      * etc/NEWS: Mention the new auto-hscroll-mode value.
  7. 10 May, 2017 1 commit
    • Perry E. Metzger's avatar
      Implement 1-based column numbering in mode line · 7df07779
      Perry E. Metzger authored
      * src/xdisp.c (decode_mode_spec): Implement the %C construct.
      * lisp/bindings.el (column-number-indicator-zero-based): New
      (mode-line-position): Use %C when
      column-number-indicator-zero-based is nil.
      * src/xdisp.c (syms_of_xdisp) <frame-title-format>:
      * src/buffer.c (syms_of_buffer) <mode-line-format>:
      * doc/lispref/modes.texi (%-Constructs):
      * doc/lispref/frames.texi (Frame Titles): Document the %C
      * doc/emacs/display.texi (Optional Mode Line): Document
      * etc/NEWS: Mention 'column-number-indicator-zero-based' and the
      %C construct.
  8. 07 May, 2017 1 commit
  9. 21 Apr, 2017 1 commit
  10. 12 Apr, 2017 2 commits
    • Martin Rudalics's avatar
      New internal-border face and args for select-window and x-focus-frame · c25005ed
      Martin Rudalics authored
      Add `internal-border' face and handle it whenever clearing the
      internal border.  If NORECORD equals the symbol
      'mark-for-redisplay', `select-window' will not record the window
      but still mark it for redisplay.  The new argument NOACTIVATE
      for `x-focus-frame' tries to not activate FRAME when set.
      * lisp/faces.el (internal-border): New face.
      * lisp/mwheel.el (mwheel-scroll): Select window to scroll with
      * lisp/scroll-bar.el (scroll-bar-drag)
      (scroll-bar-horizontal-drag, scroll-bar-scroll-down)
      (scroll-bar-scroll-up, scroll-bar-toolkit-scroll)
      (scroll-bar-toolkit-horizontal-scroll): Select window to scroll
      with `mark-for-redisplay'.
      * lisp/window.el (handle-select-window): When
      `focus-follows-mouse' is not 'auto-raise' try to not activate
      * src/dispextern.h (face_id): Add INTERNAL_BORDER_FACE_ID.
      * src/frame.c (Fx_focus_frame): New argument NOACTIVATE.
      * src/frame.h (x_focus_frame): Update extern declaration.
      * src/gtkutil.c (xg_clear_under_internal_border): Remove
      (xg_frame_resized, xg_frame_set_char_size): Call
      (xg_tool_bar_callback): Adapt x_focus_frame call.
      * src/gtkutil.h (xg_clear_under_internal_border): Remove
      * src/nsfns.m (x_focus_frame): Add argument NOACTIVATE.
      * src/w32fns.c (x_clear_under_internal_border): Fill border
      with internal-border background if specified.
      * src/w32term.h (x_clear_under_internal_border): Add extern
      * src/w32term.c (x_after_update_window_line): Fill border
      with internal-border background if specified.
      (w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar)
      (x_scroll_bar_clear, w32_read_socket): Call
      (x_focus_frame): New argument NOACTIVATE.
      * src/window.c (select_window): Mark WINDOW for redisplay when
      NORECORD equals 'mark-for-redisplay'.
      (Fselect_window): Update doc-string.
      (syms_of_window): Define Qmark_for_redisplay.
      * src/xdisp.c (clear_garbaged_frames, echo_area_display)
      (redisplay_internal): Call x_clear_under_internal_border.
      * src/xfaces.c (lookup_basic_face): Handle `window-divider'
      and `internal-border' faces.
      (realize_basic_faces): Realize `internal-border' face.
      (syms_of_xfaces): Define Qinternal_border.
      * src/xfns.c (x_set_internal_border_width): Remove call for
      (x_focus_frame): New argument NOACTIVATE.  When non-nil try to not
      activate frame.
      * src/xterm.c (x_fill_rectangle): No more static.
      (x_clear_under_internal_border, x_after_update_window_line):
      Fill border with internal-border background if specified.
      (xt_horizontal_action_hook): Rewrite.
      (handle_one_xevent): Call x_clear_under_internal_border.
      * src/xterm.h (x_fill_rectangle): Add extern declaration.
    • Martin Rudalics's avatar
      Add new frame parameters and associated functions · 3fdd3bb5
      Martin Rudalics authored
      Add new frame parameters `undecorated', `override-redirect',
      `parent-frame', `skip-taskbar', `no-focus-on-map',
      `no-accept-focus', `z-group', `delete-before', `no-other-frame',
      `mouse-wheel-frame', `min-width', `min-height'.  Add new
      functions `frame-restack' and `frame-list-z-order'.
      * lisp/cus-start.el (focus-follows-mouse): Adapt customization
      * lisp/frame.el (handle-delete-frame): Handle child and
      `delete-before' frames.
      (other-frame): Stop looking for other frame after one round.
      (frame-list-z-order, frame-restack): New functions.
      (delete-other-frames): Handle child frames.
      * lisp/frameset.el (frameset-persistent-filter-alist)
      (frameset--record-relationships): Handle `delete-before',
      `parent-frame' and `mouse-wheel-frame' parameters.  Rename
      latter from `frameset--record-minibuffer-relationships'.
      (frameset--restore-frame): Handle ‘parent-frame’ parameter
      (frameset-restore): Handle `delete-before', `parent-frame' and
      `mouse-wheel-frame' parameters.
      * lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
      * lisp/window.el (window--min-size-ignore-p): Fix doc-string.
      (mouse-autoselect-window-select, handle-select-window): Major
      rewrite.  Try to not ignore errors.  Handle auto-selection of
      child frames and different values of `focus-follows-mouse'.
      * src/frame.c (frame_windows_min_size): Handle new `min-width'
      and `min-height' frame parameters.
      (make_frame): Initialize new frame structure members.
      (do_switch_frame): Don't reset internal_last_event_frame for
      descendant frames.
      (Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
      (candidate_frame): Don't return `no-other-frame' frame.
      (other_frames): New function replacing other_visible_frames.
      (delete_frame): Rewrite.  Handle child and `delete-before' frames.
      (Fmake_frame_invisible): Call other_frames.
      (store_frame_param): Check `delete-before' and `parent-frame'
      parameters for circular dependencies.
      (frame_parms, syms_of_frame): Add entries for and define new
      frame parameters.
      (focus_follows_mouse): New meaningful value `auto-raise'.
      * src/frame.h (z_group): New enumeration type.
      (frame): New slots parent_frame, undecorated, override_redirect,
      skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
      (fset_parent_frame): New inlined function.
      (FRAME_Z_GROUP_BELOW): New macros.
      (frame_ancestor_p): Add declaration.
      * src/gtkutil.c (xg_create_frame_widgets): Handle
      `undecorated' and `override-redirect' frame parameters.
      (x_wm_set_size_hint): None for child frames.
      (xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
      (xg_set_no_focus_on_map, xg_set_no_accept_focus)
      (xg_set_override_redirect): New functions.
      (xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
      Don't let scrollbars obscure child frames.
      * src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
      (xg_set_skip_taskbar, xg_set_no_focus_on_map)
      (xg_set_no_accept_focus, xg_set_override_redirect): Add extern
      * src/nsfns.m (ns_frame_parm_handlers): Add entries for new
      frame parameters.
      (Fx_create_frame): Install `min-width' and `min-height' frame
      * src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
      * src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
      (x_real_positions): Handle child frames.
      (x_set_menu_bar_lines): Don't for child frames.
      (x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
      (x_set_no_focus_on_map, x_set_no_accept_focus)
      (x_set_z_group): New functions.
      (w32_createvscrollbar, w32_createhscrollbar): Don't draw
      scroll bars over child frames.
      (w32_createwindow): Handle new frame parameters and child frames.
      (w32_wnd_proc): Let mouse clicks into a child frame activate
      the frame.  Try to handle the `no-accept-focus' parameter.  Do
      SetFocus when our window is brought to top or becomes the
      foreground window.
      (w32_window): Don't initialize menu bar for child frames.
      (Fx_create_frame): Handle new frame parameters.
      (x_create_tip_frame): Set explicit_parent slot.
      (w32_dialog_in_progress): New function.
      (Fx_file_dialog): Handle `z-group-above' frames.
      (w32_frame_list_z_order, Fw32_frame_list_z_order)
      (w32_frame_restack, Fw32_frame_restack): New functions.
      (w32_frame_parm_handlers): Add entries for new frame
      * src/w32font.c (Fx_select_font): Handle `z-group-above'
      frames during font selection dialogue.
      * src/w32term.c (construct_mouse_wheel): Construct mouse wheel
      event from F's w32 window.
      (w32_mouse_position): Handle child frames.
      (w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
      Don't draw scroll bars over child frames.
      (w32_read_socket): Always erase background of child frames.
      When generating SELECT_WINDOW_EVENTs handle new value of
      `focus-follows-mouse' and handle `no-accept-focus' parameter.
      Handle `mouse-wheel-frame' parameter.
      (x_calc_absolute_position, x_set_offset, x_set_window_size):
      Handle child frames.
      (x_make_frame_visible): Handle child frames specially.  Handle
      `no-focus-on-map' parameter.
      * src/w32term.h (w32_dialog_in_progress): Add external
      * src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
      for child frames.
      * src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
      (PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
      non-Motif, non-GTK case.
      (x_real_pos_and_offsets): Handle child frames.
      (x_set_undecorated, x_set_parent_frame)
      (x_set_no_focus_on_map, x_set_no_accept_focus)
      (x_set_override_redirect): New functions.
      (x_set_menu_bar_lines): Not for child frames.
      (x_window): Handle `undecorated' and `override_redirect' cases.
      (Fx_create_frame): Handle new frame parameters.
      (frame_geometry): Handle child frames and outer border.
      (x_frame_list_z_order, Fx_frame_list_z_order)
      (x_frame_restack, Fx_frame_restack): New functions.
      (Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
      (x_frame_parm_handlers): Add entries for new frame parameters.
      * src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
      * src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
      for child frames.
      (XTmouse_position): Handle child frames.
      (x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
      bars obscure child frames.
      (handle_one_xevent): Handle child frame positions.  If necessary
      set `skip-taskbar' and reassign proper `z-group' when we are
      mapped.  When generating SELECT_WINDOW_EVENTs handle new value
      of `focus-follows-mouse'.  Handle `mouse-wheel-frame' parameter.
      Let mouse clicks into a child frame activate the frame.
      (x_calc_absolute_position, x_set_offset): Handle child frames
      (x_set_skip_taskbar, x_set_z_group): New functions.
      (x_make_frame_visible): Handle child frames.
      (ATOM_REFS_INIT): Add entries for
      Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
      * src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
      Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
      (x_set_skip_taskbar, x_set_z_group): Add extern declarations.
  11. 06 Apr, 2017 1 commit
  12. 26 Mar, 2017 1 commit
  13. 25 Mar, 2017 1 commit
    • Eli Zaretskii's avatar
      Fix a segfault due to failure to realize some faces · 8275687b
      Eli Zaretskii authored
      * src/xdisp.c (redisplay_internal): If the frame becomes garbaged
      while redisplaying its windows, redisplay all of its windows
      again.  (Bug#26097)
      (init_iterator): When freeing all realized faces on all frames,
      reset the 'face_change' flag of the frame whose window we are
      about to iterate.
  14. 17 Mar, 2017 1 commit
  15. 11 Mar, 2017 1 commit
  16. 06 Mar, 2017 1 commit
    • Eli Zaretskii's avatar
      A better fix for bug#25845 · eae5dcd5
      Eli Zaretskii authored
      * src/xdisp.c (font_for_underline_metrics): New function.
      * src/dispextern.h: Add its prototype.
      * src/xterm.c (x_draw_glyph_string):
      * src/w32term.c (x_draw_glyph_string):
      * src/nsterm.m (ns_draw_text_decoration): Call it.  This avoids
      having identical code 3 times in 3 different files.
  17. 02 Mar, 2017 3 commits
    • Paul Eggert's avatar
      Restore XFLOATINT but with restricted args · 56aaaf9b
      Paul Eggert authored
      Turn instances of extract_float into XFLOAT_DATA when possible,
      and to a resurrected XFLOATINT when the arg is a number.
      The resurrected XFLOATINT is more like XFLOAT and XINT in
      that is valid only if its arg is a number.  This clarifies
      the ways in which floats can be extracted at the C level.
      * src/editfns.c (styled_format):
      * src/floatfns.c (extract_float, Fexpt):
      Use XFLOATINT rather than open-coding it.
      * src/fns.c (internal_equal):
      * src/image.c (imagemagick_load_image):
      * src/xdisp.c (resize_mini_window):
      Prefer XFLOAT_DATA to extract_float on values known to be floats.
      * src/frame.c (x_set_screen_gamma):
      * src/frame.h (NUMVAL):
      * src/image.c (x_edge_detection, compute_image_size):
      * src/lread.c (read_filtered_event):
      * src/window.c (Fset_window_vscroll):
      * src/xdisp.c (handle_single_display_spec, try_scrolling)
      (redisplay_window, calc_pixel_width_or_height, x_produce_glyphs)
      Prefer XFLOATINT to extract_float on values known to be numbers.
      * src/lisp.h (XFLOATINT): Bring back this function, except
      it now assumes its argument is a number.
    • Paul Eggert's avatar
      Remove XFLOATINT · d0d26c13
      Paul Eggert authored
      * src/lisp.h (XFLOATINT): Remove this alias for extract_float.
      All callers changed to use extract_float.
      * src/frame.h (NUMVAL): Now an inline function, not a macro.
    • Eli Zaretskii's avatar
      Fix display of mouse-highlight produced by overlapping overlays · d546be31
      Eli Zaretskii authored
      * src/xfaces.c (face_at_buffer_position): If called to find the
      mouse-face, only consider the highest-priority source for that
      face, and ignore the rest.  Previously, all the mouse-face
      definitions at POS were merged in that case.
      * src/xdisp.c (note_mouse_highlight): Record the overlay that
      specifies mouse-face _after_ clearing the info about the previous
      overlay, so as not to clear the information about the just-recorded
      overlay.  (Bug#25906)
  18. 28 Feb, 2017 1 commit
  19. 27 Feb, 2017 1 commit
  20. 26 Feb, 2017 2 commits
  21. 25 Feb, 2017 2 commits
    • Eli Zaretskii's avatar
      Avoid leaving garbage on screen when using 'raise' display property · a3c9a554
      Eli Zaretskii authored
      * src/xdisp.c (display_line): Reset voffset value of the iterator
      when it hits ZV, to avoid "inheriting" it to glyph rows past ZV,
      which then leaves stuff on screen that needs to be cleared by
      redisplay.  (Bug#25855)
    • Noam Postavsky's avatar
      Fix scrolling with partial line corner case (Bug#25792) · f0e7f39e
      Noam Postavsky authored
      Also fix up the scrolling tests so that they don't make so many
      assumptions about the current window configuration.
      * src/xdisp.c (try_window): Take partial line height into account when
      comparing cursor position against scroll margin.
      * test/manual/scroll-tests.el (scroll-tests-with-buffer-window): Add
      HEIGHT argument, to allow setting up window with exact height and
      partial line.
      (scroll-tests-display-buffer-with-height): New display-buffer action
      (scroll-tests--scroll-margin-whole-window): Pass HEIGHT to
      (scroll-tests-conservative-show-trailing-whitespace): New test.
      (scroll-tests-scroll-margin-negative): Fix line counting.
      (scroll-tests--point-in-middle-of-window-p): Set window height
  22. 24 Feb, 2017 1 commit
    • Stefan Monnier's avatar
      Minor redisplay optimisations · dee86744
      Stefan Monnier authored
      * src/frame.c (Ficonify_frame): No need to redisplay everything.
      * src/xdisp.c (overlay_arrows_changed_p): Add `set_redisplay' argument.
      (redisplay_internal): Use it to avoid redisplaying everything.
      (try_window_id): Use it keep the same behavior as before.
  23. 10 Feb, 2017 2 commits
  24. 07 Feb, 2017 1 commit
  25. 05 Feb, 2017 1 commit
    • Paul Eggert's avatar
      Signal list cycles in ‘length’ etc. · 14dd9101
      Paul Eggert authored
      Use macros like FOR_EACH_TAIL instead of maybe_quit to
      catch list cycles automatically instead of relying on the
      user becoming impatient and typing C-g (Bug#25606).
      * src/fns.c (Flength, Fmember, Fmemq, Fmemql, Fassq, Fassoc, Frassq)
      (Frassoc, Fdelete, Freverse):
      Use FOR_EACH_TAIL instead of maybe_quit.
      (Fnreverse): Use simple EQ to check for circular list instead
      of rarely_quit, as this suffices in this unusual case.
      (Fplist_put, Flax_plist_put, Flax_plist_put):
      Use FOR_EACH_TAIL_CONS instead of maybe_quit.
      (internal_equal): Use FOR_EACH_TAIL_CONS to check lists, instead
      of by-hand tail recursion that did not catch cycles.
      * src/fns.c (Fsafe_length, Fplist_get):
      * src/xdisp.c (display_mode_element):
      Use FOR_EACH_TAIL_SAFE instead of by-hand Floyd’s algorithm.
      * src/lisp.h (QUIT_COUNT_HEURISTIC): Remove; no longer needed.
      (rarely_quit): Simply count toward USHRT_MAX + 1, since the
      fancier versions are no longer needed.
      (FOR_EACH_TAIL_INTERNAL): New macros, the last with definiens
      mostly taken from FOR_EACH_TAIL.
      (FOR_EACH_TAIL): Rewrite in terms of FOR_EACH_TAIL_INTERNAL.
  26. 03 Feb, 2017 3 commits
    • Noam Postavsky's avatar
      Fix scrolling with partial lines · b9be4c14
      Noam Postavsky authored
      * src/xdisp.c (partial_line_height): New function.
      * src/window.c (window_scroll_pixel_based): Use it for calculating the
      pixel scroll margin correctly in a window with partial lines.
    • Noam Postavsky's avatar
      Make limit on scroll-margin variable · e27a91cd
      Noam Postavsky authored
      * src/xdisp.c (maximum-scroll-margin): New variable.
      * lisp/cus-start.el: Make it customizable.
      * etc/NEWS: Mention it.
      * doc/emacs/display.texi (Auto Scrolling):
      * doc/lispref/windows.texi (Textual Scrolling): Document it.
      * src/window.c (window_scroll_pixel_based): Use it instead of hardcoding
      division by 4 (Bug #5718).
    • Noam Postavsky's avatar
      Refactor uses of scroll_margin to a function · d17e92da
      Noam Postavsky authored
      Its effective range needs to be clamped between 0 and (window height /
      4), so it's better to have this constraint in a single place.
      * src/window.c (window_scroll_margin): New function.
      (window_scroll_pixel_based, window_scroll_line_based):
      (Frecenter, Fmove_to_window_line):
      * src/xdisp.c (try_scrolling, try_cursor_movement):
      (redisplay_window, try_window, try_window_id): Use it.
  27. 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.
  28. 01 Jan, 2017 1 commit
  29. 31 Dec, 2016 2 commits
  30. 23 Dec, 2016 1 commit
  31. 03 Dec, 2016 1 commit
    • Noam Postavsky's avatar
      Ensure redisplay using variable watcher · d3faef9b
      Noam Postavsky authored
      This replaces looking up the variable name in redisplay--variables when
      setting it.
      * lisp/frame.el: Replace redisplay--variables with add-variable-watcher
      * src/xdisp.c (Fset_buffer_redisplay): Rename from maybe_set_redisplay,
      set the redisplay flag unconditionally.
      (Vredisplay__variables): Remove it.
      * src/data.c (set_internal): Remove maybe_set_redisplay call.