aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2004-07-11 00:56:17 +0000
committerLuc Teirlinck2004-07-11 00:56:17 +0000
commit90dc192227cbe9bad6096090f9ba5661cb52e0f9 (patch)
treebdff3de08914019dae288166a0e3e08f5a6e580d
parent45f17557a51ab4b6fe76487eda1c9eec9a89de0e (diff)
downloademacs-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/ChangeLog5
-rw-r--r--lisp/window.el41
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 @@
12004-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
12004-07-10 Vinicius Jose Latorre <viniciusjl@ig.com.br> 62004-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 @@
34Also restore the selected window of each frame as it was at the start 34Also restore the selected window of each frame as it was at the start
35of this construct. 35of this construct.
36However, if a window has become dead, don't get an error, 36However, if a window has become dead, don't get an error,
37just refrain from reselecting it." 37just refrain from reselecting it.
38Return 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.
67Optional arg NOMINI non-nil means don't count the minibuffer 68Optional arg NOMINI non-nil means don't count the minibuffer
68even if it is active. 69even if it is active. Otherwise, the minibuffer is counted
70when it is active.
69 71
70The optional arg ALL-FRAMES t means count windows on all frames. 72The optional arg ALL-FRAMES t means count windows on all frames.
71If it is `visible', count windows on all visible frames. 73If it is `visible', count windows on all visible frames.
72ALL-FRAMES nil or omitted means count only the selected frame, 74ALL-FRAMES nil or omitted means count only the selected frame,
73plus the minibuffer it uses (which may be on another frame). 75plus the minibuffer it uses (which may be on another frame).
74If ALL-FRAMES is neither nil nor t, count only the selected frame." 76ALL-FRAMES 0 means count all windows in all visible or iconified frames.
77If 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 \
275in both children.
272This is often more convenient for editing. 276This is often more convenient for editing.
273If nil, adjust point in each of the two windows to minimize redisplay. 277If nil, adjust point in each of the two windows to minimize redisplay.
274This is convenient on slow terminals, but point can move strangely." 278This is convenient on slow terminals, but point can move strangely.
279
280This option applies only to `split-window-vertically' and
281functions that call it. `split-window' always keeps the original
282point 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.
280The uppermost window gets ARG lines and the other gets the rest. 288The uppermost window gets ARG lines and the other gets the rest.
281Negative arg means select the size of the lowermost window instead. 289Negative ARG means select the size of the lowermost window instead.
282With no argument, split equally or close to it. 290With no argument, split equally or close to it.
283Both windows display the same buffer now current. 291Both windows display the same buffer now current.
284 292
285If the variable `split-window-keep-point' is non-nil, both new windows 293If the variable `split-window-keep-point' is non-nil, both new windows
286will get the same value of point as the current window. This is often 294will get the same value of point as the current window. This is often
287more convenient for editing. 295more convenient for editing. The upper window is the selected window.
288 296
289Otherwise, we chose window starts so as to minimize the amount of 297Otherwise, we choose window starts so as to minimize the amount of
290redisplay; this is convenient on slow terminals. The new selected 298redisplay; this is convenient on slow terminals. The new selected
291window is the one that the current value of point appears in. The 299window is the one that the current value of point appears in. The
292value of point can change if the text around point is hidden by the 300value of point can change if the text around point is hidden by the
293new mode line." 301new mode line.
302
303Regardless of the value of `split-window-keep-point', the upper
304window is the original one and the return value is the new, lower
305window."
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.
340This window becomes the leftmost of the two, and gets ARG columns. 352This window becomes the leftmost of the two, and gets ARG columns.
341Negative arg means select the size of the rightmost window instead. 353Negative ARG means select the size of the rightmost window instead.
342The argument includes the width of the window's scroll bar; if there 354The argument includes the width of the window's scroll bar; if there
343are no scroll bars, it includes the width of the divider column 355are no scroll bars, it includes the width of the divider column
344to the window's right, if any. No arg means split equally." 356to the window's right, if any. No ARG means split equally.
357
358The original, leftmost window remains selected.
359The 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))))