Emacs and I agree on many things. That's good. However, there is one thing we disagree on – the default value for
fill-column for different major modes. In order to alleviate this, I added the following to my init file:
(let ((fill-column-mode-alist '((org-mode . 80) (markdown-mode . 80) (tex-mode . 80) (python-mode . 79)))) (defun modify-fill-column-maybe () "Call `set-fill-column' with a value according to the major mode." (let ((value (assoc major-mode fill-column-mode-alist #'provided-mode-derived-p))) (when value (set-fill-column (cdr value)))))) (add-hook 'after-change-major-mode-hook #'modify-fill-column-maybe)
My question is whether there is something fundamentally wrong with my approach. Any pitfalls that I am overlooking? Is there maybe a built-in functionality for this that I am not aware of?