diff options
| author | Alan Mackenzie | 2015-12-14 16:38:07 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2015-12-14 16:38:07 +0000 |
| commit | e8937de5547a687b6d03199368645f168cb8ad37 (patch) | |
| tree | 7b974d1ed2470576d1f7649a25b0a0af76eaf4c8 /doc | |
| parent | 3194f1ccd99cfd13ddaf621d6e7f1e1aa1645165 (diff) | |
| download | emacs-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.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 | |||
| 551 | any buffer, whether or not it is currently displayed in some window. | 551 | any 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 | ||
| 556 | This function moves point with respect to the text currently displayed | 555 | This function moves point with respect to the text currently displayed |
| 557 | in the selected window. It moves point to the beginning of the screen | 556 | in the selected window. It moves point to the beginning of the screen |
| 558 | line @var{count} screen lines from the top of the window. If | 557 | 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. | |||
| 571 | 570 | ||
| 572 | The value returned is the window line number point has moved to, with | 571 | The value returned is the window line number point has moved to, with |
| 573 | the top line in the window numbered 0. | 572 | the top line in the window numbered 0. |
| 574 | |||
| 575 | If @var{group} is non-@code{nil}, and the selected window is a part of | ||
| 576 | a group of windows (@pxref{Basic Windows}), @code{move-to-window-line} | ||
| 577 | will move to a position with respect to the entire group, not just the | ||
| 578 | single window. This condition holds when the buffer local variable | ||
| 579 | @code{move-to-window-line-group-function} is set to a function. In | ||
| 580 | this case, @code{move-to-window-line} calls the function with the | ||
| 581 | argument @var{count}, then returns its result, instead of performing | ||
| 582 | the 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 | ||
| 577 | This function is like @code{move-to-window-line}, except that when the | ||
| 578 | selected window is a part of a group of windows (@pxref{Basic | ||
| 579 | Windows}), @code{move-to-window-group-line} will move to a position | ||
| 580 | with respect to the entire group, not just the single window. This | ||
| 581 | condition holds when the buffer local variable | ||
| 582 | @code{move-to-window-group-line-function} is set to a function. In | ||
| 583 | this case, @code{move-to-window-group-line} calls the function with | ||
| 584 | the argument @var{count}, then returns its result. The argument has | ||
| 585 | the 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 |
| 587 | This function scans the current buffer, calculating screen positions. | 589 | This function scans the current buffer, calculating screen positions. |
| 588 | It scans the buffer forward from position @var{from}, assuming that is | 590 | 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 | |||
| 3104 | readjustment. To test such code, put it into a command and bind the | 3104 | readjustment. To test such code, put it into a command and bind the |
| 3105 | command to a key. | 3105 | command 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 |
| 3110 | This function returns the display-start position of window | 3109 | This 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 | |||
| 3121 | on the screen. Nothing except redisplay automatically changes the | 3120 | on the screen. Nothing except redisplay automatically changes the |
| 3122 | window-start position; if you move point, do not expect the window-start | 3121 | window-start position; if you move point, do not expect the window-start |
| 3123 | position to change in response until after the next redisplay. | 3122 | position to change in response until after the next redisplay. |
| 3123 | @end defun | ||
| 3124 | 3124 | ||
| 3125 | If @var{group} is non-@code{nil}, and @var{window} is a part of a | 3125 | @defun window-group-start &optional window |
| 3126 | group of windows (@pxref{Basic Windows}), @code{window-start} returns | 3126 | @vindex window-group-start-function |
| 3127 | the start position of the entire group. This condition holds when the | 3127 | This function is like @code{window-start}, except that when |
| 3128 | buffer 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}), |
| 3129 | function. In this case, @code{window-start} calls the function with | 3129 | @code{window-group-start} returns the start position of the entire |
| 3130 | the single argument @var{window}, then returns its result, instead of | 3130 | group. This condition holds when the buffer local variable |
| 3131 | performing the actions described above. Typically, the function will | 3131 | @code{window-group-start-function} is set to a function. In this |
| 3132 | call @code{window-start} recursively. | 3132 | case, @code{window-group-start} calls the function with the single |
| 3133 | argument @var{window}, then returns its result. The argument to this | ||
| 3134 | function 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 |
| 3138 | This function returns the position where display of its buffer ends in | 3139 | This 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 | |||
| 3157 | way real redisplay would do. It does not alter the | 3158 | way 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 |
| 3159 | text will end if scrolling is not required. | 3160 | text will end if scrolling is not required. |
| 3161 | @end defun | ||
| 3160 | 3162 | ||
| 3161 | If @var{group} is non-@code{nil}, and @var{window} is a part of a | 3163 | @vindex window-group-end-function |
| 3162 | group of windows (@pxref{Basic Windows}), `window-end' returns the end | 3164 | @defun window-group-end window update |
| 3163 | position of the entire group. This condition holds when the buffer | 3165 | This function is like @code{window-end}, except that when @var{window} |
| 3164 | local variable @code{window-end-group-function} is set to a function. | 3166 | is a part of a group of windows (@pxref{Basic Windows}), |
| 3165 | In this case, @code{window-end} calls the function with the two | 3167 | @code{window-group-end} returns the end position of the entire group. |
| 3166 | arguments @var{window} and @var{update}, then returns its result, | 3168 | This condition holds when the buffer local variable |
| 3167 | instead of performing the actions described above. Typically, the | 3169 | @code{window-group-end-function} is set to a function. In this case, |
| 3168 | function 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 | ||
| 3172 | to 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 | ||
| 3173 | This function sets the display-start position of @var{window} to | 3176 | This 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: | |||
| 3230 | If @var{noforce} is non-@code{nil}, and @var{position} would place point | 3233 | If @var{noforce} is non-@code{nil}, and @var{position} would place point |
| 3231 | off screen at the next redisplay, then redisplay computes a new window-start | 3234 | off screen at the next redisplay, then redisplay computes a new window-start |
| 3232 | position that works well with point, and thus @var{position} is not used. | 3235 | position that works well with point, and thus @var{position} is not used. |
| 3236 | @end defun | ||
| 3233 | 3237 | ||
| 3234 | If @var{group} is non-@code{nil}, and @var{window} is a part of a | 3238 | @vindex set-window-group-start-function |
| 3235 | group of windows (@pxref{Basic Windows}), @code{set-window-start} sets | 3239 | @defun set-window-group-start window position &optional noforce |
| 3236 | the start position of the entire group. This condition holds when the | 3240 | This function is like @code{set-window-start}, except that when |
| 3237 | buffer 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}), |
| 3238 | a function. In this case, @code{set-window-start} calls the function | 3242 | @code{set-window-group-start} sets the start position of the entire |
| 3239 | with the three arguments @var{window}, @var{position}, and | 3243 | group. 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 |
| 3241 | actions described above. Typically, the function will call | 3245 | case, @code{set-window-group-start} calls the function with the three |
| 3242 | @code{set-window-start} recursively. | 3246 | arguments @var{window}, @var{position}, and @var{noforce}, then |
| 3247 | returns its result. The arguments in this function have the same | ||
| 3248 | meaning 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 | ||
| 3247 | This function returns non-@code{nil} if @var{position} is within the | 3252 | This function returns non-@code{nil} if @var{position} is within the |
| 3248 | range of text currently visible on the screen in @var{window}. It | 3253 | range of text currently visible on the screen in @var{window}. It |
| 3249 | returns @code{nil} if @var{position} is scrolled vertically out of | 3254 | returns @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 | ||
| 3286 | If @var{group} is non-@code{nil}, and @var{window} is a part of a | 3292 | @vindex pos-visible-in-window-group-p-function |
| 3287 | group 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 | 3294 | This function is like @code{pos-visible-in-window-p}, except that when |
| 3289 | the 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}), |
| 3290 | holds 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. | 3297 | in the entire group, not just in the single @var{window}. This |
| 3292 | In this case @code{pos-visible-in-window-p} calls the function with | 3298 | condition holds when the buffer local variable |
| 3293 | the three arguments @var{position}, @var{window}, and @var{partially}, | 3299 | @code{pos-visible-in-window-group-p-function} is set to a function. |
| 3294 | then returns its result, instead of performing the actions described | 3300 | In this case @code{pos-visible-in-window-group-p} calls the function |
| 3295 | above. Typically, the function will call | 3301 | with 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); | |||
| 3511 | only if point is already on that position do they signal an error. | 3517 | only 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 |
| 3517 | This function scrolls the text in the selected window so that point is | 3522 | This function scrolls the text in the selected window so that point is |
| 3518 | displayed at a specified vertical position within the window. It does | 3523 | 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), | |||
| 3529 | window. If @var{count} is @code{nil}, this function may redraw the | 3534 | window. If @var{count} is @code{nil}, this function may redraw the |
| 3530 | frame, according to the value of @code{recenter-redisplay}. | 3535 | frame, according to the value of @code{recenter-redisplay}. |
| 3531 | 3536 | ||
| 3532 | If @var{group} is non-@code{nil}, and the selected window is part of a | ||
| 3533 | group of windows (@pxref{Basic Windows}), @code{recenter} scrolls the | ||
| 3534 | entire 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 | ||
| 3537 | returns its result, instead of performing the actions described above. | ||
| 3538 | Typically, the function will call @code{recenter} recursively. | ||
| 3539 | |||
| 3540 | When @code{recenter} is called interactively, @var{count} is the raw | 3537 | When @code{recenter} is called interactively, @var{count} is the raw |
| 3541 | prefix argument. Thus, typing @kbd{C-u} as the prefix sets the | 3538 | prefix 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 | |||
| 3548 | a more convenient way to achieve this. | 3545 | a 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 | ||
| 3550 | This function is like @code{recenter}, except that when the selected | ||
| 3551 | window is part of a group of windows (@pxref{Basic Windows}), | ||
| 3552 | @code{recenter-group} scrolls the entire group. This condition holds | ||
| 3553 | when the buffer local variable @code{recenter-group-function} is set | ||
| 3554 | to a function. In this case, @code{recenter-group} calls the function | ||
| 3555 | with the argument @var{count}, then returns its result. The argument | ||
| 3556 | has the same meaning as in @code{recenter}. | ||
| 3557 | @end defun | ||
| 3558 | |||
| 3551 | @defopt recenter-redisplay | 3559 | @defopt recenter-redisplay |
| 3552 | If this variable is non-@code{nil}, calling @code{recenter} with a | 3560 | If 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 |