diff options
| author | Chong Yidong | 2011-11-19 23:22:08 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-11-19 23:22:08 +0800 |
| commit | c7635a977e0d1fdb4d91ff54b3d85dfa9f3d3fe8 (patch) | |
| tree | 73e9f6d8e9acd3c6f19f92af2a1cd2c092dfa11c | |
| parent | 78c79eb51bde1f142022f5aa37c92854a5230841 (diff) | |
| download | emacs-c7635a977e0d1fdb4d91ff54b3d85dfa9f3d3fe8.tar.gz emacs-c7635a977e0d1fdb4d91ff54b3d85dfa9f3d3fe8.zip | |
Change arg names of walk-windows etc from "proc" to "fun".
They shouldn't be named "proc" since they are not processes.
* lisp/window.el (walk-window-tree-1, walk-window-tree)
(walk-window-subtree, walk-windows): Change argument name.
| -rw-r--r-- | lisp/window.el | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/lisp/window.el b/lisp/window.el index 019a1904ac7..4c77cb00025 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -246,51 +246,51 @@ windows horizontally arranged within WINDOW." | |||
| 246 | (setq child (window-right child))) | 246 | (setq child (window-right child))) |
| 247 | count)))) | 247 | count)))) |
| 248 | 248 | ||
| 249 | (defun walk-window-tree-1 (proc walk-window-tree-window any &optional sub-only) | 249 | (defun walk-window-tree-1 (fun walk-window-tree-window any &optional sub-only) |
| 250 | "Helper function for `walk-window-tree' and `walk-window-subtree'." | 250 | "Helper function for `walk-window-tree' and `walk-window-subtree'." |
| 251 | (let (walk-window-tree-buffer) | 251 | (let (walk-window-tree-buffer) |
| 252 | (while walk-window-tree-window | 252 | (while walk-window-tree-window |
| 253 | (setq walk-window-tree-buffer | 253 | (setq walk-window-tree-buffer |
| 254 | (window-buffer walk-window-tree-window)) | 254 | (window-buffer walk-window-tree-window)) |
| 255 | (when (or walk-window-tree-buffer any) | 255 | (when (or walk-window-tree-buffer any) |
| 256 | (funcall proc walk-window-tree-window)) | 256 | (funcall fun walk-window-tree-window)) |
| 257 | (unless walk-window-tree-buffer | 257 | (unless walk-window-tree-buffer |
| 258 | (walk-window-tree-1 | 258 | (walk-window-tree-1 |
| 259 | proc (window-left-child walk-window-tree-window) any) | 259 | fun (window-left-child walk-window-tree-window) any) |
| 260 | (walk-window-tree-1 | 260 | (walk-window-tree-1 |
| 261 | proc (window-top-child walk-window-tree-window) any)) | 261 | fun (window-top-child walk-window-tree-window) any)) |
| 262 | (if sub-only | 262 | (if sub-only |
| 263 | (setq walk-window-tree-window nil) | 263 | (setq walk-window-tree-window nil) |
| 264 | (setq walk-window-tree-window | 264 | (setq walk-window-tree-window |
| 265 | (window-right walk-window-tree-window)))))) | 265 | (window-right walk-window-tree-window)))))) |
| 266 | 266 | ||
| 267 | (defun walk-window-tree (proc &optional frame any) | 267 | (defun walk-window-tree (fun &optional frame any) |
| 268 | "Run function PROC on each live window of FRAME. | 268 | "Run function FUN on each live window of FRAME. |
| 269 | PROC must be a function with one argument - a window. FRAME must | 269 | FUN must be a function with one argument - a window. FRAME must |
| 270 | be a live frame and defaults to the selected one. ANY, if | 270 | be a live frame and defaults to the selected one. ANY, if |
| 271 | non-nil means to run PROC on all live and internal windows of | 271 | non-nil means to run FUN on all live and internal windows of |
| 272 | FRAME. | 272 | FRAME. |
| 273 | 273 | ||
| 274 | This function performs a pre-order, depth-first traversal of the | 274 | This function performs a pre-order, depth-first traversal of the |
| 275 | window tree. If PROC changes the window tree, the result is | 275 | window tree. If FUN changes the window tree, the result is |
| 276 | unpredictable." | 276 | unpredictable." |
| 277 | (let ((walk-window-tree-frame (window-normalize-frame frame))) | 277 | (let ((walk-window-tree-frame (window-normalize-frame frame))) |
| 278 | (walk-window-tree-1 | 278 | (walk-window-tree-1 |
| 279 | proc (frame-root-window walk-window-tree-frame) any))) | 279 | fun (frame-root-window walk-window-tree-frame) any))) |
| 280 | 280 | ||
| 281 | (defun walk-window-subtree (proc &optional window any) | 281 | (defun walk-window-subtree (fun &optional window any) |
| 282 | "Run function PROC on the subtree of windows rooted at WINDOW. | 282 | "Run function FUN on the subtree of windows rooted at WINDOW. |
| 283 | WINDOW defaults to the selected window. PROC must be a function | 283 | WINDOW defaults to the selected window. FUN must be a function |
| 284 | with one argument - a window. By default, run PROC only on live | 284 | with one argument - a window. By default, run FUN only on live |
| 285 | windows of the subtree. If the optional argument ANY is non-nil, | 285 | windows of the subtree. If the optional argument ANY is non-nil, |
| 286 | run PROC on all live and internal windows of the subtree. If | 286 | run FUN on all live and internal windows of the subtree. If |
| 287 | WINDOW is live, run PROC on WINDOW only. | 287 | WINDOW is live, run FUN on WINDOW only. |
| 288 | 288 | ||
| 289 | This function performs a pre-order, depth-first traversal of the | 289 | This function performs a pre-order, depth-first traversal of the |
| 290 | subtree rooted at WINDOW. If PROC changes that tree, the result | 290 | subtree rooted at WINDOW. If FUN changes that tree, the result |
| 291 | is unpredictable." | 291 | 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 fun window any t)) |
| 294 | 294 | ||
| 295 | (defun window-with-parameter (parameter &optional value frame any) | 295 | (defun window-with-parameter (parameter &optional value frame any) |
| 296 | "Return first window on FRAME with PARAMETER non-nil. | 296 | "Return first window on FRAME with PARAMETER non-nil. |
| @@ -997,9 +997,9 @@ taken into account." | |||
| 997 | (setq hor (cdr fcsb))))) | 997 | (setq hor (cdr fcsb))))) |
| 998 | (cons vert hor))) | 998 | (cons vert hor))) |
| 999 | 999 | ||
| 1000 | (defun walk-windows (proc &optional minibuf all-frames) | 1000 | (defun walk-windows (fun &optional minibuf all-frames) |
| 1001 | "Cycle through all live windows, calling PROC for each one. | 1001 | "Cycle through all live windows, calling FUN for each one. |
| 1002 | PROC must specify a function with a window as its sole argument. | 1002 | FUN must specify a function with a window as its sole argument. |
| 1003 | The optional arguments MINIBUF and ALL-FRAMES specify the set of | 1003 | The optional arguments MINIBUF and ALL-FRAMES specify the set of |
| 1004 | windows to include in the walk. | 1004 | windows to include in the walk. |
| 1005 | 1005 | ||
| @@ -1041,7 +1041,7 @@ windows nor the buffer list." | |||
| 1041 | (when (framep all-frames) | 1041 | (when (framep all-frames) |
| 1042 | (select-window (frame-first-window all-frames) 'norecord)) | 1042 | (select-window (frame-first-window all-frames) 'norecord)) |
| 1043 | (dolist (walk-windows-window (window-list-1 nil minibuf all-frames)) | 1043 | (dolist (walk-windows-window (window-list-1 nil minibuf all-frames)) |
| 1044 | (funcall proc walk-windows-window)))) | 1044 | (funcall fun walk-windows-window)))) |
| 1045 | 1045 | ||
| 1046 | (defun window-point-1 (&optional window) | 1046 | (defun window-point-1 (&optional window) |
| 1047 | "Return value of WINDOW's point. | 1047 | "Return value of WINDOW's point. |
| @@ -3677,8 +3677,7 @@ value can be also stored on disk and read back in a new session." | |||
| 3677 | ((eq type 'leaf) | 3677 | ((eq type 'leaf) |
| 3678 | ;; For a leaf window just add unprocessed entries to | 3678 | ;; For a leaf window just add unprocessed entries to |
| 3679 | ;; `window-state-put-list'. | 3679 | ;; `window-state-put-list'. |
| 3680 | (setq window-state-put-list | 3680 | (push (cons window state) window-state-put-list)) |
| 3681 | (cons (cons window state) window-state-put-list))) | ||
| 3682 | ((memq type '(vc hc)) | 3681 | ((memq type '(vc hc)) |
| 3683 | (let* ((horizontal (eq type 'hc)) | 3682 | (let* ((horizontal (eq type 'hc)) |
| 3684 | (total (window-total-size window horizontal)) | 3683 | (total (window-total-size window horizontal)) |