bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13032: 24.3.50; Request: Provide a `delete-duplicate-lines' command


From: Dani Moncayo
Subject: bug#13032: 24.3.50; Request: Provide a `delete-duplicate-lines' command
Date: Sat, 1 Dec 2012 10:08:49 +0100

> (defun delete-duplicate-lines (rstart rend &optional reverse adjacent 
> interactive)
>   "Delete duplicate lines in the region between RSTART and REND.
> If REVERSE is nil, search and delete duplicates forward keeping the first
> occurrence of duplicate lines.  If REVERSE is non-nil, search and delete
> duplicates backward keeping the last occurrence of duplicate lines.
> If ADJACENT is non-nil, delete repeated lines only if they are adjacent."

Looks pretty fine to me.  Your version is more general and versatile.

Some comments:
* Why is needed the INTERACTIVE command?  I mean, Cannot that info
(whether the function has been called interactively) be retrieved
using some Lips primitive?
* In case the INTERACTIVE command is indeed necessary, it should be
explained in the docstring, no?
* I think that the docstring should explain also the return value
(number of duplicate lines deleted).

Thank you Juri.  I hope Stefan or Chong add this feature to Emacs.

-- 
Dani Moncayo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]