From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorgen Grahn Newsgroups: gmane.emacs.help Subject: Re: Copy Paste Detection Date: 21 Jan 2011 19:52:30 GMT Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1295774838 25420 80.91.229.12 (23 Jan 2011 09:27:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 23 Jan 2011 09:27:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 23 10:27:06 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PgwDx-00054R-KX for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Jan 2011 10:27:05 +0100 Original-Received: from localhost ([127.0.0.1]:56431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgwDw-00060Y-FO for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Jan 2011 04:27:04 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-X-Trace: individual.net Pak754CGiFy5HsA5IuMgsQ5DXe/rWqYYdhx36+0lLCWtUSiOfq Cancel-Lock: sha1:IMhehw4N/yhMv4AfrqgpYpVPl0A= User-Agent: slrn/pre0.9.9-111 (Linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:184494 X-Mailman-Approved-At: Sun, 23 Jan 2011 04:25:39 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78658 Archived-At: On Fri, 2011-01-21, Gary wrote: > Deniz Dogan wrote: > >> 2011/1/21 Gary: >>> Does anyone know of any modes that do (programming-)language >> independent >>> copy/paste (kill/yank) detection in emacs? >>> >>> I suppose external tools would also work, but I really would prefer it >>> if it was something I could usable on an emacs buffer. >> >> What do you mean? > > I mean that if in some code file someone has written the same code more > than once, or more likely copy/pasted it, I would like to identify those > code blocks. See http://pmd.sourceforge.net/cpd.html for an example. The > difference is, the language that I use is so little known that a tool > explicitly targeting it won't exist, hence the "language independent" > part. Sounds more like a job for % sort -b | uniq -c | sort -nr And manually detect suspiciously similar lines. /Jorgen -- // Jorgen Grahn O o .