Using A Minimal Emacs With Spell Checking in Alpine

August 09, 2011

First you will need to change the default editor inside Alpine to

emacs -nw --no-init-file --no-splash --load ~/.emacs-mail

Via the key combination M S C or (main -> setup -> config) and search (Ctrl-W) for editor.

Next create the file ~/.emacs-mail (or any location as long as you update the command above) with the contents:

; Tell (Al)pine generated mail files to go into text-mode
(add-to-list 'auto-mode-alist '("\/tmp\/pico.[0-9]+" . text-mode))

; Turn on spell checking and auto fill
(dolist (hook '(text-mode-hook))
(add-hook hook (lambda () (flyspell-mode 1)))
(add-hook hook (lambda () (turn-on-auto-fill))))

(setq flyspell-issue-message-flag nil)

; Show date/time in status bar, and use 24 hour time
(setq display-time-day-and-date t display-time-24hr-format t)
(display-time)

; Show line and column numbers
(line-number-mode t)
(column-number-mode t)

; No more than 78 characters per line
(setq-default fill-column 78)

(menu-bar-mode 0)

This will load a minimal Emacs instance in your terminal with spell checking and a auto line length adjusting to 78 characters.