diff options
author | Alan Mackenzie <acm@muc.de> | 2015-12-14 16:38:07 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2015-12-14 16:38:07 +0000 |
commit | e8937de5547a687b6d03199368645f168cb8ad37 (patch) | |
tree | 7b974d1ed2470576d1f7649a25b0a0af76eaf4c8 /doc | |
parent | 3194f1ccd99cfd13ddaf621d6e7f1e1aa1645165 (diff) | |
download | emacs-e8937de5547a687b6d03199368645f168cb8ad37.tar.gz |
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.texi | 26 | ||||
-rw-r--r-- | doc/lispref/windows.texi | 116 |
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 any buffer, whether or not it is currently displayed in some window. @end defun -@deffn Command move-to-window-line count group -@vindex move-to-window-line-group-function +@deffn Command move-to-window-line count This function moves point with respect to the text currently displayed in the selected window. It moves point to the beginning of the screen line @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. The value returned is the window line number point has moved to, with the top line in the window numbered 0. - -If @var{group} is non-@code{nil}, and the selected window is a part of -a group of windows (@pxref{Basic Windows}), @code{move-to-window-line} -will move to a position with respect to the entire group, not just the -single window. This condition holds when the buffer local variable -@code{move-to-window-line-group-function} is set to a function. In -this case, @code{move-to-window-line} calls the function with the -argument @var{count}, then returns its result, instead of performing -the actions described above. Typically, the function will call -@code{move-to-window-line} recursively. @end deffn +@vindex move-to-window-group-line-function +@defun move-to-window-group-line count +This function is like @code{move-to-window-line}, except that when the +selected window is a part of a group of windows (@pxref{Basic +Windows}), @code{move-to-window-group-line} will move to a position +with respect to the entire group, not just the single window. This +condition holds when the buffer local variable +@code{move-to-window-group-line-function} is set to a function. In +this case, @code{move-to-window-group-line} calls the function with +the argument @var{count}, then returns its result. The argument has +the same meaning as in @code{move-to-window-line}. +@end defun + @defun compute-motion from frompos to topos width offsets window This function scans the current buffer, calculating screen positions. It 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 readjustment. To test such code, put it into a command and bind the command to a key. -@defun window-start &optional window group -@vindex window-start-group-function +@defun window-start &optional window @cindex window top line This function returns the display-start position of window @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 on the screen. Nothing except redisplay automatically changes the window-start position; if you move point, do not expect the window-start position to change in response until after the next redisplay. +@end defun -If @var{group} is non-@code{nil}, and @var{window} is a part of a -group of windows (@pxref{Basic Windows}), @code{window-start} returns -the start position of the entire group. This condition holds when the -buffer local variable @code{window-start-group-function} is set to a -function. In this case, @code{window-start} calls the function with -the single argument @var{window}, then returns its result, instead of -performing the actions described above. Typically, the function will -call @code{window-start} recursively. +@defun window-group-start &optional window +@vindex window-group-start-function +This function is like @code{window-start}, except that when +@var{window} is a part of a group of windows (@pxref{Basic Windows}), +@code{window-group-start} returns the start position of the entire +group. This condition holds when the buffer local variable +@code{window-group-start-function} is set to a function. In this +case, @code{window-group-start} calls the function with the single +argument @var{window}, then returns its result. The argument to this +function has the same meaning as in @code{window-start}. @end defun -@vindex window-end-group-function @cindex window end position -@defun window-end &optional window update group +@defun window-end &optional window update This function returns the position where display of its buffer ends in @var{window}. The default for @var{window} is the selected window. @@ -3157,19 +3158,21 @@ attempt to scroll the display if point has moved off the screen, the way real redisplay would do. It does not alter the @code{window-start} value. In effect, it reports where the displayed text will end if scrolling is not required. +@end defun -If @var{group} is non-@code{nil}, and @var{window} is a part of a -group of windows (@pxref{Basic Windows}), `window-end' returns the end -position of the entire group. This condition holds when the buffer -local variable @code{window-end-group-function} is set to a function. -In this case, @code{window-end} calls the function with the two -arguments @var{window} and @var{update}, then returns its result, -instead of performing the actions described above. Typically, the -function will call @code{window-end} recursively. +@vindex window-group-end-function +@defun window-group-end window update +This function is like @code{window-end}, except that when @var{window} +is a part of a group of windows (@pxref{Basic Windows}), +@code{window-group-end} returns the end position of the entire group. +This condition holds when the buffer local variable +@code{window-group-end-function} is set to a function. In this case, +@code{window-group-end} calls the function with the two arguments +@var{window} and @var{update}, then returns its result. The arguments +to this function have the same meaning as in @code{window-end}. @end defun -@vindex set-window-start-group-function -@defun set-window-start window position &optional noforce group +@defun set-window-start window position &optional noforce This function sets the display-start position of @var{window} to @var{position} in @var{window}'s buffer. It returns @var{position}. @@ -3230,20 +3233,22 @@ it is still 1 when redisplay occurs. Here is an example: If @var{noforce} is non-@code{nil}, and @var{position} would place point off screen at the next redisplay, then redisplay computes a new window-start position that works well with point, and thus @var{position} is not used. +@end defun -If @var{group} is non-@code{nil}, and @var{window} is a part of a -group of windows (@pxref{Basic Windows}), @code{set-window-start} sets -the start position of the entire group. This condition holds when the -buffer local variable @code{set-window-start-group-function} is set to -a function. In this case, @code{set-window-start} calls the function -with the three arguments @var{window}, @var{position}, and -@var{noforce}, then returns its result, instead of performing the -actions described above. Typically, the function will call -@code{set-window-start} recursively. +@vindex set-window-group-start-function +@defun set-window-group-start window position &optional noforce +This function is like @code{set-window-start}, except that when +@var{window} is a part of a group of windows (@pxref{Basic Windows}), +@code{set-window-group-start} sets the start position of the entire +group. This condition holds when the buffer local variable +@code{set-window-group-start-function} is set to a function. In this +case, @code{set-window-group-start} calls the function with the three +arguments @var{window}, @var{position}, and @var{noforce}, then +returns its result. The arguments in this function have the same +meaning as in @code{set-window-start}. @end defun -@defun pos-visible-in-window-p &optional position window partially group -@vindex pos-visible-in-window-p-group-function +@defun pos-visible-in-window-p &optional position window partially This function returns non-@code{nil} if @var{position} is within the range of text currently visible on the screen in @var{window}. It returns @code{nil} if @var{position} is scrolled vertically out of @@ -3282,18 +3287,19 @@ Here is an example: (recenter 0)) @end group @end example +@end defun -If @var{group} is non-@code{nil}, and @var{window} is a part of a -group of windows (@pxref{Basic Windows}), -@code{pos-visible-in-window-p} tests the visibility of @var{pos} in -the entire group, not just in the single @var{window}. This condition -holds when the buffer local variable -@code{pos-visible-in-window-p-group-function} is set to a function. -In this case @code{pos-visible-in-window-p} calls the function with -the three arguments @var{position}, @var{window}, and @var{partially}, -then returns its result, instead of performing the actions described -above. Typically, the function will call -@code{pos-visible-in-window-p} recursively. +@vindex pos-visible-in-window-group-p-function +@defun pos-visible-in-window-group-p &optional position window partially +This function is like @code{pos-visible-in-window-p}, except that when +@var{window} is a part of a group of windows (@pxref{Basic Windows}), +@code{pos-visible-in-window-group-p} tests the visibility of @var{pos} +in the entire group, not just in the single @var{window}. This +condition holds when the buffer local variable +@code{pos-visible-in-window-group-p-function} is set to a function. +In this case @code{pos-visible-in-window-group-p} calls the function +with the three arguments @var{position}, @var{window}, and +@var{partially}, then returns its result. @end defun @defun window-line-height &optional line window @@ -3511,8 +3517,7 @@ beginning or end of the buffer (depending on scrolling direction); only if point is already on that position do they signal an error. @end defopt -@deffn Command recenter &optional count group -@vindex recenter-group-function +@deffn Command recenter &optional count @cindex centering point This function scrolls the text in the selected window so that point is displayed 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), window. If @var{count} is @code{nil}, this function may redraw the frame, according to the value of @code{recenter-redisplay}. -If @var{group} is non-@code{nil}, and the selected window is part of a -group of windows (@pxref{Basic Windows}), @code{recenter} scrolls the -entire group. This condition holds when the buffer local variable -@code{recenter-group-function} is set to a function. In this case, -@code{recenter} calls the function with the argument @var{count}, then -returns its result, instead of performing the actions described above. -Typically, the function will call @code{recenter} recursively. - When @code{recenter} is called interactively, @var{count} is the raw prefix argument. Thus, typing @kbd{C-u} as the prefix sets the @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 a more convenient way to achieve this. @end deffn +@vindex recenter-group-function +@defun recenter-group &optional count +This function is like @code{recenter}, except that when the selected +window is part of a group of windows (@pxref{Basic Windows}), +@code{recenter-group} scrolls the entire group. This condition holds +when the buffer local variable @code{recenter-group-function} is set +to a function. In this case, @code{recenter-group} calls the function +with the argument @var{count}, then returns its result. The argument +has the same meaning as in @code{recenter}. +@end defun + @defopt recenter-redisplay If this variable is non-@code{nil}, calling @code{recenter} with a @code{nil} argument redraws the frame. The default value is |