unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35166: 27.0.50; Buffer state inconsistent after vc-retrieve-tag
@ 2019-04-05 21:41 Mauro Aranda
  2019-05-04 21:16 ` Mauro Aranda
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mauro Aranda @ 2019-04-05 21:41 UTC (permalink / raw)
  To: 35166

[-- Attachment #1: Type: text/plain, Size: 1820 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 2198 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-08-24 11:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-05 21:41 bug#35166: 27.0.50; Buffer state inconsistent after vc-retrieve-tag Mauro Aranda
2019-05-04 21:16 ` Mauro Aranda
2021-06-22 17:30 ` Lars Ingebrigtsen
2021-06-22 17:40   ` Lars Ingebrigtsen
2021-06-23 15:13   ` Mauro Aranda
2021-07-22 14:25     ` Lars Ingebrigtsen
2022-08-24 11:39 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).