From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Yates Newsgroups: gmane.emacs.devel Subject: Re: Feature request Date: Thu, 7 Nov 2013 16:18:08 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11c350da6586cc04ea9ccd70 X-Trace: ger.gmane.org 1383859134 25736 80.91.229.3 (7 Nov 2013 21:18:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Nov 2013 21:18:54 +0000 (UTC) Cc: Michael Kifer , Stefan Monnier , Emacs developers To: Matzi Kratzi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 07 22:18:59 2013 Return-path: Envelope-to: ged-emacs-devel@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 1VeWy0-0004bL-Vk for ged-emacs-devel@m.gmane.org; Thu, 07 Nov 2013 22:18:17 +0100 Original-Received: from localhost ([::1]:42512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeWy0-0005ki-FC for ged-emacs-devel@m.gmane.org; Thu, 07 Nov 2013 16:18:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeWxv-0005kb-VL for emacs-devel@gnu.org; Thu, 07 Nov 2013 16:18:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeWxu-0006Ep-T9 for emacs-devel@gnu.org; Thu, 07 Nov 2013 16:18:11 -0500 Original-Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:44840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeWxu-0006ET-IX for emacs-devel@gnu.org; Thu, 07 Nov 2013 16:18:10 -0500 Original-Received: by mail-wi0-f178.google.com with SMTP id hn9so1290689wib.11 for ; Thu, 07 Nov 2013 13:18:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Z2WaCksNGjahmk5Obk7CPmBP10WQMpHAz0p67g16M/g=; b=waEF8U2LO2njB+LWGXS0+GH7GWa+/+nXb0R43wsOIidQjJIon11K1N6hxYO6JMBffd R6nloMODj+cT4yOjjcZKs440rT3KAwrAWx7V/xssudBnRprmib+6OwzyN3I1IleHaB4s OqjoU8/LURj+7X8Mti3zDaKHTlymdWOjZAfsK+WsWqLBb+GMX1pq6ySYgifP1TmL1nS6 aNuVnq4I70+e4qEbDSdZnqEqxf93yZFIqy/Tr870F6eC9g4rWs070Kge9eBEFf1TUmV+ yS+7FoRXQlWXMoVWlT1lJ/fOUbdAq4+eixjQXC9+CWYl8JHQRGNcNdPoJ8pf+UPgyk6E Kwmw== X-Received: by 10.180.185.130 with SMTP id fc2mr4284856wic.43.1383859088613; Thu, 07 Nov 2013 13:18:08 -0800 (PST) Original-Received: by 10.194.95.226 with HTTP; Thu, 7 Nov 2013 13:18:08 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: p8ITJ6KQH7LCcFwEDgR8jpmaKEE X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165054 Archived-At: --001a11c350da6586cc04ea9ccd70 Content-Type: multipart/alternative; boundary=001a11c350da6586c804ea9ccd6e --001a11c350da6586c804ea9ccd6e Content-Type: text/plain; charset=ISO-8859-1 What you are describing is a poor-man's form of patience diff. Google it if unfamiliar. Attached is a just slightly tweaked version I stole from bzr. I have my emacs ediff-compare-program set to ~/bin/pdiff. Being a python script it potentially may be a bit slow (though I have never had a problem). An alternative I saw on stackoverlow would be to use git: $ git diff --no-index --patience file1 file2 /john --001a11c350da6586c804ea9ccd6e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
What you are describing is a poor-man's form of patien= ce diff. =A0Google it if unfamiliar.

Attached is a just slightly twe= aked version I stole from bzr. =A0I have my emacs ediff-compare-program set= to ~/bin/pdiff.

Being a python script it potentially may be a bit slow (thou= gh I have never had a problem). =A0An alternative I saw on stackoverlow wou= ld be to use git:

$ git diff --no-index --patience file1 file2

/john

--001a11c350da6586c804ea9ccd6e-- --001a11c350da6586cc04ea9ccd70 Content-Type: application/octet-stream; name=pdiff Content-Disposition: attachment; filename=pdiff Content-Transfer-Encoding: base64 X-Attachment-Id: f_hnqhmmt70 IyEvdXNyL2Jpbi9lbnYgcHl0aG9uCiMgQ29weXJpZ2h0IChDKSAyMDA1LCAyMDA2LCAyMDA3IENh bm9uaWNhbCBMdGQKIwojIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJl ZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5CiMgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBH TlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkKIyB0aGUgRnJlZSBTb2Z0 d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvcgojIChh dCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uCiMKIyBUaGlzIHByb2dyYW0gaXMgZGlz dHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ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hY2UnIG9yIHRhZyA9PSAnZGVsZXRlJzoK ICAgICAgICAgICAgICAgIGZvciBsaW5lIGluIGFbaTE6aTJdOgogICAgICAgICAgICAgICAgICAg IHlpZWxkICctJyArIGxpbmUKICAgICAgICAgICAgaWYgdGFnID09ICdyZXBsYWNlJyBvciB0YWcg PT0gJ2luc2VydCc6CiAgICAgICAgICAgICAgICBmb3IgbGluZSBpbiBiW2oxOmoyXToKICAgICAg ICAgICAgICAgICAgICB5aWVsZCAnKycgKyBsaW5lCgoKZGVmIHVuaWZpZWRfZGlmZl9maWxlcyhh LCBiLCBzZXF1ZW5jZW1hdGNoZXI9Tm9uZSk6CiAgICAiIiJHZW5lcmF0ZSB0aGUgZGlmZiBmb3Ig dHdvIGZpbGVzLgogICAgIiIiCiAgICAjIFNob3VsZCB0aGlzIGFjdHVhbGx5IGJlIGFuIGVycm9y PwogICAgaWYgYSA9PSBiOgogICAgICAgIHJldHVybiBbXQogICAgaWYgYSA9PSAnLSc6CiAgICAg ICAgZmlsZV9hID0gc3lzLnN0ZGluCiAgICAgICAgdGltZV9hID0gdGltZS50aW1lKCkKICAgIGVs c2U6CiAgICAgICAgZmlsZV9hID0gb3BlbihhLCAncmInKQogICAgICAgIHRpbWVfYSA9IG9zLnN0 YXQoYSkuc3RfbXRpbWUKCiAgICBpZiBiID09ICctJzoKICAgICAgICBmaWxlX2IgPSBzeXMuc3Rk aW4KICAgICAgICB0aW1lX2IgPSB0aW1lLnRpbWUoKQogICAgZWxzZToKICAgICAgICBmaWxlX2Ig PSBvcGVuKGIsICdyYicpCiAgICAgICAgdGltZV9iID0gb3Muc3RhdChiKS5zdF9tdGltZQoKICAg ICMgVE9ETzogSW5jbHVkZSBmcm9tZmlsZWRhdGUgYW5kIHRvZmlsZWRhdGUKICAgIHJldHVybiB1 bmlmaWVkX2RpZmYoZmlsZV9hLnJlYWRsaW5lcygpLCBmaWxlX2IucmVhZGxpbmVzKCksCiAgICAg ICAgICAgICAgICAgICAgICAgIGZyb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