[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fri, 3 Dec 2010 18:41:12 -0800
Do we have something equivalent to the next command? I know the name
is bad as it is not same as UNIQ(1). It works better because sorting
is not required.
(defun uniq ()
"Omit duplicated lines."
(while (not (= (point) (point-max)))
(let* ((start (point))
(str (format "^%s"
(progn (forward-line 1)
(while (re-search-forward str nil t)
(delete-region (match-beginning 0) (match-end 0))))))))