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

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Thu, 29 Nov 2012 19:26:01 UTC

Severity: wishlist

Found in version 24.3.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, 13032 <at> debbugs.gnu.org
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




This bug report was last modified 12 years and 172 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.