From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Gustav =?UTF-8?Q?H=C3=A5llberg?= Newsgroups: gmane.emacs.bugs Subject: bug#20276: 24.4; diff-mode doesn't handle unified diff file headers without tabs Date: Thu, 9 Apr 2015 00:38:55 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c3cf2874727105133e336d X-Trace: ger.gmane.org 1428532818 30609 80.91.229.3 (8 Apr 2015 22:40:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Apr 2015 22:40:18 +0000 (UTC) Cc: 20276@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 09 00:40:12 2015 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 1Yfydn-0005m2-VJ for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 Apr 2015 00:40:12 +0200 Original-Received: from localhost ([::1]:55234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfydn-0001pY-5P for geb-bug-gnu-emacs@m.gmane.org; Wed, 08 Apr 2015 18:40:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfydj-0001n6-4v for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 18:40:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yfyde-0004rV-UU for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 18:40:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yfyde-0004rH-Rb for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 18:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Yfyde-0006uy-Au for bug-gnu-emacs@gnu.org; Wed, 08 Apr 2015 18:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gustav =?UTF-8?Q?H=C3=A5llberg?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Apr 2015 22:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20276 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20276-submit@debbugs.gnu.org id=B20276.142853276426543 (code B ref 20276); Wed, 08 Apr 2015 22:40:02 +0000 Original-Received: (at 20276) by debbugs.gnu.org; 8 Apr 2015 22:39:24 +0000 Original-Received: from localhost ([127.0.0.1]:49645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yfyd2-0006u3-5j for submit@debbugs.gnu.org; Wed, 08 Apr 2015 18:39:24 -0400 Original-Received: from mail-lb0-f177.google.com ([209.85.217.177]:32788) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yfycz-0006tp-Kd for 20276@debbugs.gnu.org; Wed, 08 Apr 2015 18:39:22 -0400 Original-Received: by lbbzk7 with SMTP id zk7so78163479lbb.0 for <20276@debbugs.gnu.org>; Wed, 08 Apr 2015 15:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=AKMca7+Xk3ZWrtaarlLVCZmQZNpR4JbI2cv1MIJWqq8=; b=EV1k66/GzCc5R5iI1pLKi3RWXPhLxtXja/W102aumdRF7I1JhZJyrf6abXkZAiaH2I fb6atAu5iEkJXfVBb4jYrL6Iie/nzxHniSFHWorJxK68coDpGK/mXYGM8CQ5FvyhfFDq 5N2FxaFIwy99zc+LuQLTwKK5tyA8DAOHSZoDrnZo8BTCnw6SZKkQm34Hgg1Nouyqsb9E PLopottX88wgj0VPqjomK0k4+v8i8xqoIf8kHEM+dHbZpQR7P5mYpjiMfQOMnqAuXfuA b0OP2cZIMyArVk/5giq7U/SrG9pcuFhr29b0HGHR8BE3j12v24SlyJO4e6qYYQAEjTce +s8w== X-Received: by 10.112.235.38 with SMTP id uj6mr25814300lbc.9.1428532755721; Wed, 08 Apr 2015 15:39:15 -0700 (PDT) Original-Received: by 10.25.24.167 with HTTP; Wed, 8 Apr 2015 15:38:55 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:101312 Archived-At: --001a11c3cf2874727105133e336d Content-Type: text/plain; charset=UTF-8 On Wed, Apr 8, 2015 at 10:50 PM, Stefan Monnier wrote: > > Some diff programs will not emit tab + timestamp (as GNU diff does), > > but just the file name. > > Which diff programs do that? > diff -u with -L does for example: $ diff -u -Lfoo a.txt -Lbar b.txt --- foo +++ bar : git diff also does for what it's worth. > > > - (if (looking-at "[-*][-*][-*] \\([^\t]+\\)\t.*\n[-+][-+][-+] > > \\([^\t]+\\)") > > + (if (looking-at "[-*][-*][-*] \\([^\t\n]+\\).*\n[-+][-+][-+] > > \\([^\t\n]+\\)") > > Adding \n in the char-ranges is fine (it's a good change in itself), but > removing the \t increases the risk of false positives, so I'm a bit > worried about that. > True, but note that diff-font-lock-keywords is more permissive; it does not require the tab to be present. - Gustav > > > Stefan > --001a11c3cf2874727105133e336d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On W= ed, Apr 8, 2015 at 10:50 PM, Stefan Monnier <monnier@iro.umontrea= l.ca> wrote:
> Some diff programs will= not emit tab + timestamp (as GNU diff does),
> but just the file name.

Which diff programs do that?

diff -u with -L= does for example:

=C2=A0 $ diff -u -Lfoo a.txt -Lbar b.txt
=C2=A0 --- foo
=C2=A0 +++ bar
<= div>=C2=A0 =C2=A0 :

git diff also does for what it= 's worth.
=C2=A0

> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (looking-at "[-*][-*][-*]= \\([^\t]+\\)\t.*\n[-+][-+][-+]
> \\([^\t]+\\)")
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (looking-at "[-*][-*][-*]= \\([^\t\n]+\\).*\n[-+][-+][-+]
> \\([^\t\n]+\\)")

Adding \n in the char-ranges is fine (it's a good change in itself), bu= t
removing the \t increases the risk of false positives, so I'm a bit
worried about that.

True, but note that= diff-font-lock-keywords is more permissive; it does not require the tab to= be present.

- Gustav

=C2= =A0


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--001a11c3cf2874727105133e336d--