036-long-lines.el 511 B

12345678910111213141516171819
  1. (defcustom long-line-limit 120
  2. "Lines containing more characters than this limit will be considered long"
  3. :type 'integer
  4. :group 'long-lines-highlight)
  5. (require 'column-marker)
  6. (defun mark-long-lines ()
  7. (interactive)
  8. (column-marker-3 long-line-limit))
  9. (defun unmark-long-lines ()
  10. (interactive)
  11. (column-marker-3 -1))
  12. (set-face-attribute 'column-marker-3 nil
  13. :background "dark red")
  14. (add-hook 'prog-mode-hook (lambda () (unless (derived-mode-p 'web-mode) (mark-long-lines))))