X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/blobdiff_plain/22e3f2873ee1856f0416f777cf2c625c5e4ddd2d..c7203018088c17c7c5516f62b508f04680c63ca2:/el/dot-emacs.el diff --git a/el/dot-emacs.el b/el/dot-emacs.el index d883666..950f2db 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -102,6 +102,15 @@ (defun mdw-config (sym) (concat "(" (buffer-string) ")"))))))) (cdr (assq sym mdw-config))) +;; Width configuration. + +(defvar mdw-column-width + (string-to-number (or (mdw-config 'emacs-width) "77")) + "Width of Emacs columns.") +(defvar mdw-text-width mdw-column-width + "Expected width of text within columns.") +(put 'mdw-text-width 'safe-local-variable 'integerp) + ;; Local variables hacking. (defun run-local-vars-mode-hook () @@ -196,8 +205,8 @@ (defun mdw-divvy-window (&optional width) (interactive "P") (setq width (cond (width (prefix-numeric-value width)) ((and window-system (mdw-emacs-version-p 22)) - 77) - (t 78))) + mdw-column-width) + (t (1+ mdw-column-width)))) (let* ((win (selected-window)) (sb-width (mdw-horizontal-window-overhead)) (c (/ (+ (window-width) sb-width) @@ -981,7 +990,7 @@ (defun mdw-misc-mode-config () (setq page-delimiter "\f\\|^.*-\\{6\\}.*$") (setq comment-column 40) (auto-fill-mode 1) - (setq fill-column 77) + (setq fill-column mdw-text-width) (and (fboundp 'gtags-mode) (gtags-mode)) (if (fboundp 'hs-minor-mode) @@ -991,6 +1000,7 @@ (defun mdw-misc-mode-config () (trap (turn-on-font-lock))) (defun mdw-post-local-vars-misc-mode-config () + (setq whitespace-line-column mdw-text-width) (when (and mdw-do-misc-mode-hacking (not buffer-read-only)) (setq show-trailing-whitespace t)