行末のスペースを目立たせる(途中まで)

emacs には whitespace.elというのがあって、行末に限らず空白文字を目立たせることができる。
xyzzy では表示の設定で全角スペースやタブ文字の表示を設定できるので、行末の空白文字だけを目立たせればいいかな。
途中まで書いてみた。

(defun show-trail-spaces ()
  (interactive)
  (let ((pattern "[ \t]+$"))        
    (save-excursion
      (goto-char (point-min))
      (while (scan-buffer pattern :regexp t :no-dup t)
        (set-text-attribute (match-beginning 0) (match-end 0)
                            'show-trail-spaces :background 3)))))

(defun hide-trail-spaces ()            
  (interactive)                 
  (delete-text-attributes 'show-trail-spaces))

;(add-hook '*post-command-hook* 'show-trail-spaces)

さて問題は、こんな重たそうなものを post-command-hook に追加していいものかどうか。
scan-buffer の範囲を限定するとか、特定のコマンドの入力後のみ実行するとかが必要な気がする。
whitespace.el も post-command-hook に 追加してるみたいだけど・・・。