Skip to content

Instantly share code, notes, and snippets.

@fredRos
Created May 8, 2017 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fredRos/c227fea8ce780f6173b31f654964e952 to your computer and use it in GitHub Desktop.
Save fredRos/c227fea8ce780f6173b31f654964e952 to your computer and use it in GitHub Desktop.
Minimal syntax highlighting for emails. Colorize multiple quotes up to 5 levels in different colors. Use with thunderbird as external editor.
;; http://ergoemacs.org/emacs/elisp_syntax_coloring.html
(setq fredmail-highlights
'(("^[ \t]*>>>>>.*$" . 'org-level-5)
("^[ \t]*>>>>.*$" . 'org-level-4)
("^[ \t]*>>>.*$" . 'org-level-3)
("^[ \t]*>>.*$" . 'org-level-2)
("^[ \t]*>.*$" . 'org-level-1)
("\\*.*\\*" . 'markdown-bold-face)
))
(define-derived-mode fredmail-mode fundamental-mode "fredmail"
"major mode for editing emails."
(setq font-lock-defaults '(fredmail-highlights)))
(add-to-list 'auto-mode-alist '("\\.eml\\'" . fredmail-mode))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment