From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Per Cederqvist Newsgroups: gmane.emacs.bugs Subject: diff-goto-source fails if "-p" is in diff-switches Date: Wed, 07 Feb 2007 15:12:51 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1170860443 8425 80.91.229.12 (7 Feb 2007 15:00:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Feb 2007 15:00:43 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 07 16:00:36 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HEoHV-0001Ai-JD for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Feb 2007 16:00:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HEoHV-0003jm-6I for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Feb 2007 10:00:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HEnXu-0008M4-LP for bug-gnu-emacs@gnu.org; Wed, 07 Feb 2007 09:13:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HEnXs-0008Ls-8R for bug-gnu-emacs@gnu.org; Wed, 07 Feb 2007 09:13:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HEnXs-0008Lp-1d for bug-gnu-emacs@gnu.org; Wed, 07 Feb 2007 09:13:12 -0500 Original-Received: from usagi.ingate.se ([193.180.23.12]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HEnXr-0007Z2-Id for bug-gnu-emacs@gnu.org; Wed, 07 Feb 2007 09:13:11 -0500 Original-Received: from rapture.ingate.se (rapture.ingate.se [193.180.23.42]) by usagi.ingate.se (8.12.11.20060308/8.12.11) with ESMTP id l17ED2gl014619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 7 Feb 2007 15:13:02 +0100 Original-Received: from rapture.ingate.se (localhost.localdomain [127.0.0.1]) by rapture.ingate.se (8.13.1/8.12.11) with ESMTP id l17ECvQd001351; Wed, 7 Feb 2007 15:12:57 +0100 Original-Received: (from ceder@localhost) by rapture.ingate.se (8.13.1/8.13.1/Submit) id l17ECpoS001350; Wed, 7 Feb 2007 15:12:51 +0100 X-Authentication-Warning: rapture.ingate.se: ceder set sender to ceder@ingate.com using -f X-Virus-Scanned: ClamAV version 0.88.7, clamav-milter version 0.88.7 on usagi.ingate.se X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (usagi.ingate.se [193.180.23.12]); Wed, 07 Feb 2007 15:13:02 +0100 (CET) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Wed, 07 Feb 2007 10:00:17 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:15577 Archived-At: --=-=-= Revision 1.94 of diff-mode.el (committed 2007-01-11) introduced a regression. Now, the diff-goto-source function fails with either of the error messages below if "-p" is present in diff-switches: Unrecognized context diff first hunk header format Unrecognized unified diff hunk header format The enclosed patch makes diff-sanity-check-hunk less picky on the format, so that diff-goto-sources starts working again even if diff-switches is set to "-p" or "-up". One way to reproduce the problem is to check out the Emacs source code from CVS, edit emacs/src/abbrev.c, inserting a character in the syms_of_abbrev function, saving the buffer, do M-x set-variable RET diff-switches RET "-up" RET, do M-x vc-diff, move the cursor down to the character you inserted, and press C-c C-c. Instead of jumping to the same place in the source buffer, you will get the second error message reported above. /ceder --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=patch Content-Description: Teach diff-sanity-check-hunk to accept output from diff -u Index: lisp/ChangeLog =================================================================== RCS file: /sources/emacs/emacs/lisp/ChangeLog,v retrieving revision 1.10655 diff -u -r1.10655 ChangeLog --- lisp/ChangeLog 7 Feb 2007 13:40:09 -0000 1.10655 +++ lisp/ChangeLog 7 Feb 2007 13:52:04 -0000 @@ -1,3 +1,8 @@ +2007-02-07 Per Cederqvist + + * diff-mode.el (diff-sanity-check-hunk): Don't reject the hunk + just because the diff was produced using "-p" (--show-c-function). + 2007-02-07 Vinicius Jose Latorre * ps-print.ps: The ps-print commands without face printing should not Index: lisp/diff-mode.el =================================================================== RCS file: /sources/emacs/emacs/lisp/diff-mode.el,v retrieving revision 1.94 diff -u -r1.94 diff-mode.el --- lisp/diff-mode.el 11 Jan 2007 16:52:59 -0000 1.94 +++ lisp/diff-mode.el 7 Feb 2007 13:52:04 -0000 @@ -1115,7 +1115,7 @@ ;; A context diff. ((eq (char-after) ?*) - (if (not (looking-at "\\*\\{15\\}\n\\*\\*\\* \\([0-9]+\\),\\([0-9]+\\) \\*\\*\\*\\*$")) + (if (not (looking-at "\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\([0-9]+\\) \\*\\*\\*\\*$")) (error "Unrecognized context diff first hunk header format") (forward-line 2) (diff-sanity-check-context-hunk-half @@ -1131,7 +1131,7 @@ ;; A unified diff. ((eq (char-after) ?@) (if (not (looking-at - "@@ -[0-9]+,\\([0-9]+\\) \\+[0-9]+,\\([0-9]+\\) @@$")) + "@@ -[0-9]+,\\([0-9]+\\) \\+[0-9]+,\\([0-9]+\\) @@")) (error "Unrecognized unified diff hunk header format") (let ((before (string-to-number (match-string 1))) (after (string-to-number (match-string 2)))) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ bug-gnu-emacs mailing list bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs --=-=-=--