aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAlan Mackenzie2015-11-11 12:02:48 +0000
committerAlan Mackenzie2015-11-11 12:02:48 +0000
commit2c56fc2a3f106a1286ad793eed9bfaafd09a7411 (patch)
tree6082e9df4733fb39a9d1423568a703c93f7ead62 /doc
parent25775a12c5168b0494dff15639ac25d8e1017530 (diff)
downloademacs-2c56fc2a3f106a1286ad793eed9bfaafd09a7411.tar.gz
emacs-2c56fc2a3f106a1286ad793eed9bfaafd09a7411.zip
First commit to scratch/follow. Make Isearch work with Follow Mode, etc.
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 pos-visible-in-window-p. (Textual Scrolling) Describe the same for recenter. doc/lispref/positions.texi (Screen Lines): Describe the same for move-to-window-line. 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 Fpos_visible_in_window_p. 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 after-change-functions. (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 property. (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.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/positions.texi13
-rw-r--r--doc/lispref/windows.texi87
2 files changed, 94 insertions, 6 deletions
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi
index 72b76ce5c8f..e0496e30848 100644
--- a/doc/lispref/positions.texi
+++ b/doc/lispref/positions.texi
@@ -551,7 +551,8 @@ current buffer, regardless of which buffer is displayed in
551any buffer, whether or not it is currently displayed in some window. 551any buffer, whether or not it is currently displayed in some window.
552@end defun 552@end defun
553 553
554@deffn Command move-to-window-line count 554@deffn Command move-to-window-line count group
555@vindex move-to-window-line-group-function
555This function moves point with respect to the text currently displayed 556This function moves point with respect to the text currently displayed
556in the selected window. It moves point to the beginning of the screen 557in the selected window. It moves point to the beginning of the screen
557line @var{count} screen lines from the top of the window. If 558line @var{count} screen lines from the top of the window. If
@@ -570,6 +571,16 @@ In an interactive call, @var{count} is the numeric prefix argument.
570 571
571The value returned is the window line number point has moved to, with 572The value returned is the window line number point has moved to, with
572the top line in the window numbered 0. 573the top line in the window numbered 0.
574
575If @var{group} is non-@code{nil}, and the selected window is a part of
576a group of windows (@pxref{Basic Windows}), @code{move-to-window-line}
577will move to a position with respect to the entire group, not just the
578single window. This condition holds when the buffer local variable
579@code{move-to-window-line-group-function} is set to a function. In
580this case, @code{move-to-window-line} calls the function with the
581argument @var{count}, then returns its result, instead of performing
582the actions described above. Typically, the function will call
583@code{move-to-window-line} recursively.
573@end deffn 584@end deffn
574 585
575@defun compute-motion from frompos to topos width offsets window 586@defun compute-motion from frompos to topos width offsets window
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 357247ef433..832ced719cd 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -133,6 +133,30 @@ This function returns the selected window (which is always a live
133window). 133window).
134@end defun 134@end defun
135 135
136 Sometimes several windows collectively and cooperatively display a
137buffer, for example, under the management of Follow Mode, where the
138windows together display a bigger portion of the buffer than one
139window could alone. It is often useful to consider such a @dfn{group
140of windows} as a single entity. Several functions such as
141@code{window-start} (@pxref{Window Start and End}) allow you to do
142this by supplying, as an argument, one of the windows as a stand in
143for the whole group.
144
145@defun selected-window-group
146@vindex selected-window-group-function
147When the selected window is a member of a group of windows, this
148function returns a list of the windows in the group, ordered such that
149the first window in the list is displaying the earliest part of the
150buffer, and so on. Otherwise the function returns a list containing
151just the selected window.
152
153The selected window is considered part of a group when the buffer
154local variable @code{selected-window-group-function} is set to a
155function. In this case, @code{selected-window-group} calls it with no
156arguments and returns its result (which should be the list of windows
157in the group).
158@end defun
159
136@node Windows and Frames 160@node Windows and Frames
137@section Windows and Frames 161@section Windows and Frames
138 162
@@ -3064,7 +3088,8 @@ using the commands of Lisp mode, because they trigger this
3064readjustment. To test such code, put it into a command and bind the 3088readjustment. To test such code, put it into a command and bind the
3065command to a key. 3089command to a key.
3066 3090
3067@defun window-start &optional window 3091@defun window-start &optional window group
3092@vindex window-start-group-function
3068@cindex window top line 3093@cindex window top line
3069This function returns the display-start position of window 3094This function returns the display-start position of window
3070@var{window}. If @var{window} is @code{nil}, the selected window is 3095@var{window}. If @var{window} is @code{nil}, the selected window is
@@ -3080,10 +3105,20 @@ it explicitly since the previous redisplay)---to make sure point appears
3080on the screen. Nothing except redisplay automatically changes the 3105on the screen. Nothing except redisplay automatically changes the
3081window-start position; if you move point, do not expect the window-start 3106window-start position; if you move point, do not expect the window-start
3082position to change in response until after the next redisplay. 3107position to change in response until after the next redisplay.
3108
3109If @var{group} is non-@code{nil}, and @var{window} is a part of a
3110group of windows (@pxref{Basic Windows}), @code{window-start} returns
3111the start position of the entire group. This condition holds when the
3112buffer local variable @code{window-start-group-function} is set to a
3113function. In this case, @code{window-start} calls the function with
3114the single argument @var{window}, then returns its result, instead of
3115performing the actions described above. Typically, the function will
3116call @code{window-start} recursively.
3083@end defun 3117@end defun
3084 3118
3119@vindex window-end-group-function
3085@cindex window end position 3120@cindex window end position
3086@defun window-end &optional window update 3121@defun window-end &optional window update group
3087This function returns the position where display of its buffer ends in 3122This function returns the position where display of its buffer ends in
3088@var{window}. The default for @var{window} is the selected window. 3123@var{window}. The default for @var{window} is the selected window.
3089 3124
@@ -3106,9 +3141,19 @@ attempt to scroll the display if point has moved off the screen, the
3106way real redisplay would do. It does not alter the 3141way real redisplay would do. It does not alter the
3107@code{window-start} value. In effect, it reports where the displayed 3142@code{window-start} value. In effect, it reports where the displayed
3108text will end if scrolling is not required. 3143text will end if scrolling is not required.
3144
3145If @var{group} is non-@code{nil}, and @var{window} is a part of a
3146group of windows (@pxref{Basic Windows}), `window-end' returns the end
3147position of the entire group. This condition holds when the buffer
3148local variable @code{window-end-group-function} is set to a function.
3149In this case, @code{window-end} calls the function with the two
3150arguments @var{window} and @var{update}, then returns its result,
3151instead of performing the actions described above. Typically, the
3152function will call @code{window-end} recursively.
3109@end defun 3153@end defun
3110 3154
3111@defun set-window-start window position &optional noforce 3155@vindex set-window-start-group-function
3156@defun set-window-start window position &optional noforce group
3112This function sets the display-start position of @var{window} to 3157This function sets the display-start position of @var{window} to
3113@var{position} in @var{window}'s buffer. It returns @var{position}. 3158@var{position} in @var{window}'s buffer. It returns @var{position}.
3114 3159
@@ -3169,9 +3214,20 @@ it is still 1 when redisplay occurs. Here is an example:
3169If @var{noforce} is non-@code{nil}, and @var{position} would place point 3214If @var{noforce} is non-@code{nil}, and @var{position} would place point
3170off screen at the next redisplay, then redisplay computes a new window-start 3215off screen at the next redisplay, then redisplay computes a new window-start
3171position that works well with point, and thus @var{position} is not used. 3216position that works well with point, and thus @var{position} is not used.
3217
3218If @var{group} is non-@code{nil}, and @var{window} is a part of a
3219group of windows (@pxref{Basic Windows}), @code{set-window-start} sets
3220the start position of the entire group. This condition holds when the
3221buffer local variable @code{set-window-start-group-function} is set to
3222a function. In this case, @code{set-window-start} calls the function
3223with the three arguments @var{window}, @var{position}, and
3224@var{noforce}, then returns its result, instead of performing the
3225actions described above. Typically, the function will call
3226@code{set-window-start} recursively.
3172@end defun 3227@end defun
3173 3228
3174@defun pos-visible-in-window-p &optional position window partially 3229@defun pos-visible-in-window-p &optional position window partially group
3230@vindex pos-visible-in-window-p-group-function
3175This function returns non-@code{nil} if @var{position} is within the 3231This function returns non-@code{nil} if @var{position} is within the
3176range of text currently visible on the screen in @var{window}. It 3232range of text currently visible on the screen in @var{window}. It
3177returns @code{nil} if @var{position} is scrolled vertically out of 3233returns @code{nil} if @var{position} is scrolled vertically out of
@@ -3210,6 +3266,18 @@ Here is an example:
3210 (recenter 0)) 3266 (recenter 0))
3211@end group 3267@end group
3212@end example 3268@end example
3269
3270If @var{group} is non-@code{nil}, and @var{window} is a part of a
3271group of windows (@pxref{Basic Windows}),
3272@code{pos-visible-in-window-p} tests the visibility of @var{pos} in
3273the entire group, not just in the single @var{window}. This condition
3274holds when the buffer local variable
3275@code{pos-visible-in-window-p-group-function} is set to a function.
3276In this case @code{pos-visible-in-window-p} calls the function with
3277the three arguments @var{position}, @var{window}, and @var{partially},
3278then returns its result, instead of performing the actions described
3279above. Typically, the function will call
3280@code{pos-visible-in-window-p} recursively.
3213@end defun 3281@end defun
3214 3282
3215@defun window-line-height &optional line window 3283@defun window-line-height &optional line window
@@ -3427,7 +3495,8 @@ beginning or end of the buffer (depending on scrolling direction);
3427only if point is already on that position do they signal an error. 3495only if point is already on that position do they signal an error.
3428@end defopt 3496@end defopt
3429 3497
3430@deffn Command recenter &optional count 3498@deffn Command recenter &optional count group
3499@vindex recenter-group-function
3431@cindex centering point 3500@cindex centering point
3432This function scrolls the text in the selected window so that point is 3501This function scrolls the text in the selected window so that point is
3433displayed at a specified vertical position within the window. It does 3502displayed at a specified vertical position within the window. It does
@@ -3444,6 +3513,14 @@ If @var{count} is @code{nil} (or a non-@code{nil} list),
3444window. If @var{count} is @code{nil}, this function may redraw the 3513window. If @var{count} is @code{nil}, this function may redraw the
3445frame, according to the value of @code{recenter-redisplay}. 3514frame, according to the value of @code{recenter-redisplay}.
3446 3515
3516If @var{group} is non-@code{nil}, and the selected window is part of a
3517group of windows (@pxref{Basic Windows}), @code{recenter} scrolls the
3518entire group. This condition holds when the buffer local variable
3519@code{recenter-group-function} is set to a function. In this case,
3520@code{recenter} calls the function with the argument @var{count}, then
3521returns its result, instead of performing the actions described above.
3522Typically, the function will call @code{recenter} recursively.
3523
3447When @code{recenter} is called interactively, @var{count} is the raw 3524When @code{recenter} is called interactively, @var{count} is the raw
3448prefix argument. Thus, typing @kbd{C-u} as the prefix sets the 3525prefix argument. Thus, typing @kbd{C-u} as the prefix sets the
3449@var{count} to a non-@code{nil} list, while typing @kbd{C-u 4} sets 3526@var{count} to a non-@code{nil} list, while typing @kbd{C-u 4} sets