diff .elisp/settings/50.localfuncs.el @ 237:b9f4d059eb69

emacs: function to set window width interactively
author Augie Fackler <durin42@gmail.com>
date Wed, 23 Feb 2011 16:32:36 -0600
parents c965d5dbd868
children 3d5c595c229e
line wrap: on
line diff
--- a/.elisp/settings/50.localfuncs.el
+++ b/.elisp/settings/50.localfuncs.el
@@ -119,3 +119,13 @@ Delimiters are paired characters: ()[]<>«»“”‘’「」, including \"\"."
         (goto-char pos)
       (message "No matching other paren found.")
       )))
+
+(defun af-set-window-width (&optional columns)
+  "Make selected window COLUMNS wide.
+
+Interactively, if no argument is given, make selected window 80
+columns wide.
+"
+  (interactive "p")
+  (let* ((cols (if (or (not columns) (> 0 columns)) 80 columns)))
+    (shrink-window-horizontally (- (window-width) cols))))