el/dot-emacs.el: New function to make Emacs frames a sensible width.
[profile] / el / dot-emacs.el
index 5314fd9..c6c038c 100644 (file)
@@ -217,6 +217,19 @@ fringes is not taken out of the allowance for WIDTH, unlike
       (other-window 1))
     (select-window win)))
 
+(defun mdw-set-frame-width (columns &optional width)
+  (interactive "nColumns: 
+P")
+  (setq width (cond (width (prefix-numeric-value width))
+                   ((and window-system (mdw-emacs-version-p 22))
+                    mdw-column-width)
+                   (t (1+ mdw-column-width))))
+  (let ((sb-width (mdw-horizontal-window-overhead)))
+    (set-frame-width (selected-frame)
+                    (- (* columns (+ width sb-width))
+                       sb-width))
+    (mdw-divvy-window width)))
+
 ;; Don't raise windows unless I say so.
 
 (defvar mdw-inhibit-raise-frame nil