From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#11605: 24.1.50; vc-ediff revert annoyance Date: Fri, 26 Feb 2016 16:31:47 +1030 Message-ID: <87oab4ui0k.fsf@gnus.org> References: <87twkybos7.fsf@gnus.org> <14f8969f-2d5a-e2c3-50e3-5201425be6fd@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456466605 20816 80.91.229.3 (26 Feb 2016 06:03:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Feb 2016 06:03:25 +0000 (UTC) Cc: William Xu , 11605@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 26 07:03:13 2016 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 1aZBUf-0000CD-0g for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Feb 2016 07:03:13 +0100 Original-Received: from localhost ([::1]:47526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZBUe-00037i-H5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Feb 2016 01:03:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZBUZ-00037F-Sj for bug-gnu-emacs@gnu.org; Fri, 26 Feb 2016 01:03:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZBUU-0006x3-S0 for bug-gnu-emacs@gnu.org; Fri, 26 Feb 2016 01:03:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZBUU-0006wy-Os for bug-gnu-emacs@gnu.org; Fri, 26 Feb 2016 01:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aZBUU-0007kg-EL for bug-gnu-emacs@gnu.org; Fri, 26 Feb 2016 01:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Feb 2016 06:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11605 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch confirmed Original-Received: via spool by 11605-submit@debbugs.gnu.org id=B11605.145646653729746 (code B ref 11605); Fri, 26 Feb 2016 06:03:02 +0000 Original-Received: (at 11605) by debbugs.gnu.org; 26 Feb 2016 06:02:17 +0000 Original-Received: from localhost ([127.0.0.1]:46625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZBTl-0007ji-Ju for submit@debbugs.gnu.org; Fri, 26 Feb 2016 01:02:17 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:51779) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aZBTk-0007jb-BP for 11605@debbugs.gnu.org; Fri, 26 Feb 2016 01:02:16 -0500 Original-Received: from [175.103.25.178] (helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aZBTM-0004rK-Ow; Fri, 26 Feb 2016 07:01:53 +0100 In-Reply-To: <14f8969f-2d5a-e2c3-50e3-5201425be6fd@yandex.ru> (Dmitry Gutov's message of "Fri, 26 Feb 2016 02:38:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aZBTM-0004rK-Ow MailScanner-NULL-Check: 1457071314.16277@G8aiQ8boKEB2anH8VfE6eA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:113837 Archived-At: Dmitry Gutov writes: > On 02/24/2016 08:33 AM, Lars Ingebrigtsen wrote: > >>> @@ -1815,11 +1815,13 @@ Use BACKEND as the VC backend if specified." >>> (delete-file filename)))) >>> (vc-mode-line file)) >>> (message "Checking out %s...done" filename))) >>> - (let ((result-buf (find-file-noselect filename))) >>> + (let ((result-buf (or (get-file-buffer filename) >>> + (find-file-noselect filename)))) > > Doesn't find-file-noselect call get-file-buffer anyway? It does, but then it goes into all the "File %s changed on disk. Reread from disk?" stuff, which is what the bug is about. But, I mean, the file may have changed, so... >>> (with-current-buffer result-buf >>> ;; Set the parent buffer so that things like >>> ;; C-x v g, C-x v l, ... etc work. >>> - (set (make-local-variable 'vc-parent-buffer) filebuf)) >>> + (set (make-local-variable 'vc-parent-buffer) filebuf) >>> + (revert-buffer nil t)) > > It seems like this might conflict with other uses of vc-find-revision, > like vc-revision-other-window. Where the user is allowed to change the > contents of the returned buffer, and might've done so before we do > this automatic silent revert. > > Maybe do it on ediff's side instead? If the buffer with the comparison file had been killed before all this had happened, we wouldn't have gotten the "file changed on disk" thing, yes... That may be a better fix. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no