>>589
add-to-list は既にリストに要素が含まれる場合は追加しないよ。
587 のは (setq l (cons x (remove x l))) てことだと思う。

>>590
(replace-regexp "^" "h" nil (save-excursion (goto-line n) (point))
(end (save-excursion (goto-line (1+ m)) (point))))