aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAlan Mackenzie2015-12-14 16:38:07 +0000
committerAlan Mackenzie2015-12-14 16:38:07 +0000
commite8937de5547a687b6d03199368645f168cb8ad37 (patch)
tree7b974d1ed2470576d1f7649a25b0a0af76eaf4c8 /doc
parent3194f1ccd99cfd13ddaf621d6e7f1e1aa1645165 (diff)
downloademacs-e8937de5547a687b6d03199368645f168cb8ad37.tar.gz
emacs-e8937de5547a687b6d03199368645f168cb8ad37.zip
Replace GROUP argument in six window primitives by new functions.
* doc/lispref/windows.texi (Window Start and End, Textual Scrolling) * doc/lispref/positions.texi (Screen Lines): Remove optional GROUP argument from description of six window functions. Add in description of new functions window-group-start, window-group-end, set-window-group-start, pos-visible-in-window-group-p, recenter-group and move-to-window-group-line, together with the six variables indirecting to the pertinent group functions. * src/window.c * src/keyboard.c: Revert the commit from 2015-11-11 12:02:48, in so far as it applies to these two files, which added the GROUP argument to six window primitives. * lisp/follow.el (follow-mode): Use updated variable names for the indirected functions. * lisp/isearch.el (isearch-update, isearch-done, isearch-string-out-of-window) (isearch-back-into-window, isearch-lazy-highlight-new-loop) (isearch-lazy-highlight-search, isearch-lazy-highlight-update): Replace calls to window primitives (e.g. window-start) with a GROUP argument by calls to new functions (e.g. window-group-start). * lisp/ispell.el (ispell-command-loop): Replace call to pos-visible-in-window-p with pos-visible-in-window-group-p. * lisp/window.el (window-group-start, window-group-end) (set-window-group-start, recenter-group, pos-visible-in-window-group-p) (selected-window-group, move-to-window-group-line): New functions. (window-group-start-function, window-group-end-function) (set-window-group-start-function, recenter-group-function) (pos-visible-in-window-group-p-function, selected-window-group-function) (move-to-window-group-line-function): New variables.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/positions.texi26
-rw-r--r--doc/lispref/windows.texi116
2 files changed, 76 insertions, 66 deletions
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi
index e0496e30848..090eb4598a8 100644
--- a/doc/lispref/positions.texi
+++ b/doc/lispref/positions.texi
@@ -551,8 +551,7 @@ 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 group 554@deffn Command move-to-window-line count
555@vindex move-to-window-line-group-function
556This function moves point with respect to the text currently displayed 555This function moves point with respect to the text currently displayed
557in the selected window. It moves point to the beginning of the screen 556in the selected window. It moves point to the beginning of the screen
558line @var{count} screen lines from the top of the window. If 557line @var{count} screen lines from the top of the window. If
@@ -571,18 +570,21 @@ In an interactive call, @var{count} is the numeric prefix argument.
571 570
572The value returned is the window line number point has moved to, with 571The value returned is the window line number point has moved to, with
573the top line in the window numbered 0. 572the 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.
584@end deffn 573@end deffn
585 574
575@vindex move-to-window-group-line-function
576@defun move-to-window-group-line count
577This function is like @code{move-to-window-line}, except that when the
578selected window is a part of a group of windows (@pxref{Basic
579Windows}), @code{move-to-window-group-line} will move to a position
580with respect to the entire group, not just the single window. This
581condition holds when the buffer local variable
582@code{move-to-window-group-line-function} is set to a function. In
583this case, @code{move-to-window-group-line} calls the function with
584the argument @var{count}, then returns its result. The argument has
585the same meaning as in @code{move-to-window-line}.
586@end defun
587
586@defun compute-motion from frompos to topos width offsets window 588@defun compute-motion from frompos to topos width offsets window
587This function scans the current buffer, calculating screen positions. 589This function scans the current buffer, calculating screen positions.
588It scans the buffer forward from position @var{from}, assuming that is 590It scans the buffer forward from position @var{from}, assuming that is
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index f92289f51a4..45899588c32 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -3104,8 +3104,7 @@ using the commands of Lisp mode, because they trigger this
3104readjustment. To test such code, put it into a command and bind the 3104readjustment. To test such code, put it into a command and bind the
3105command to a key. 3105command to a key.
3106 3106
3107@defun window-start &optional window group 3107@defun window-start &optional window
3108@vindex window-start-group-function
3109@cindex window top line 3108@cindex window top line
3110This function returns the display-start position of window 3109This function returns the display-start position of window
3111@var{window}. If @var{window} is @code{nil}, the selected window is 3110@var{window}. If @var{window} is @code{nil}, the selected window is
@@ -3121,20 +3120,22 @@ it explicitly since the previous redisplay)---to make sure point appears
3121on the screen. Nothing except redisplay automatically changes the 3120on the screen. Nothing except redisplay automatically changes the
3122window-start position; if you move point, do not expect the window-start 3121window-start position; if you move point, do not expect the window-start
3123position to change in response until after the next redisplay. 3122position to change in response until after the next redisplay.
3123@end defun
3124 3124
3125If @var{group} is non-@code{nil}, and @var{window} is a part of a 3125@defun window-group-start &optional window
3126group of windows (@pxref{Basic Windows}), @code{window-start} returns 3126@vindex window-group-start-function
3127the start position of the entire group. This condition holds when the 3127This function is like @code{window-start}, except that when
3128buffer local variable @code{window-start-group-function} is set to a 3128@var{window} is a part of a group of windows (@pxref{Basic Windows}),
3129function. In this case, @code{window-start} calls the function with 3129@code{window-group-start} returns the start position of the entire
3130the single argument @var{window}, then returns its result, instead of 3130group. This condition holds when the buffer local variable
3131performing the actions described above. Typically, the function will 3131@code{window-group-start-function} is set to a function. In this
3132call @code{window-start} recursively. 3132case, @code{window-group-start} calls the function with the single
3133argument @var{window}, then returns its result. The argument to this
3134function has the same meaning as in @code{window-start}.
3133@end defun 3135@end defun
3134 3136
3135@vindex window-end-group-function
3136@cindex window end position 3137@cindex window end position
3137@defun window-end &optional window update group 3138@defun window-end &optional window update
3138This function returns the position where display of its buffer ends in 3139This function returns the position where display of its buffer ends in
3139@var{window}. The default for @var{window} is the selected window. 3140@var{window}. The default for @var{window} is the selected window.
3140 3141
@@ -3157,19 +3158,21 @@ attempt to scroll the display if point has moved off the screen, the
3157way real redisplay would do. It does not alter the 3158way real redisplay would do. It does not alter the
3158@code{window-start} value. In effect, it reports where the displayed 3159@code{window-start} value. In effect, it reports where the displayed
3159text will end if scrolling is not required. 3160text will end if scrolling is not required.
3161@end defun
3160 3162
3161If @var{group} is non-@code{nil}, and @var{window} is a part of a 3163@vindex window-group-end-function
3162group of windows (@pxref{Basic Windows}), `window-end' returns the end 3164@defun window-group-end window update
3163position of the entire group. This condition holds when the buffer 3165This function is like @code{window-end}, except that when @var{window}
3164local variable @code{window-end-group-function} is set to a function. 3166is a part of a group of windows (@pxref{Basic Windows}),
3165In this case, @code{window-end} calls the function with the two 3167@code{window-group-end} returns the end position of the entire group.
3166arguments @var{window} and @var{update}, then returns its result, 3168This condition holds when the buffer local variable
3167instead of performing the actions described above. Typically, the 3169@code{window-group-end-function} is set to a function. In this case,
3168function will call @code{window-end} recursively. 3170@code{window-group-end} calls the function with the two arguments
3171@var{window} and @var{update}, then returns its result. The arguments
3172to this function have the same meaning as in @code{window-end}.
3169@end defun 3173@end defun
3170 3174
3171@vindex set-window-start-group-function 3175@defun set-window-start window position &optional noforce
3172@defun set-window-start window position &optional noforce group
3173This function sets the display-start position of @var{window} to 3176This function sets the display-start position of @var{window} to
3174@var{position} in @var{window}'s buffer. It returns @var{position}. 3177@var{position} in @var{window}'s buffer. It returns @var{position}.
3175 3178
@@ -3230,20 +3233,22 @@ it is still 1 when redisplay occurs. Here is an example:
3230If @var{noforce} is non-@code{nil}, and @var{position} would place point 3233If @var{noforce} is non-@code{nil}, and @var{position} would place point
3231off screen at the next redisplay, then redisplay computes a new window-start 3234off screen at the next redisplay, then redisplay computes a new window-start
3232position that works well with point, and thus @var{position} is not used. 3235position that works well with point, and thus @var{position} is not used.
3236@end defun
3233 3237
3234If @var{group} is non-@code{nil}, and @var{window} is a part of a 3238@vindex set-window-group-start-function
3235group of windows (@pxref{Basic Windows}), @code{set-window-start} sets 3239@defun set-window-group-start window position &optional noforce
3236the start position of the entire group. This condition holds when the 3240This function is like @code{set-window-start}, except that when
3237buffer local variable @code{set-window-start-group-function} is set to 3241@var{window} is a part of a group of windows (@pxref{Basic Windows}),
3238a function. In this case, @code{set-window-start} calls the function 3242@code{set-window-group-start} sets the start position of the entire
3239with the three arguments @var{window}, @var{position}, and 3243group. This condition holds when the buffer local variable
3240@var{noforce}, then returns its result, instead of performing the 3244@code{set-window-group-start-function} is set to a function. In this
3241actions described above. Typically, the function will call 3245case, @code{set-window-group-start} calls the function with the three
3242@code{set-window-start} recursively. 3246arguments @var{window}, @var{position}, and @var{noforce}, then
3247returns its result. The arguments in this function have the same
3248meaning as in @code{set-window-start}.
3243@end defun 3249@end defun
3244 3250
3245@defun pos-visible-in-window-p &optional position window partially group 3251@defun pos-visible-in-window-p &optional position window partially
3246@vindex pos-visible-in-window-p-group-function
3247This function returns non-@code{nil} if @var{position} is within the 3252This function returns non-@code{nil} if @var{position} is within the
3248range of text currently visible on the screen in @var{window}. It 3253range of text currently visible on the screen in @var{window}. It
3249returns @code{nil} if @var{position} is scrolled vertically out of 3254returns @code{nil} if @var{position} is scrolled vertically out of
@@ -3282,18 +3287,19 @@ Here is an example:
3282 (recenter 0)) 3287 (recenter 0))
3283@end group 3288@end group
3284@end example 3289@end example
3290@end defun
3285 3291
3286If @var{group} is non-@code{nil}, and @var{window} is a part of a 3292@vindex pos-visible-in-window-group-p-function
3287group of windows (@pxref{Basic Windows}), 3293@defun pos-visible-in-window-group-p &optional position window partially
3288@code{pos-visible-in-window-p} tests the visibility of @var{pos} in 3294This function is like @code{pos-visible-in-window-p}, except that when
3289the entire group, not just in the single @var{window}. This condition 3295@var{window} is a part of a group of windows (@pxref{Basic Windows}),
3290holds when the buffer local variable 3296@code{pos-visible-in-window-group-p} tests the visibility of @var{pos}
3291@code{pos-visible-in-window-p-group-function} is set to a function. 3297in the entire group, not just in the single @var{window}. This
3292In this case @code{pos-visible-in-window-p} calls the function with 3298condition holds when the buffer local variable
3293the three arguments @var{position}, @var{window}, and @var{partially}, 3299@code{pos-visible-in-window-group-p-function} is set to a function.
3294then returns its result, instead of performing the actions described 3300In this case @code{pos-visible-in-window-group-p} calls the function
3295above. Typically, the function will call 3301with the three arguments @var{position}, @var{window}, and
3296@code{pos-visible-in-window-p} recursively. 3302@var{partially}, then returns its result.
3297@end defun 3303@end defun
3298 3304
3299@defun window-line-height &optional line window 3305@defun window-line-height &optional line window
@@ -3511,8 +3517,7 @@ beginning or end of the buffer (depending on scrolling direction);
3511only if point is already on that position do they signal an error. 3517only if point is already on that position do they signal an error.
3512@end defopt 3518@end defopt
3513 3519
3514@deffn Command recenter &optional count group 3520@deffn Command recenter &optional count
3515@vindex recenter-group-function
3516@cindex centering point 3521@cindex centering point
3517This function scrolls the text in the selected window so that point is 3522This function scrolls the text in the selected window so that point is
3518displayed at a specified vertical position within the window. It does 3523displayed at a specified vertical position within the window. It does
@@ -3529,14 +3534,6 @@ If @var{count} is @code{nil} (or a non-@code{nil} list),
3529window. If @var{count} is @code{nil}, this function may redraw the 3534window. If @var{count} is @code{nil}, this function may redraw the
3530frame, according to the value of @code{recenter-redisplay}. 3535frame, according to the value of @code{recenter-redisplay}.
3531 3536
3532If @var{group} is non-@code{nil}, and the selected window is part of a
3533group of windows (@pxref{Basic Windows}), @code{recenter} scrolls the
3534entire group. This condition holds when the buffer local variable
3535@code{recenter-group-function} is set to a function. In this case,
3536@code{recenter} calls the function with the argument @var{count}, then
3537returns its result, instead of performing the actions described above.
3538Typically, the function will call @code{recenter} recursively.
3539
3540When @code{recenter} is called interactively, @var{count} is the raw 3537When @code{recenter} is called interactively, @var{count} is the raw
3541prefix argument. Thus, typing @kbd{C-u} as the prefix sets the 3538prefix argument. Thus, typing @kbd{C-u} as the prefix sets the
3542@var{count} to a non-@code{nil} list, while typing @kbd{C-u 4} sets 3539@var{count} to a non-@code{nil} list, while typing @kbd{C-u 4} sets
@@ -3548,6 +3545,17 @@ the top of the window. The command @code{recenter-top-bottom} offers
3548a more convenient way to achieve this. 3545a more convenient way to achieve this.
3549@end deffn 3546@end deffn
3550 3547
3548@vindex recenter-group-function
3549@defun recenter-group &optional count
3550This function is like @code{recenter}, except that when the selected
3551window is part of a group of windows (@pxref{Basic Windows}),
3552@code{recenter-group} scrolls the entire group. This condition holds
3553when the buffer local variable @code{recenter-group-function} is set
3554to a function. In this case, @code{recenter-group} calls the function
3555with the argument @var{count}, then returns its result. The argument
3556has the same meaning as in @code{recenter}.
3557@end defun
3558
3551@defopt recenter-redisplay 3559@defopt recenter-redisplay
3552If this variable is non-@code{nil}, calling @code{recenter} with a 3560If this variable is non-@code{nil}, calling @code{recenter} with a
3553@code{nil} argument redraws the frame. The default value is 3561@code{nil} argument redraws the frame. The default value is