=== modified file 'lisp/window.el' --- lisp/window.el 2012-05-04 23:16:47 +0000 +++ lisp/window.el 2012-05-05 02:23:30 +0000 @@ -5173,19 +5173,41 @@ (let ((window-min-height (min 2 height))) ; One text line plus a modeline. (window-resize window delta))))) +(defun enlarge-window-horizontally-1 (delta) + "Make selected window DELTA columns wider." + (let ((first t) + (step t) + (ev last-command-event) + (echo-keystrokes nil) + (enlarge-char (if (> delta 0) ?} ?{)) + (shrink-char (if (> delta 0) ?{ ?}))) + (while step + (let ((base (event-basic-type ev))) + (setq step (cond ((or first (eq base enlarge-char)) + delta) + ((eq base shrink-char) + (- delta))))) + (when step + (if (> 0 step) + (enlarge-window step t) + (shrink-window (- step) t)) + (setq first nil) + (setq ev (read-event "},{ for further adjustment: ")))) + (push ev unread-command-events))) + (defun enlarge-window-horizontally (delta) "Make selected window DELTA columns wider. Interactively, if no argument is given, make selected window one column wider." (interactive "p") - (enlarge-window delta t)) + (enlarge-window-horizontally-1 delta)) (defun shrink-window-horizontally (delta) "Make selected window DELTA columns narrower. Interactively, if no argument is given, make selected window one column narrower." (interactive "p") - (shrink-window delta t)) + (enlarge-window-horizontally-1 (- delta))) (defun count-screen-lines (&optional beg end count-final-newline window) "Return the number of screen lines in the region.