ubuntu 7.10: fixing emacs flyspell & transient mark mode bug

while working on a lengthy LaTeX text in my favourite editor, emacs, i noticed that once i turn on flyspell-mode (spell check as you type), that transient-mark-mode (highlight marked regions) would become borked :-( not good.

investigating the issue, it transpired that the flyspell.el and ispell.el files installed as part of the ubuntu 7.10 dictionaries-common package are a bit out of date: that problem has been fixed back in 2005. funnily enough the emacs-snapshot package brings along its own ispell and flyspell emacs lisp files that are more recent — and don’t have the problem fixed.

so, to sort this out i diverted the dictionaries-common versions like so:

% dpkg-divert --rename --local \
        --divert /usr/share/emacs/site-lisp/dictionaries-common/flyspell.el-borked \
        --add /usr/share/emacs/site-lisp/dictionaries-common/flyspell.el
Adding `local diversion of /usr/share/emacs/site-lisp/dictionaries-common/flyspell.el to /usr/share/emacs/site-lisp/dictionaries-common/flyspell.el-borked'
% dpkg-divert --rename --local \
        --divert /usr/share/emacs/site-lisp/dictionaries-common/ispell.el-borked \
        --add /usr/share/emacs/site-lisp/dictionaries-common/ispell.el
Adding `local diversion of /usr/share/emacs/site-lisp/dictionaries-common/ispell.el to /usr/share/emacs/site-lisp/dictionaries-common/ispell.el-borked'

this not only renames flyspell.el to flyspell.el-borked (and ispell.el to ispell.el-borked) but also does this in case there’s an update of the dictionaries-common package.