From cc8708fc32ad33d723fdc35d56f808068ea43e9b Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sat, 2 Sep 2017 15:17:42 +0100 Subject: [PATCH] el/dot-emacs.el: New function to make Emacs frames a sensible width. Organization: Straylight/Edgeware From: Mark Wooding --- el/dot-emacs.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/el/dot-emacs.el b/el/dot-emacs.el index 5314fd9..c6c038c 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -217,6 +217,19 @@ (defun mdw-divvy-window (&optional width) (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 -- [mdw]