• Alan Mackenzie's avatar
    First commit to scratch/follow. Make Isearch work with Follow Mode, etc. · 2c56fc2a
    Alan Mackenzie authored
    doc/lispref/window.texi (Basic Windows): Add paragraph defining "Group of
    Windows" and new @defun selected-window-group.
    (Window Start and End): Describe new &optional parameter GROUP and
    ...-group-function for window-start, window-end, set-window-start, and
    (Textual Scrolling) Describe the same for recenter.
    doc/lispref/positions.texi (Screen Lines): Describe the same for
    src/window.c (Fwindow_start, Fwindow_end, Fset_window_start)
    (Fpos_visible_in_window_p, Frecenter, Fmove_to_window_line): To each, add ar
    new optional parameter "group".  At the beginning of each, check whether the
    corresponding ...-group-function is set to a function, and if so execute this
    function in place of the normal processing.
    (syms_of_window): Define symbols for the six new variables below.
    (window-start-group-function, window-end-group-function)
    (set-window-start-group-function, recenter-group-function)
    (pos-visible-in-window-p-group-function, move-to-window-line-group-function):
    New permanent local buffer local variables.
    src/keyboard.c (Fposn_at_point): Add extra parameter in call to
    lisp/window.el (selected-window-group-function): New permanent local buffer
    local variable.
    (selected-window-group): New function.
    lisp/follow.el (follow-mode): Set the ...-group-function variables at mode
    enable, kill them at mode disable.  Add/remove follow-after-change to/from
    (follow-start-end-invalid): New variable.
    (follow-redisplay): Manipulate follow-start-end-invalid.
    (follow-after-change, follow-window-start, follow-window-end)
    (follow-set-window-start, follow-pos-visible-in-window-p)
    (follow-move-to-window-line, follow-sit-for): New functions.
    lisp/isearch.el (isearch-call-message): New macro.
    (isearch-update, with-isearch-suspended, isearch-del-char)
    (isearch-search-and-update, isearch-ring-adjust): Invoke above new macro.
    (with-isearch-suspended): Rearrange code such that isearch-call-message is
    invoked before point is moved.
    (isearch-message): Add comment about where point must be at function call.
    (isearch-search): Remove call to isearch-message.
    (isearch-lazy-highlight-window-group): New variable.
    (isearch-lazy-highlight-new-loop): Unconditionally start idle timer.  Move
    the battery of tests to ...
    (isearch-lazy-highlight-maybe-new-loop): New function, started by idle timer.
    Note: (sit-for 0) is still called.
    (isearch-lazy-highlight-update): Check membership of
    isearch-lazy-highlight-window-group.  Don't set the `window' overlay
    (isearch-update, isearch-done, isearch-string-out-of-window)
    (isearch-back-into-window, isearch-lazy-highlight-maybe-new-loop)
    (isearch-lazy-highlight-search, isearch-lazy-highlight-update)
    (isearch-lazy-highlight-update): Call the six amended primitives (see
    src/window.c above) with the new `group' argument set to t, to cooperate
    with Follow Mode.
keyboard.c 358 KB