aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2011-11-11 10:59:00 +0100
committerMartin Rudalics2011-11-11 10:59:00 +0100
commit54f9154ca1ee7cf4ebe8995dae26e945a2817801 (patch)
treea0ee08483928c35ac61578d07707177adea53ab8
parent22a648b4d6cfcb369730b0c41232a047fd5616fb (diff)
downloademacs-54f9154ca1ee7cf4ebe8995dae26e945a2817801.tar.gz
emacs-54f9154ca1ee7cf4ebe8995dae26e945a2817801.zip
Rename and clean up functions in window.el.
* window.el (windows-with-parameter): Remove unused function. (windows-at-side): Rename to window-at-side-list. (window-check, window-atom-check, window-atom-check-1) (window-side-check): Prefix with "window--".
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/window.el60
2 files changed, 26 insertions, 41 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6df54fb4527..07cd69590ad 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12011-11-11 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (windows-with-parameter): Remove unused function.
4 (windows-at-side): Rename to window-at-side-list.
5 (window-check, window-atom-check, window-atom-check-1)
6 (window-side-check): Prefix with "window--".
7
12011-11-11 Glenn Morris <rgm@gnu.org> 82011-11-11 Glenn Morris <rgm@gnu.org>
2 9
3 * subr.el (eval-after-load): If FILE is already loaded, 10 * subr.el (eval-after-load): If FILE is already loaded,
diff --git a/lisp/window.el b/lisp/window.el
index ecd4a62b093..4bbead969ac 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -292,28 +292,6 @@ is unpredictable."
292 (setq window (window-normalize-window window)) 292 (setq window (window-normalize-window window))
293 (walk-window-tree-1 proc window any t)) 293 (walk-window-tree-1 proc window any t))
294 294
295(defun windows-with-parameter (parameter &optional value frame any values)
296 "Return a list of all windows on FRAME with PARAMETER non-nil.
297FRAME defaults to the selected frame. Optional argument VALUE
298non-nil means only return windows whose window-parameter value of
299PARAMETER equals VALUE \(comparison is done using `equal').
300Optional argument ANY non-nil means consider internal windows
301too. Optional argument VALUES non-nil means return a list of cons
302cells whose car is the value of the parameter and whose cdr is
303the window."
304 (let (this-value windows)
305 (walk-window-tree
306 (lambda (window)
307 (when (and (setq this-value (window-parameter window parameter))
308 (or (not value) (or (equal value this-value))))
309 (setq windows
310 (if values
311 (cons (cons this-value window) windows)
312 (cons window windows)))))
313 frame any)
314
315 (nreverse windows)))
316
317(defun window-with-parameter (parameter &optional value frame any) 295(defun window-with-parameter (parameter &optional value frame any)
318 "Return first window on FRAME with PARAMETER non-nil. 296 "Return first window on FRAME with PARAMETER non-nil.
319FRAME defaults to the selected frame. Optional argument VALUE 297FRAME defaults to the selected frame. Optional argument VALUE
@@ -353,8 +331,8 @@ WINDOW must be an internal window. Return WINDOW."
353 window t) 331 window t)
354 window)) 332 window))
355 333
356(defun window-atom-check-1 (window) 334(defun window--atom-check-1 (window)
357 "Subroutine of `window-atom-check'." 335 "Subroutine of `window--atom-check'."
358 (when window 336 (when window
359 (if (window-parameter window 'window-atom) 337 (if (window-parameter window 'window-atom)
360 (let ((count 0)) 338 (let ((count 0))
@@ -375,18 +353,18 @@ WINDOW must be an internal window. Return WINDOW."
375 window t))) 353 window t)))
376 ;; Check children. 354 ;; Check children.
377 (unless (window-buffer window) 355 (unless (window-buffer window)
378 (window-atom-check-1 (window-left-child window)) 356 (window--atom-check-1 (window-left-child window))
379 (window-atom-check-1 (window-top-child window)))) 357 (window--atom-check-1 (window-top-child window))))
380 ;; Check right sibling 358 ;; Check right sibling
381 (window-atom-check-1 (window-right window)))) 359 (window--atom-check-1 (window-right window))))
382 360
383(defun window-atom-check (&optional frame) 361(defun window--atom-check (&optional frame)
384 "Check atomicity of all windows on FRAME. 362 "Check atomicity of all windows on FRAME.
385FRAME defaults to the selected frame. If an atomic window is 363FRAME defaults to the selected frame. If an atomic window is
386wrongly configured, reset the atomicity of all its windows on 364wrongly configured, reset the atomicity of all its windows on
387FRAME to nil. An atomic window is wrongly configured if it has 365FRAME to nil. An atomic window is wrongly configured if it has
388no child windows or one of its child windows is not atomic." 366no child windows or one of its child windows is not atomic."
389 (window-atom-check-1 (frame-root-window frame))) 367 (window--atom-check-1 (frame-root-window frame)))
390 368
391;; Side windows. 369;; Side windows.
392(defvar window-sides '(left top right bottom) 370(defvar window-sides '(left top right bottom)
@@ -441,7 +419,7 @@ number of slots on that side."
441 (integer :tag "Number" :value 3 :size 5))) 419 (integer :tag "Number" :value 3 :size 5)))
442 :group 'windows) 420 :group 'windows)
443 421
444(defun window-side-check (&optional frame) 422(defun window--side-check (&optional frame)
445 "Check the window-side parameter of all windows on FRAME. 423 "Check the window-side parameter of all windows on FRAME.
446FRAME defaults to the selected frame. If the configuration is 424FRAME defaults to the selected frame. If the configuration is
447invalid, reset all window-side parameters to nil. 425invalid, reset all window-side parameters to nil.
@@ -512,11 +490,11 @@ A valid configuration has to preserve the following invariant:
512 (set-window-parameter window 'window-side nil)) 490 (set-window-parameter window 'window-side nil))
513 frame t)))) 491 frame t))))
514 492
515(defun window-check (&optional frame) 493(defun window--check (&optional frame)
516 "Check atomic and side windows on FRAME. 494 "Check atomic and side windows on FRAME.
517FRAME defaults to the selected frame." 495FRAME defaults to the selected frame."
518 (window-side-check frame) 496 (window--side-check frame)
519 (window-atom-check frame)) 497 (window--atom-check frame))
520 498
521;;; Window sizes. 499;;; Window sizes.
522(defvar window-size-fixed nil 500(defvar window-size-fixed nil
@@ -1106,7 +1084,7 @@ The default value nil is handled like `bottom'."
1106 (= (nth edge (window-edges window)) 1084 (= (nth edge (window-edges window))
1107 (nth edge (window-edges (frame-root-window window)))))) 1085 (nth edge (window-edges (frame-root-window window))))))
1108 1086
1109(defun windows-at-side (&optional frame side) 1087(defun window-at-side-list (&optional frame side)
1110 "Return list of all windows on SIDE of FRAME. 1088 "Return list of all windows on SIDE of FRAME.
1111FRAME must be a live frame and defaults to the selected frame. 1089FRAME must be a live frame and defaults to the selected frame.
1112SIDE can be any of the symbols `left', `top', `right' or 1090SIDE can be any of the symbols `left', `top', `right' or
@@ -2379,7 +2357,7 @@ non-side window, signal an error."
2379 (function (window-parameter window 'delete-window)) 2357 (function (window-parameter window 'delete-window))
2380 (parent (window-parent window)) 2358 (parent (window-parent window))
2381 atom-root) 2359 atom-root)
2382 (window-check frame) 2360 (window--check frame)
2383 (catch 'done 2361 (catch 'done
2384 ;; Handle window parameters. 2362 ;; Handle window parameters.
2385 (cond 2363 (cond
@@ -2433,7 +2411,7 @@ non-side window, signal an error."
2433 ;; not be selected, fix this here. 2411 ;; not be selected, fix this here.
2434 (other-window -1 frame)) 2412 (other-window -1 frame))
2435 (run-window-configuration-change-hook frame) 2413 (run-window-configuration-change-hook frame)
2436 (window-check frame) 2414 (window--check frame)
2437 ;; Always return nil. 2415 ;; Always return nil.
2438 nil)))) 2416 nil))))
2439 2417
@@ -2460,7 +2438,7 @@ window signal an error."
2460 (function (window-parameter window 'delete-other-windows)) 2438 (function (window-parameter window 'delete-other-windows))
2461 (window-side (window-parameter window 'window-side)) 2439 (window-side (window-parameter window 'window-side))
2462 atom-root side-main) 2440 atom-root side-main)
2463 (window-check frame) 2441 (window--check frame)
2464 (catch 'done 2442 (catch 'done
2465 (cond 2443 (cond
2466 ;; Ignore window parameters if `ignore-window-parameters' is t or 2444 ;; Ignore window parameters if `ignore-window-parameters' is t or
@@ -2484,7 +2462,7 @@ window signal an error."
2484 (unless (eq window side-main) 2462 (unless (eq window side-main)
2485 (delete-other-windows-internal window side-main) 2463 (delete-other-windows-internal window side-main)
2486 (run-window-configuration-change-hook frame) 2464 (run-window-configuration-change-hook frame)
2487 (window-check frame)) 2465 (window--check frame))
2488 ;; Always return nil. 2466 ;; Always return nil.
2489 nil))) 2467 nil)))
2490 2468
@@ -3111,7 +3089,7 @@ frame. The selected window is not changed by this function."
3111 (window-nest window-nest) 3089 (window-nest window-nest)
3112 atom-root) 3090 atom-root)
3113 3091
3114 (window-check frame) 3092 (window--check frame)
3115 (catch 'done 3093 (catch 'done
3116 (cond 3094 (cond
3117 ;; Ignore window parameters if either `ignore-window-parameters' 3095 ;; Ignore window parameters if either `ignore-window-parameters'
@@ -3265,7 +3243,7 @@ frame. The selected window is not changed by this function."
3265 (set-window-parameter new 'window-side window-side)) 3243 (set-window-parameter new 'window-side window-side))
3266 3244
3267 (run-window-configuration-change-hook frame) 3245 (run-window-configuration-change-hook frame)
3268 (window-check frame) 3246 (window--check frame)
3269 ;; Always return the new window. 3247 ;; Always return the new window.
3270 new))))) 3248 new)))))
3271 3249
@@ -3885,7 +3863,7 @@ windows can get as small as `window-safe-min-height' and
3885 (set-window-buffer window (current-buffer)) 3863 (set-window-buffer window (current-buffer))
3886 (window-state-put-1 state window nil totals) 3864 (window-state-put-1 state window nil totals)
3887 (window-state-put-2 ignore)) 3865 (window-state-put-2 ignore))
3888 (window-check frame)))) 3866 (window--check frame))))
3889 3867
3890(defun display-buffer-record-window (type window buffer) 3868(defun display-buffer-record-window (type window buffer)
3891 "Record information for window used by `display-buffer'. 3869 "Record information for window used by `display-buffer'.