# HG changeset patch # User Augie Fackler # Date 1298500356 21600 # Node ID b9f4d059eb698a6a8fabccc4be1c9fdd6f6fbbe9 # Parent 3e1ec121efafbd59ce7ddeccc19d56538fde3779 emacs: function to set window width interactively diff --git a/.elisp/settings/50.localfuncs.el b/.elisp/settings/50.localfuncs.el --- 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))))