From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dani Moncayo Newsgroups: gmane.emacs.bugs Subject: bug#13032: 24.3.50; Request: Provide a `delete-duplicate-lines' command Date: Sat, 1 Dec 2012 10:08:49 +0100 Message-ID: References: <87obig2ap2.fsf@mail.jurta.org> <874nk728ci.fsf@mail.jurta.org> <874nk63aps.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1354352997 16009 80.91.229.3 (1 Dec 2012 09:09:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2012 09:09:57 +0000 (UTC) Cc: Juanma Barranquero , 13032@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 01 10:10:09 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tej5M-0005M1-H2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Dec 2012 10:10:08 +0100 Original-Received: from localhost ([::1]:49869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tej5A-0004N6-TM for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Dec 2012 04:09:56 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tej57-0004Mn-Pn for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 04:09:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tej56-0007WC-Ry for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 04:09:53 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tej56-0007W8-Nh for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 04:09:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tej7C-0002ux-IS for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 04:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dani Moncayo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Dec 2012 09:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13032 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13032-submit@debbugs.gnu.org id=B13032.135435306311132 (code B ref 13032); Sat, 01 Dec 2012 09:12:02 +0000 Original-Received: (at 13032) by debbugs.gnu.org; 1 Dec 2012 09:11:03 +0000 Original-Received: from localhost ([127.0.0.1]:47928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tej6E-0002tU-GD for submit@debbugs.gnu.org; Sat, 01 Dec 2012 04:11:03 -0500 Original-Received: from mail-oa0-f44.google.com ([209.85.219.44]:50135) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tej6C-0002t6-73 for 13032@debbugs.gnu.org; Sat, 01 Dec 2012 04:11:01 -0500 Original-Received: by mail-oa0-f44.google.com with SMTP id n5so1229407oag.3 for <13032@debbugs.gnu.org>; Sat, 01 Dec 2012 01:08:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=jRS4/xa8z4rupURuUdxcedACWcyS67xy/D9+Z66FGcs=; b=UxHH/gWPw7+PIJr4zzTADGXFToedwdzmjIEG6y7f7XHqbdjRGv6ZXlcDVoAURBDe3Z PFOXjkSn82sZ4ln7xpf3vgVmWkz3s5/XSBXE2n5u25I8g1kCmRFNgnbCkLIhTp6ppsUg mgU7SNpIu9/MW7oZY3flVElAmmfHPb8vjTtnwyZaDk2U0vKPuz8+11o5NhQxqPU0szZ0 gTQIW6zFM+tyVFWHHcDBfWWZi7fLBCSOuleuIXeyUuihr9dgyEmqtNr1rzlV71ScRcCK TIMbCCawBkA3pooyZVFJhCwbfk+SrW0eeniXQ63bU1ppo6QJ5at5ZJnwwkbX6t2wrvn0 Ih4w== Original-Received: by 10.60.31.205 with SMTP id c13mr3269746oei.135.1354352929332; Sat, 01 Dec 2012 01:08:49 -0800 (PST) Original-Received: by 10.60.64.170 with HTTP; Sat, 1 Dec 2012 01:08:49 -0800 (PST) In-Reply-To: <874nk63aps.fsf@mail.jurta.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:67724 Archived-At: > (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