all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jens Schmidt via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 63949@debbugs.gnu.org, manuel@ledu-giraud.fr
Subject: bug#63949: 30.0.50; `vc-print-log´ does not erase buffer when called from *vc-change-log* buffer, at least for CVS logs
Date: Sat, 10 Jun 2023 17:44:26 +0200	[thread overview]
Message-ID: <ea31a54d-c18f-143f-42f1-6920f5e0009e@vodafonemail.de> (raw)
In-Reply-To: <834jnf26v2.fsf@gnu.org>

On 2023-06-10  08:01, Eli Zaretskii wrote:

> Why do you think it's a problem?  I can justify this behavior, at 
> least in some use cases.

Let's distinguish "VC-controlled buffers" like the buffer of a
VC-controlled file or a *vc-dir* buffer or a dired buffer of
VC-controlled directory.  And "VC working buffers", like
*vc-change-log*, *vc-log*, *vc-diff*.

It is my understanding that `vc-parent-buffer' in a VC working buffer
points to the VC-controlled buffer from which it originates.  The
rationale of that variable is to allow VC operations from a VC working
buffer as if executed on the original VC-controlled buffer.  So I can do
C-x v l, pick a commit, do a C-x v ~ on that commit, then a C-x v =, and
all these operations would automagically relate to the original
VC-controlled buffer.  At least I use that concept frequently.

The documentation on `vc-parent-buffer', unfortunately, is out of date 
and does not necessarily support my understanding:

   ;; In a log entry buffer, this is a local variable
   ;; that points to the buffer for which it was made
   ;; (either a file, or a directory buffer).

However, this has been working as described by me up to and including
Emacs 27.  So at least we can say that the fix fur bug#40967 has changed
established behavior.

And also the following code snippet from function `vc-deduce-fileset-1'
seems to prove my point:

   ((and (buffer-live-p vc-parent-buffer)
         ;; FIXME: Why this test?  --Stef
         (or (buffer-file-name vc-parent-buffer)
             (with-current-buffer vc-parent-buffer
               (or (derived-mode-p 'vc-dir-mode)
                   (derived-mode-p 'dired-mode)
                   (derived-mode-p 'diff-mode)))))
    (progn          ;FIXME: Why not `with-current-buffer'? --Stef.
      (set-buffer vc-parent-buffer)
      (vc-deduce-fileset-1 not-state-changing
                           allow-unregistered
                           state-model-only-files)))

Meaning: If the current buffer has a live vc-parent-buffer, this
function switches to it and deduces the fileset from that.  Plus it
leaves the VC parent buffer current, which is important for follow-up
code to keep the VC parent buffer unchanged.

That logic used to work as intended (by me) up to Nathan's commit, which
put a `with-current-buffer' around the whole function and rendered the
`set-buffer' side effect pointless.

Let's put it that way: The pre-28 logic of handling the VC parent buffer
was not necessarily clean, as also pointed out by Stefan.  But I think
the concept of having a stable VC parent buffer across multiple VC
operations is nice, and changing it midway according to rather unclear
rules undesirable.

Ideally, we would have a fix that handled indirect buffers and VC parent
buffers (which are somewhat similar by concept) all consistently and
nicely and in a stable way, at the same time fixing both issues that I 
have.  I'll mediate about that...





  reply	other threads:[~2023-06-10 15:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07 21:04 bug#63949: 30.0.50; `vc-print-log´ does not erase buffer when called from *vc-change-log* buffer, at least for CVS logs Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-08 13:12 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-08 20:21   ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-08 21:33     ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-08 22:10       ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-09  6:09         ` Eli Zaretskii
2023-06-09 20:27           ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-10  6:01             ` Eli Zaretskii
2023-06-10 15:44               ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-06-10 15:55                 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-10 17:23                 ` Eli Zaretskii
2023-06-10 21:18                   ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-11  5:06                     ` Eli Zaretskii
2023-06-16 19:33                   ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-17  3:15                     ` Dmitry Gutov
2023-06-18  2:42                     ` Dmitry Gutov
2023-06-18  5:35                       ` Eli Zaretskii
2023-06-18  9:11                         ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-18 12:00                           ` Dmitry Gutov
     [not found]                             ` <e695eaa4-2f39-1b20-1cd4-fe7fdaeb3d61@vodafonemail.de>
2023-06-20  2:41                               ` Dmitry Gutov
2023-06-21 13:03                                 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-21 14:37                                   ` Dmitry Gutov
2023-06-21 15:30                                     ` Eli Zaretskii
2023-06-24  3:08                                       ` Dmitry Gutov
2023-06-26 19:54                                         ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-29 21:37                                         ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-30  5:57                                           ` Eli Zaretskii
2023-07-17 19:53                                             ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18  0:55                                               ` Dmitry Gutov
2023-07-18 11:08                                                 ` Eli Zaretskii
2023-06-08 22:44 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-09  6:41   ` Eli Zaretskii
2023-06-09 18:44     ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-08 23:09 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea31a54d-c18f-143f-42f1-6920f5e0009e@vodafonemail.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=63949@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jschmidt4gnu@vodafonemail.de \
    --cc=manuel@ledu-giraud.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.