GNU bug report logs - #44026
[PATCH] vc.el: vc-revision-other-window does not select the buffer

Previous Next

Package: emacs;

Reported by: Koichi Arakawa <arakawa <at> pp.iij4u.or.jp>

Date: Fri, 16 Oct 2020 03:15:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44026 in the body.
You can then email your comments to 44026 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#44026; Package emacs. (Fri, 16 Oct 2020 03:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Koichi Arakawa <arakawa <at> pp.iij4u.or.jp>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 16 Oct 2020 03:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Koichi Arakawa <arakawa <at> pp.iij4u.or.jp>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] vc.el: vc-revision-other-window does not select the buffer
Date: Fri, 16 Oct 2020 12:14:15 +0900
 (東京 (標準時))
Hi,

The current version of vc-revision-other-window does not select a
buffer which contains the specified revision.  But ediff-vc-internal,
for example, expects the buffer is selected as the current one.

So I think the following patch is needed.

Regards,
Koichi Arakawa

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 46c44fa54b..f34bd0f2a1 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2058,13 +2058,12 @@ If `F.~REV~' already exists, use it instead of checking it out again."
      (list
       (vc-read-revision "Revision to visit (default is working revision): "
                         (list buffer-file-name)))))
-  (with-current-buffer (or (buffer-base-buffer) (current-buffer))
-    (vc-ensure-vc-buffer)
-    (let* ((file buffer-file-name)
-	   (revision (if (string-equal rev "")
-		         (vc-working-revision file)
-		       rev)))
-      (switch-to-buffer-other-window (vc-find-revision file revision)))))
+  (vc-ensure-vc-buffer)
+  (let* ((file buffer-file-name)
+	 (revision (if (string-equal rev "")
+		       (vc-working-revision file)
+		     rev)))
+    (switch-to-buffer-other-window (vc-find-revision file revision))))
 
 (defun vc-find-revision (file revision &optional backend)
   "Read REVISION of FILE into a buffer and return the buffer.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44026; Package emacs. (Fri, 16 Oct 2020 05:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 44026 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Koichi Arakawa <arakawa <at> pp.iij4u.or.jp>
Cc: 44026 <at> debbugs.gnu.org
Subject: Re: bug#44026: [PATCH] vc.el: vc-revision-other-window does not
 select the buffer
Date: Fri, 16 Oct 2020 07:27:24 +0200
Koichi Arakawa <arakawa <at> pp.iij4u.or.jp> writes:

> The current version of vc-revision-other-window does not select a
> buffer which contains the specified revision.  But ediff-vc-internal,
> for example, expects the buffer is selected as the current one.

Do you have a recipe to reproduce this bug?  When I use the `C-x v ~'
command, I don't get any errors.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44026; Package emacs. (Fri, 16 Oct 2020 06:27:02 GMT) Full text and rfc822 format available.

Message #11 received at 44026 <at> debbugs.gnu.org (full text, mbox):

From: Koichi Arakawa <arakawa <at> pp.iij4u.or.jp>
To: larsi <at> gnus.org
Cc: 44026 <at> debbugs.gnu.org
Subject: Re: bug#44026: [PATCH] vc.el: vc-revision-other-window does not
 select the buffer
Date: Fri, 16 Oct 2020 15:26:12 +0900
 (東京 (標準時))
Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> Koichi Arakawa <arakawa <at> pp.iij4u.or.jp> writes:
> 
>> The current version of vc-revision-other-window does not select a
>> buffer which contains the specified revision.  But ediff-vc-internal,
>> for example, expects the buffer is selected as the current one.
> 
> Do you have a recipe to reproduce this bug?  When I use the `C-x v ~'
> command, I don't get any errors.

Yes.
* Open a version controlled file,
* M-x ediff-revision,
* accept defaults,
you will see the identical two buffers in the window. And the file has
been deleted.
-- 
Koichi Arakawa





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44026; Package emacs. (Fri, 16 Oct 2020 06:40:02 GMT) Full text and rfc822 format available.

Message #14 received at 44026 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Koichi Arakawa <arakawa <at> pp.iij4u.or.jp>
Cc: 44026 <at> debbugs.gnu.org
Subject: Re: bug#44026: [PATCH] vc.el: vc-revision-other-window does not
 select the buffer
Date: Fri, 16 Oct 2020 08:39:04 +0200
Koichi Arakawa <arakawa <at> pp.iij4u.or.jp> writes:

> Yes.
> * Open a version controlled file,
> * M-x ediff-revision,
> * accept defaults,
> you will see the identical two buffers in the window. And the file has
> been deleted.

Geez.  The bug was introduced in the previous change for indirect
buffers.  I've now made a different change than your proposed patch and
pushed to the trunk -- can you check whether this fixes the problem?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44026; Package emacs. (Fri, 16 Oct 2020 06:55:01 GMT) Full text and rfc822 format available.

Message #17 received at 44026 <at> debbugs.gnu.org (full text, mbox):

From: Koichi Arakawa <arakawa <at> pp.iij4u.or.jp>
To: larsi <at> gnus.org
Cc: 44026 <at> debbugs.gnu.org
Subject: Re: bug#44026: [PATCH] vc.el: vc-revision-other-window does not
 select the buffer
Date: Fri, 16 Oct 2020 15:54:14 +0900
 (東京 (標準時))
Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> Koichi Arakawa <arakawa <at> pp.iij4u.or.jp> writes:
> 
>> Yes.
>> * Open a version controlled file,
>> * M-x ediff-revision,
>> * accept defaults,
>> you will see the identical two buffers in the window. And the file has
>> been deleted.
> 
> Geez.  The bug was introduced in the previous change for indirect
> buffers.  I've now made a different change than your proposed patch and
> pushed to the trunk -- can you check whether this fixes the problem?

Sure. I've confirmed the fixes work properly. Thanks a lot.
-- 
Koichi Arakawa





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44026; Package emacs. (Fri, 16 Oct 2020 07:14:02 GMT) Full text and rfc822 format available.

Message #20 received at 44026 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Koichi Arakawa <arakawa <at> pp.iij4u.or.jp>
Cc: 44026 <at> debbugs.gnu.org
Subject: Re: bug#44026: [PATCH] vc.el: vc-revision-other-window does not
 select the buffer
Date: Fri, 16 Oct 2020 09:13:11 +0200
Koichi Arakawa <arakawa <at> pp.iij4u.or.jp> writes:

> Sure. I've confirmed the fixes work properly. Thanks a lot.

Thanks for checking.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 16 Oct 2020 07:14:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 44026 <at> debbugs.gnu.org and Koichi Arakawa <arakawa <at> pp.iij4u.or.jp> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 16 Oct 2020 07:14:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 13 Nov 2020 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.