GNU bug report logs - #35166
27.0.50; Buffer state inconsistent after vc-retrieve-tag

Previous Next

Package: emacs;

Reported by: Mauro Aranda <maurooaranda <at> gmail.com>

Date: Fri, 5 Apr 2019 21:43:02 UTC

Severity: minor

Tags: confirmed

Found in version 27.0.50

Fixed in version 29.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 35166 in the body.
You can then email your comments to 35166 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#35166; Package emacs. (Fri, 05 Apr 2019 21:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mauro Aranda <maurooaranda <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 05 Apr 2019 21:43:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: 27.0.50; Buffer state inconsistent after vc-retrieve-tag
Date: Fri, 5 Apr 2019 18:41:34 -0300
[Message part 1 (text/plain, inline)]
Hello.

Suppose the following workflow for exploring code, under version
control:
1. Start emacs: emacs -Q.
2. Visit a directory in Dired mode, e.g. C-x d "emacs/lisp/eshell".
3. Navigate to a file, and type 'v'.
4. While exploring, one may wish to switch branch, so type:
C-x v r BRANCH-NAME

I find the following to be inconsistent:

'vc-retrieve-tag' makes an effort to preserve the modes in the file.
So it preserves View mode.  But the file is no longer read-only.  This
way, the buffer ends up being writable, but with View mode enabled, and
I find it a little confusing.  I understand if that is to respect
'revert-buffer' design, as I infer from this message:
[1] https://lists.gnu.org/archive/html/emacs-devel/2004-09/msg00002.html
But I think the user could at least be warned about this, in the manual
(perhaps in the VC Branches section).

After reading [1], I tested the workflow with auto-revert-mode set to 't',
and
it works as expected, based on the information in the following messages
to [1].

Trying out simple solutions for myself, I answered "no" to the prompt
that VC puts: "Update any affected buffers? (yes or no)".  I wouldn't
answer no in the workflow I described, but I answered "no" just for the
sake of it.  I ended up with the buffer being updated, and again with
View mode enabled, but not with buffer-read-only set to 't'.
So I wonder, what is the effect of answering "yes" or "no"?  What does
it update, and what does it not?  I couldn't find such information in
the VC section of the manual.

Please, consider either improving what 'vc-retrieve-tag' does, regarding the
previous state of the buffer, or improving the documentation about this
behavior.  Or, if you think I'm plain wrong, please explain me the
reasons, since I would like to understand more of it.

Best regards,
Mauro.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35166; Package emacs. (Sat, 04 May 2019 21:18:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: 35166 <at> debbugs.gnu.org
Subject: Re: bug#35166: 27.0.50;
 Buffer state inconsistent after vc-retrieve-tag
Date: Sat, 4 May 2019 18:16:49 -0300
[Message part 1 (text/plain, inline)]
Hello.

Any thoughts on this?
[Message part 2 (text/html, inline)]

Added tag(s) confirmed. Request was from Akshay Gaikwad <akgaikwad001 <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 11 Jul 2019 01:55:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35166; Package emacs. (Tue, 22 Jun 2021 17:31:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 35166 <at> debbugs.gnu.org
Subject: Re: bug#35166: 27.0.50; Buffer state inconsistent after
 vc-retrieve-tag
Date: Tue, 22 Jun 2021 19:30:01 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> Suppose the following workflow for exploring code, under version
> control:
> 1. Start emacs: emacs -Q.
> 2. Visit a directory in Dired mode, e.g. C-x d "emacs/lisp/eshell".
> 3. Navigate to a file, and type 'v'.
> 4. While exploring, one may wish to switch branch, so type:
> C-x v r BRANCH-NAME
>
> I find the following to be inconsistent:
>
> 'vc-retrieve-tag' makes an effort to preserve the modes in the file.
> So it preserves View mode.  But the file is no longer read-only.

I can confirm that this behaviour is still present in Emacs 28.

> This way, the buffer ends up being writable, but with View mode
> enabled, and I find it a little confusing.  I understand if that is to
> respect 'revert-buffer' design, as I infer from this message: [1]
> https://lists.gnu.org/archive/html/emacs-devel/2004-09/msg00002.html

I think this was changed in:

commit 90e118abf2dcc4aca4d7a7642247fa488554351e
Author:     Luc Teirlinck <teirllm <at> auburn.edu>
AuthorDate: Fri Sep 3 22:28:10 2004 +0000

    (auto-revert-handler): Bind `buffer-read-only' locally around the call
    to `revert-buffer'.

Reversion now preserves buffer-readedness, if I understand correctly.

> Please, consider either improving what 'vc-retrieve-tag' does, regarding the
> previous state of the buffer, or improving the documentation about this
> behavior.  Or, if you think I'm plain wrong, please explain me the
> reasons, since I would like to understand more of it.

I think it would make sense for `vc-retrieve-tag' to preserve the
readedness of the buffer.  Anybody got any comments here?

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




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 22 Jun 2021 17:31:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35166; Package emacs. (Tue, 22 Jun 2021 17:42:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 35166 <at> debbugs.gnu.org
Subject: Re: bug#35166: 27.0.50; Buffer state inconsistent after
 vc-retrieve-tag
Date: Tue, 22 Jun 2021 19:40:52 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Reversion now preserves buffer-readedness, if I understand correctly.

Er, sorry -- not it doesn't -- only automatic autoreversion does, as
Mauro already said.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35166; Package emacs. (Wed, 23 Jun 2021 15:13:01 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 35166 <at> debbugs.gnu.org
Subject: Re: bug#35166: 27.0.50; Buffer state inconsistent after
 vc-retrieve-tag
Date: Wed, 23 Jun 2021 12:13:28 -0300
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>
>> Please, consider either improving what 'vc-retrieve-tag' does, regarding the
>> previous state of the buffer, or improving the documentation about this
>> behavior.  Or, if you think I'm plain wrong, please explain me the
>> reasons, since I would like to understand more of it.
>
> I think it would make sense for `vc-retrieve-tag' to preserve the
> readedness of the buffer.  Anybody got any comments here?

FWIW, I've been saving the readedness since I reported this bug by using
before-revert-hook and after-revert-hook.

I don't know if vc-retrieve-tag should save it, but I think leaving the
buffer in this state (view-mode on and not read-only) should be avoided,
if possible.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35166; Package emacs. (Thu, 22 Jul 2021 14:27:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 35166 <at> debbugs.gnu.org
Subject: Re: bug#35166: 27.0.50; Buffer state inconsistent after
 vc-retrieve-tag
Date: Thu, 22 Jul 2021 16:25:54 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> FWIW, I've been saving the readedness since I reported this bug by using
> before-revert-hook and after-revert-hook.
>
> I don't know if vc-retrieve-tag should save it, but I think leaving the
> buffer in this state (view-mode on and not read-only) should be avoided,
> if possible.

Nobody else had an opinion, so I've now made revert-buffer preserve
buffer-read-only on the trunk, and we'll see whether that messes up
anybody's work flow...

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




bug marked as fixed in version 28.1, send any further explanations to 35166 <at> debbugs.gnu.org and Mauro Aranda <maurooaranda <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 22 Jul 2021 14:27:02 GMT) Full text and rfc822 format available.

bug No longer marked as fixed in versions 28.1 and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 27 Jul 2021 15:25:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35166; Package emacs. (Tue, 27 Jul 2021 15:26:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 35166 <at> debbugs.gnu.org, Emacs developers <emacs-devel <at> gnu.org>
Subject: Re: Change in `revert-buffer' behavior [28.0.50]
Date: Tue, 27 Jul 2021 17:25:40 +0200
Kaushal Modi <kaushal.modi <at> gmail.com> writes:

> When I change the read-onlyness of a file from the disk, M-x revert-buffer
> doesn't reflect that change any more. This is really important as I am working in
> a centralized VCS where the files have to be "checked out" i.e. make writable
> before I can modify them.

I've now reverted the change and reopened bug#35166 -- the problem there
will have to be fixed in a different way.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35166; Package emacs. (Tue, 27 Jul 2021 15:41:02 GMT) Full text and rfc822 format available.

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

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 35166 <at> debbugs.gnu.org, Emacs developers <emacs-devel <at> gnu.org>
Subject: Re: Change in `revert-buffer' behavior [28.0.50]
Date: Tue, 27 Jul 2021 11:39:55 -0400
[Message part 1 (text/plain, inline)]
On Tue, Jul 27, 2021 at 11:25 AM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

>
> I've now reverted the change and reopened bug#35166 -- the problem there
> will have to be fixed in a different way.
>

Thanks for that quick fix! This restores the old `revert-buffer' behavior.
[Message part 2 (text/html, inline)]

Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 25 Aug 2021 13:45:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35166; Package emacs. (Wed, 24 Aug 2022 11:40:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 35166 <at> debbugs.gnu.org
Subject: Re: bug#35166: 27.0.50; Buffer state inconsistent after
 vc-retrieve-tag
Date: Wed, 24 Aug 2022 13:39:23 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> Suppose the following workflow for exploring code, under version
> control:
> 1. Start emacs: emacs -Q.
> 2. Visit a directory in Dired mode, e.g. C-x d "emacs/lisp/eshell".
> 3. Navigate to a file, and type 'v'.
> 4. While exploring, one may wish to switch branch, so type:
> C-x v r BRANCH-NAME

This is now fixed in Emacs 29.





bug marked as fixed in version 29.1, send any further explanations to 35166 <at> debbugs.gnu.org and Mauro Aranda <maurooaranda <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 24 Aug 2022 11:40: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. (Thu, 22 Sep 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 45 days ago.

Previous Next


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