diff options
| author | Stefan Monnier | 2007-11-22 18:08:06 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-11-22 18:08:06 +0000 |
| commit | 693b2fe29632bd80290ccc9843c3ea3766d3ae54 (patch) | |
| tree | dc338e8c18d075eff5ccd51919f909d86ffdeda5 | |
| parent | 2546bcdd94d00d87ea5559cfd93a342b3ad87807 (diff) | |
| download | emacs-693b2fe29632bd80290ccc9843c3ea3766d3ae54.tar.gz emacs-693b2fe29632bd80290ccc9843c3ea3766d3ae54.zip | |
(balance-windows): Remove unused var `counter'.
(bw-balance-sub): Remove unused var `lastchild'.
(split-window-vertically): Remove unused var `switch'.
(recenter-top-bottom): Remove unused vars `bottom', `current', `total'.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/window.el | 20 |
2 files changed, 12 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7ecd1b1d981..cfda8a8f167 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2007-11-22 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-11-22 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * window.el (balance-windows): Remove unused var `counter'. | ||
| 4 | (bw-balance-sub): Remove unused var `lastchild'. | ||
| 5 | (split-window-vertically): Remove unused var `switch'. | ||
| 6 | (recenter-top-bottom): Remove unused vars `bottom', `current', `total'. | ||
| 7 | |||
| 3 | * emacs-lisp/bytecomp.el | 8 | * emacs-lisp/bytecomp.el |
| 4 | (byte-compile-file-form-custom-declare-variable): Simplify. | 9 | (byte-compile-file-form-custom-declare-variable): Simplify. |
| 5 | 10 | ||
diff --git a/lisp/window.el b/lisp/window.el index 94e4b48a3a7..fea89e86d3a 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -215,8 +215,7 @@ to be counted) its minibuffer frame (if that's not the same frame). | |||
| 215 | The optional arg MINIBUF non-nil means count the minibuffer | 215 | The optional arg MINIBUF non-nil means count the minibuffer |
| 216 | even if it is inactive." | 216 | even if it is inactive." |
| 217 | (let ((count 0)) | 217 | (let ((count 0)) |
| 218 | (walk-windows (function (lambda (w) | 218 | (walk-windows (lambda (w) (setq count (+ count 1))) |
| 219 | (setq count (+ count 1)))) | ||
| 220 | minibuf) | 219 | minibuf) |
| 221 | count)) | 220 | count)) |
| 222 | 221 | ||
| @@ -379,8 +378,7 @@ subtree is balanced." | |||
| 379 | (h) | 378 | (h) |
| 380 | (tried-sizes) | 379 | (tried-sizes) |
| 381 | (last-sizes) | 380 | (last-sizes) |
| 382 | (windows (window-list nil 0)) | 381 | (windows (window-list nil 0))) |
| 383 | (counter 0)) | ||
| 384 | (when wt | 382 | (when wt |
| 385 | (while (not (member last-sizes tried-sizes)) | 383 | (while (not (member last-sizes tried-sizes)) |
| 386 | (when last-sizes (setq tried-sizes (cons last-sizes tried-sizes))) | 384 | (when last-sizes (setq tried-sizes (cons last-sizes tried-sizes))) |
| @@ -415,17 +413,16 @@ Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function." | |||
| 415 | (when w | 413 | (when w |
| 416 | (let ((dw (- w (- (bw-r wt) (bw-l wt))))) | 414 | (let ((dw (- w (- (bw-r wt) (bw-l wt))))) |
| 417 | (when (/= 0 dw) | 415 | (when (/= 0 dw) |
| 418 | (bw-adjust-window wt dw t)))) | 416 | (bw-adjust-window wt dw t)))) |
| 419 | (when h | 417 | (when h |
| 420 | (let ((dh (- h (- (bw-b wt) (bw-t wt))))) | 418 | (let ((dh (- h (- (bw-b wt) (bw-t wt))))) |
| 421 | (when (/= 0 dh) | 419 | (when (/= 0 dh) |
| 422 | (bw-adjust-window wt dh nil))))) | 420 | (bw-adjust-window wt dh nil))))) |
| 423 | (let* ((childs (cdr (assq 'childs wt))) | 421 | (let* ((childs (cdr (assq 'childs wt))) |
| 424 | (lastchild (car (last childs))) | ||
| 425 | (cw (when w (/ w (if (bw-eqdir 'hor wt) (length childs) 1)))) | 422 | (cw (when w (/ w (if (bw-eqdir 'hor wt) (length childs) 1)))) |
| 426 | (ch (when h (/ h (if (bw-eqdir 'ver wt) (length childs) 1))))) | 423 | (ch (when h (/ h (if (bw-eqdir 'ver wt) (length childs) 1))))) |
| 427 | (dolist (c childs) | 424 | (dolist (c childs) |
| 428 | (bw-balance-sub c cw ch))))) | 425 | (bw-balance-sub c cw ch))))) |
| 429 | 426 | ||
| 430 | ;;; A different solution to balance-windows | 427 | ;;; A different solution to balance-windows |
| 431 | 428 | ||
| @@ -561,7 +558,7 @@ window." | |||
| 561 | (old-point (point)) | 558 | (old-point (point)) |
| 562 | (size (and arg (prefix-numeric-value arg))) | 559 | (size (and arg (prefix-numeric-value arg))) |
| 563 | (window-full-p nil) | 560 | (window-full-p nil) |
| 564 | new-w bottom switch moved) | 561 | new-w bottom moved) |
| 565 | (and size (< size 0) (setq size (+ (window-height) size))) | 562 | (and size (< size 0) (setq size (+ (window-height) size))) |
| 566 | (setq new-w (split-window nil size)) | 563 | (setq new-w (split-window nil size)) |
| 567 | (or split-window-keep-point | 564 | (or split-window-keep-point |
| @@ -904,11 +901,8 @@ from true window top and bottom." | |||
| 904 | (arg (recenter arg)) ; Always respect ARG. | 901 | (arg (recenter arg)) ; Always respect ARG. |
| 905 | ((not (eq this-command last-command)) | 902 | ((not (eq this-command last-command)) |
| 906 | ;; First time - save mode and recenter. | 903 | ;; First time - save mode and recenter. |
| 907 | (let ((bottom (1+ (count-lines 1 (window-end)))) | 904 | (setq recenter-last-op 'middle) |
| 908 | (current (1+ (count-lines 1 (point)))) | 905 | (recenter)) |
| 909 | (total (window-height))) | ||
| 910 | (setq recenter-last-op 'middle) | ||
| 911 | (recenter))) | ||
| 912 | (t ;; repeat: loop through various options. | 906 | (t ;; repeat: loop through various options. |
| 913 | (setq recenter-last-op | 907 | (setq recenter-last-op |
| 914 | (ecase recenter-last-op | 908 | (ecase recenter-last-op |