I recently hit a bug in a recent build of GNU Emacs. The crux of the matter was
that word-relative functions such as forward-word
now respect subword-mode
and superword-mode
. This is good for interactive use, but can have unintended
consequences in existing code, which is what happened with ERC: ERC expected
forward-word
to move consistently, but now it behaves differently if
subword-mode
is active.
The solution seems to be to forgo forward-mode
and friends for interactive
use, and to use more low-level functions in programs. For instance, I replaced
(upcase-word 1)
with
(skip-syntax-forward "^w") (let* ((word-start (point)) (word-end (progn (skip-syntax-forward "w") (point)))) (upcase-region word-start word-end))
Way more verbose than I would like, but it works.