>>762 こんな?
(defun foo ()
(interactive)
(let ((s (make-buffer-stream (selected-buffer)))
line buf)
(while (setq line (read-line s nil))
(pushnew line buf :test #'equal))
(pop-to-buffer (get-buffer-create "*重複しとらんよ*") t)
(erase-buffer (selected-buffer))
(insert (format nil "~{~A~%~}" (reverse buf)))))