From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: diff-apply-hunk broken Date: Thu, 25 Mar 2004 23:53:17 +0200 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87zna461bm.fsf@mail.jurta.org> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1080252120 32623 80.91.224.253 (25 Mar 2004 22:02:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Mar 2004 22:02:00 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Mar 25 23:01:40 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B6cuy-00012w-00 for ; Thu, 25 Mar 2004 23:01:40 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B6cux-0005UH-00 for ; Thu, 25 Mar 2004 23:01:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B6cqe-0002yR-6C for emacs-devel@quimby.gnus.org; Thu, 25 Mar 2004 16:57:12 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B6cpH-0002XA-Iq for emacs-devel@gnu.org; Thu, 25 Mar 2004 16:55:47 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B6coj-0002MS-Tc for emacs-devel@gnu.org; Thu, 25 Mar 2004 16:55:45 -0500 Original-Received: from [66.33.219.6] (helo=knife.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B6coi-0002LE-Qq for emacs-devel@gnu.org; Thu, 25 Mar 2004 16:55:12 -0500 Original-Received: from mail.jurta.org (80-235-37-18-dsl.mus.estpak.ee [80.235.37.18]) by knife.dreamhost.com (Postfix) with ESMTP id 8D98FE406D for ; Thu, 25 Mar 2004 13:55:06 -0800 (PST) Original-To: emacs-devel@gnu.org In-Reply-To: (Sam Steingold's message of "Thu, 25 Mar 2004 12:32:23 -0500") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20935 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20935 Sam Steingold writes: > in a modified CVS file, I do C-x v = (vc-diff) and in the resulting > *vc-diff* buffer I do C-c C-a (diff-apply-hunk) to reverse the section BTW, what do you think about the following problem? The problem is that the function `log-view-diff' can correctly work when her arguments `beg' and `end' are located on the same point. In this case it makes diffs with the next revision. But calling the function is impossible when region is not active. Due to the "r" interactive code letter it reports an error about mark-inactive. This is too inconvenient. This patch makes it possible to call this function even if region is not active. Maybe, a better solution could be to add a new code letter e.g. "R" to the `interactive' which will work like "r", but will be less restrictive and will allow a function to be called when region is inactive and will set both its arguments `beg' and `end' to the current point. This might be useful for some other functions too, where it makes sense to call a function either on the selected region or the current point. Index: emacs/lisp/log-view.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/log-view.el,v retrieving revision 1.17 diff -c -r1.17 log-view.el *** emacs/lisp/log-view.el 1 Sep 2003 15:45:13 -0000 1.17 --- emacs/lisp/log-view.el 25 Mar 2004 21:13:11 -0000 *************** *** 192,198 **** If the point is the same as the mark, get the diff for this revision. Otherwise, get the diff between the revisions were the region starts and ends." ! (interactive "r") (let ((fr (log-view-current-tag beg)) (to (log-view-current-tag end))) (when (string-equal fr to) --- 192,200 ---- If the point is the same as the mark, get the diff for this revision. Otherwise, get the diff between the revisions were the region starts and ends." ! (interactive ! (list (if mark-active (region-beginning) (point)) ! (if mark-active (region-end) (point)))) (let ((fr (log-view-current-tag beg)) (to (log-view-current-tag end))) (when (string-equal fr to) -- Juri Linkov http://www.jurta.org/emacs/