diff options
| author | Luc Teirlinck | 2004-07-11 00:56:17 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2004-07-11 00:56:17 +0000 |
| commit | 90dc192227cbe9bad6096090f9ba5661cb52e0f9 (patch) | |
| tree | bdff3de08914019dae288166a0e3e08f5a6e580d | |
| parent | 45f17557a51ab4b6fe76487eda1c9eec9a89de0e (diff) | |
| download | emacs-90dc192227cbe9bad6096090f9ba5661cb52e0f9.tar.gz emacs-90dc192227cbe9bad6096090f9ba5661cb52e0f9.zip | |
(save-selected-window, one-window-p)
(split-window-keep-point, split-window-vertically)
(split-window-horizontally): Doc fixes.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/window.el | 41 |
2 files changed, 33 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5cb8300c023..290f02cb7ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2004-07-10 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2 | |||
| 3 | * window.el (save-selected-window, one-window-p) | ||
| 4 | (split-window-keep-point, split-window-horizontally): Doc fixes. | ||
| 5 | |||
| 1 | 2004-07-10 Vinicius Jose Latorre <viniciusjl@ig.com.br> | 6 | 2004-07-10 Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 2 | 7 | ||
| 3 | * printing.el: Doc fix. Now it uses call-process instead of | 8 | * printing.el: Doc fix. Now it uses call-process instead of |
diff --git a/lisp/window.el b/lisp/window.el index 188b3acf311..96bfc8b5581 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -34,7 +34,8 @@ | |||
| 34 | Also restore the selected window of each frame as it was at the start | 34 | Also restore the selected window of each frame as it was at the start |
| 35 | of this construct. | 35 | of this construct. |
| 36 | However, if a window has become dead, don't get an error, | 36 | However, if a window has become dead, don't get an error, |
| 37 | just refrain from reselecting it." | 37 | just refrain from reselecting it. |
| 38 | Return the value of the last form in BODY." | ||
| 38 | `(let ((save-selected-window-window (selected-window)) | 39 | `(let ((save-selected-window-window (selected-window)) |
| 39 | ;; It is necessary to save all of these, because calling | 40 | ;; It is necessary to save all of these, because calling |
| 40 | ;; select-window changes frame-selected-window for whatever | 41 | ;; select-window changes frame-selected-window for whatever |
| @@ -63,15 +64,17 @@ This does not include the mode line (if any) or the header line (if any)." | |||
| 63 | (if header-line-format 1 0)))))) | 64 | (if header-line-format 1 0)))))) |
| 64 | 65 | ||
| 65 | (defun one-window-p (&optional nomini all-frames) | 66 | (defun one-window-p (&optional nomini all-frames) |
| 66 | "Return non-nil if the selected window is the only window (in its frame). | 67 | "Return non-nil if the selected window is the only window. |
| 67 | Optional arg NOMINI non-nil means don't count the minibuffer | 68 | Optional arg NOMINI non-nil means don't count the minibuffer |
| 68 | even if it is active. | 69 | even if it is active. Otherwise, the minibuffer is counted |
| 70 | when it is active. | ||
| 69 | 71 | ||
| 70 | The optional arg ALL-FRAMES t means count windows on all frames. | 72 | The optional arg ALL-FRAMES t means count windows on all frames. |
| 71 | If it is `visible', count windows on all visible frames. | 73 | If it is `visible', count windows on all visible frames. |
| 72 | ALL-FRAMES nil or omitted means count only the selected frame, | 74 | ALL-FRAMES nil or omitted means count only the selected frame, |
| 73 | plus the minibuffer it uses (which may be on another frame). | 75 | plus the minibuffer it uses (which may be on another frame). |
| 74 | If ALL-FRAMES is neither nil nor t, count only the selected frame." | 76 | ALL-FRAMES 0 means count all windows in all visible or iconified frames. |
| 77 | If ALL-FRAMES is anything else, count only the selected frame." | ||
| 75 | (let ((base-window (selected-window))) | 78 | (let ((base-window (selected-window))) |
| 76 | (if (and nomini (eq base-window (minibuffer-window))) | 79 | (if (and nomini (eq base-window (minibuffer-window))) |
| 77 | (setq base-window (next-window base-window))) | 80 | (setq base-window (next-window base-window))) |
| @@ -87,7 +90,7 @@ bars (top, bottom, or nil)." | |||
| 87 | (let ((vert (nth 2 (window-scroll-bars window))) | 90 | (let ((vert (nth 2 (window-scroll-bars window))) |
| 88 | (hor nil)) | 91 | (hor nil)) |
| 89 | (when (or (eq vert t) (eq hor t)) | 92 | (when (or (eq vert t) (eq hor t)) |
| 90 | (let ((fcsb (frame-current-scroll-bars | 93 | (let ((fcsb (frame-current-scroll-bars |
| 91 | (window-frame (or window (selected-window)))))) | 94 | (window-frame (or window (selected-window)))))) |
| 92 | (if (eq vert t) | 95 | (if (eq vert t) |
| 93 | (setq vert (car fcsb))) | 96 | (setq vert (car fcsb))) |
| @@ -268,29 +271,38 @@ If WINDOW is nil or omitted, it defaults to the currently selected window." | |||
| 268 | 271 | ||
| 269 | ;; I think this should be the default; I think people will prefer it--rms. | 272 | ;; I think this should be the default; I think people will prefer it--rms. |
| 270 | (defcustom split-window-keep-point t | 273 | (defcustom split-window-keep-point t |
| 271 | "*If non-nil, split windows keeps the original point in both children. | 274 | "*If non-nil, \\[split-window-vertically] keeps the original point \ |
| 275 | in both children. | ||
| 272 | This is often more convenient for editing. | 276 | This is often more convenient for editing. |
| 273 | If nil, adjust point in each of the two windows to minimize redisplay. | 277 | If nil, adjust point in each of the two windows to minimize redisplay. |
| 274 | This is convenient on slow terminals, but point can move strangely." | 278 | This is convenient on slow terminals, but point can move strangely. |
| 279 | |||
| 280 | This option applies only to `split-window-vertically' and | ||
| 281 | functions that call it. `split-window' always keeps the original | ||
| 282 | point in both children," | ||
| 275 | :type 'boolean | 283 | :type 'boolean |
| 276 | :group 'windows) | 284 | :group 'windows) |
| 277 | 285 | ||
| 278 | (defun split-window-vertically (&optional arg) | 286 | (defun split-window-vertically (&optional arg) |
| 279 | "Split current window into two windows, one above the other. | 287 | "Split current window into two windows, one above the other. |
| 280 | The uppermost window gets ARG lines and the other gets the rest. | 288 | The uppermost window gets ARG lines and the other gets the rest. |
| 281 | Negative arg means select the size of the lowermost window instead. | 289 | Negative ARG means select the size of the lowermost window instead. |
| 282 | With no argument, split equally or close to it. | 290 | With no argument, split equally or close to it. |
| 283 | Both windows display the same buffer now current. | 291 | Both windows display the same buffer now current. |
| 284 | 292 | ||
| 285 | If the variable `split-window-keep-point' is non-nil, both new windows | 293 | If the variable `split-window-keep-point' is non-nil, both new windows |
| 286 | will get the same value of point as the current window. This is often | 294 | will get the same value of point as the current window. This is often |
| 287 | more convenient for editing. | 295 | more convenient for editing. The upper window is the selected window. |
| 288 | 296 | ||
| 289 | Otherwise, we chose window starts so as to minimize the amount of | 297 | Otherwise, we choose window starts so as to minimize the amount of |
| 290 | redisplay; this is convenient on slow terminals. The new selected | 298 | redisplay; this is convenient on slow terminals. The new selected |
| 291 | window is the one that the current value of point appears in. The | 299 | window is the one that the current value of point appears in. The |
| 292 | value of point can change if the text around point is hidden by the | 300 | value of point can change if the text around point is hidden by the |
| 293 | new mode line." | 301 | new mode line. |
| 302 | |||
| 303 | Regardless of the value of `split-window-keep-point', the upper | ||
| 304 | window is the original one and the return value is the new, lower | ||
| 305 | window." | ||
| 294 | (interactive "P") | 306 | (interactive "P") |
| 295 | (let ((old-w (selected-window)) | 307 | (let ((old-w (selected-window)) |
| 296 | (old-point (point)) | 308 | (old-point (point)) |
| @@ -338,10 +350,13 @@ new mode line." | |||
| 338 | (defun split-window-horizontally (&optional arg) | 350 | (defun split-window-horizontally (&optional arg) |
| 339 | "Split current window into two windows side by side. | 351 | "Split current window into two windows side by side. |
| 340 | This window becomes the leftmost of the two, and gets ARG columns. | 352 | This window becomes the leftmost of the two, and gets ARG columns. |
| 341 | Negative arg means select the size of the rightmost window instead. | 353 | Negative ARG means select the size of the rightmost window instead. |
| 342 | The argument includes the width of the window's scroll bar; if there | 354 | The argument includes the width of the window's scroll bar; if there |
| 343 | are no scroll bars, it includes the width of the divider column | 355 | are no scroll bars, it includes the width of the divider column |
| 344 | to the window's right, if any. No arg means split equally." | 356 | to the window's right, if any. No ARG means split equally. |
| 357 | |||
| 358 | The original, leftmost window remains selected. | ||
| 359 | The return value is the new, rightmost window." | ||
| 345 | (interactive "P") | 360 | (interactive "P") |
| 346 | (let ((old-w (selected-window)) | 361 | (let ((old-w (selected-window)) |
| 347 | (size (and arg (prefix-numeric-value arg)))) | 362 | (size (and arg (prefix-numeric-value arg)))) |