Skip to content
Matthieu Rakotojaona edited this page Mar 14, 2015 · 3 revisions

Emacs Integration

To configure Sup to use Emacs as an editor, set :editor: in $XDG_CONFIG_HOME/sup/config.yaml to the emacs command. Alternatively, use emacs -nw to run Emacs in text mode.

Excerpt from $XDG_CONFIG_HOME/sup/config.yaml:

:editor: emacs -nw

To configure emacs for writing mail, enable message-mode on files matching the regex "/sup.*eml$". Add this to your ~/.emacs:

(add-to-list 'auto-mode-alist '("/sup.*eml$" . message-mode))

If you want to enable some minor modes for convenience (e.g. auto-fill-mode, flyspell-mode) use a message-mode hook:

(add-hook 'message-mode-hook (lambda ()
  (auto-fill-mode 1)
  (flyspell-mode 1)))

To move the cursor down to the first empty line, add to the hook like this:

(add-hook 'message-mode-hook (lambda ()
  (auto-fill-mode 1)
  (flyspell-mode 1)
  (search-forward-regexp "^$")))
Clone this wiki locally