Snippets

Campbell Barton Improvement to suggestion from: https://emacs.stackexchange.com/q/147/2418

Created by Campbell Barton
(defun my-reset-frame-margin (window)
  (set-window-margins window 0 0)
  (set-window-margins window 0 (max (- (window-width window) fill-column) 0)))
(defun enable-fixed-editting-columns ()
  "Set the right window margin so the edittable space is only 80 columns."
  (interactive)
  (dolist (window (window-list)) (my-reset-frame-margin window)))
(add-to-list
  'window-size-change-functions
  (lambda (frame)
    (dolist (window (window-list frame)) (my-reset-frame-margin window))))
(add-hook
  'after-setting-font-hook
  (lambda ()
    (dolist (window (window-list)) (my-reset-frame-margin window))))

Comments (0)