I put this together which segments words in camel-cased identifiers:
(setq-default spell-fu-word-regexp (rx (or ;; lowercase (seq (one-or-more lower) (opt (any "'’") (one-or-more lower) word-end)) ;; capitalized (seq upper (zero-or-more lower) (opt (any "'’") (one-or-more lower) word-end)) ;; uppercase (seq (one-or-more upper) (opt (any "'’") (one-or-more upper) word-end))))) (defun cs/spell-fu-check-range (pos-beg pos-end) (let (case-fold-search) (spell-fu-check-range-default pos-beg pos-end))) (setq-default spell-fu-check-range #'cs/spell-fu-check-range)
Though, I think it's not very fast due to not being able to look for word boundaries any more. Regular expression lookahead and lookbehind would help, but Emacs does not have them.
I wonder if a more efficient solution is possible.
Thank you for this package.