all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Eli Zaretskii <eliz@gnu.org>
Cc: arthur.miller@live.com, emacs-devel@gnu.org
Subject: Re: Missing snprintf in ucrt mingw + vc-refresh in find-file hook?
Date: Wed, 14 Feb 2024 19:01:10 +0200	[thread overview]
Message-ID: <f8b4c826-0088-4939-8b59-9d6aaa7cfee2@gutov.dev> (raw)
In-Reply-To: <865xyrxa3o.fsf@gnu.org>

On 14/02/2024 18:51, Eli Zaretskii wrote:
>> Date: Wed, 14 Feb 2024 18:36:47 +0200
>> Cc: arthur.miller@live.com, emacs-devel@gnu.org
>> From: Dmitry Gutov <dmitry@gutov.dev>
>>
>>> What is the purpose of such a change?  Does it target users who don't
>>> want vc-refresh-state in find-file-hook, but still want the VC info
>>> shown on the mode line?
>>
>> Those in particular won't see an immediate benefit, but, to reiterate:
>>
>>     As a result, we could have Emacs that's a little bit faster for users
>>     with custom mode-lines [that don't show VCS status or backend].
>>
>>     And also [for all users:] any find-file-noselect calls performed in
>>     the background (sometimes those are even done on a list of files)
>>     won't fetch the VCS status eagerly until the buffer is displayed.
> 
> If that's the purpose, why not simply have a value of
> vc-display-status which would cause vc-refresh-state do nothing?
> AFAIU, the result will be the same, but with much less code churn and
> definitely safer.

vc-display-status only affects what the default mode-line does, and not 
the myriad of alternative configurations.

It cleaner to let the work happen when it's really required to happen, 
rather than guess in advance based on an imprecise indicator like this.

>>   > That sounds like a strange preference, since
>>   > find-file-hook is called just once per file buffer, whereas showing
>>   > the info on the mode line can potentially cause vc-refresh-state (or
>>   > something similar) to be called much more frequently, right?
>>
>> The backend and the state are cached in vc-file-prop-obarray, so it
>> shouldn't result in more process calls, no matter the scenario. It's
>> mostly about how early we fetch this information.
> 
> My point is that find-file-hook has an explicit and very specific
> trigger for fetching the VC information, whereas doing that from the
> mode line doesn't have that advantage, and will probably need to call
> VC much more frequently in order not to miss changes.

Again: the backend and state are cached. Why would VC be called more?



  reply	other threads:[~2024-02-14 17:01 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12 10:06 Missing snprintf in ucrt mingw + vc-refresh in find-file hook? Arthur Miller
2024-02-12 13:44 ` Dmitry Gutov
2024-02-12 13:56   ` Arthur Miller
2024-02-12 14:58     ` Dmitry Gutov
2024-02-12 16:49       ` Eli Zaretskii
2024-02-12 18:05         ` Dmitry Gutov
2024-02-12 19:15           ` Eli Zaretskii
2024-02-12 19:25             ` Dmitry Gutov
2024-02-12 19:34               ` Eli Zaretskii
2024-02-13  9:47       ` Arthur Miller
2024-02-13 13:36         ` Eli Zaretskii
2024-02-13 14:30           ` Arthur Miller
2024-02-13 21:26           ` Dmitry Gutov
2024-02-13 23:10             ` Arthur Miller
2024-02-14  3:42               ` Dmitry Gutov
2024-02-14 21:04                 ` Arthur Miller
2024-02-14 22:37                   ` Dmitry Gutov
2024-02-15 11:16                     ` Arthur Miller
2024-02-14 14:30             ` Eli Zaretskii
2024-02-14 16:36               ` Dmitry Gutov
2024-02-14 16:51                 ` Eli Zaretskii
2024-02-14 17:01                   ` Dmitry Gutov [this message]
2024-02-14 17:29                     ` Eli Zaretskii
2024-02-14 21:05                       ` Dmitry Gutov
2024-02-12 14:36 ` Eli Zaretskii
2024-02-13 10:44   ` Arthur Miller
2024-02-13 13:13     ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2024-02-12 17:37 Angelo Graziosi
2024-02-13 10:49 ` Arthur Miller
2024-02-13 19:00 ` Arthur Miller
2024-02-13 20:01   ` Eli Zaretskii
2024-02-13 22:05     ` Arthur Miller
2024-02-14 14:45       ` Eli Zaretskii
2024-02-14 18:43         ` Arthur Miller
2024-02-13 21:26   ` Angelo Graziosi
2024-02-13 22:09     ` Arthur Miller
2024-02-13 22:21       ` Angelo Graziosi
2024-02-13 22:26         ` Arthur Miller

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=f8b4c826-0088-4939-8b59-9d6aaa7cfee2@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=arthur.miller@live.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.